Author Topic: (NewProblem) GUI scripting Help  (Read 555 times)

Hey i made this GUI here and I'm using GuiScrollCtrl  same as I see in the AdminGui, So i cant remember the function that makes me add people into it.
 
Example: When player's join they get into the play list.

Anyone know how i can add people into a another list in a diffrent way, With   /add (name)   = makes them get into the list

Anyone skilled enough to help me ?  :D

Edit: Bump

New Problem.

If you make a list of names:

1: How do you make the Id of name popup to by only saying /add name if that is possible.
2: how do i make the names stay there.
3: How do i remove a specific name from the list.

All this is inside an GUI    i use server_name  and the coding is inside a server.cs   also   i use servercmd
tell me if there is something i am doing wrong.
« Last Edit: September 06, 2011, 02:11:32 PM by xcruso »

You need to parent a TextListCtrl to the ScrollCtrl. Then use
Code: [Select]
ListControlObjectName.addRow([ID], [value]);
So you can do something like:

Code: [Select]
function ServerCmdAdd(%client, %name)
{
list.addRow($id++, %name);
}
« Last Edit: September 05, 2011, 08:18:39 AM by Fluff-is-back »

You need to parent a TextListCtrl to the ScrollCtrl. Then use
Code: [Select]
ListControlObjectName.addRow([ID], [value]);
So you can do something like:

Code: [Select]
function ServerCmdAdd(%client, %name)
{
list.addRow($id++, %name);
}

What does $id++ do?

And i made a list  that will Show Names under    Name    and Bl_ID    under   Bl_ID
how do i make the id of the name i add get into the list at the same time to?



New Problem Below
« Last Edit: September 05, 2011, 02:50:47 PM by xcruso »

« Last Edit: September 06, 2011, 02:12:56 PM by xcruso »

What does $id++ do?

This increments the value of $id by 1. Therefore each row will have a unique id.

1: How do you make the Id of name popup to by only saying /add name if that is possible.

Code: [Select]
// Firstly you need to get the row ID, this can be done by getting the selected row's ID
%rowId = listObject.getSelectedID();
// Then we need to get the name from the row
%name = listObject.getRowTextById(%rowId);
// You would then need to use findClientByName to get the client of the player
%client = findClientByName(%name);
// Then getting the ID of the client is easy
%id = %client.bl_id;

Hope this helps.

This increments the value of $id by 1. Therefore each row will have a unique id.

Hope this helps.


Thanks,

I still need help with some of the questions.

Edit: What do i do with  list.addRow($id++, %name);   After all this new var's ?

Edit: New Problem Below


Ok, New problem is that when i exec the gui i made, the dedicated server window crashes  (i try ed to exec it there because the gui wasnt ingame when i joined the dedi server)

please help :D
« Last Edit: September 06, 2011, 01:25:35 PM by xcruso »