| Blockland Forums > Modification Help |
| (NewProblem) GUI scripting Help |
| (1/2) > >> |
| xcruso:
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. |
| Fluff-is-back:
You need to parent a TextListCtrl to the ScrollCtrl. Then use --- Code: ---ListControlObjectName.addRow([ID], [value]); --- End code --- So you can do something like: --- Code: ---function ServerCmdAdd(%client, %name) { list.addRow($id++, %name); } --- End code --- |
| xcruso:
--- Quote from: Fluff-is-back on September 05, 2011, 08:16:43 AM ---You need to parent a TextListCtrl to the ScrollCtrl. Then use --- Code: ---ListControlObjectName.addRow([ID], [value]); --- End code --- So you can do something like: --- Code: ---function ServerCmdAdd(%client, %name) { list.addRow($id++, %name); } --- End code --- --- End quote --- 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 |
| xcruso:
Bump |
| Fluff-is-back:
--- Quote from: xcruso on September 05, 2011, 10:10:09 AM ---What does $id++ do? --- End quote --- This increments the value of $id by 1. Therefore each row will have a unique id. --- Quote from: xcruso on September 04, 2011, 04:57:05 PM ---1: How do you make the Id of name popup to by only saying /add name if that is possible. --- Code: ---// 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; --- End code --- --- End quote --- Hope this helps. |
| Navigation |
| Message Index |
| Next page |