| Blockland Forums > Modification Help |
| Does every client have a number? |
| << < (2/5) > >> |
| DYLANzzz:
Yes. I believe Chrono is speaking of clientGroup? You can get an obkect from the group using clientGroup.getObject(#); You can get how many clients there are with clientGroup.getCount(); So if clientGroup.getCount() is 5 then you could get the client objects using clientGroup.getObject(0), clientGroup.getObject(1) ... clientGroup.getObject(4) If you want to get all of them, then you can use a for loop |
| Reinforcements:
--- Quote from: DYLANzzz on September 06, 2010, 12:11:52 PM ---Yes. I believe Chrono is speaking of clientGroup? You can get an obkect from the group using clientGroup.getObject(#); You can get how many clients there are with clientGroup.getCount(); So if clientGroup.getCount() is 5 then you could get the client objects using clientGroup.getObject(0), clientGroup.getObject(1) ... clientGroup.getObject(4) If you want to get all of them, then you can use a for loop --- End quote --- How would I check which number a certain client is? Like %client.getClientGroupNumber(); or something? |
| Syntax:
I've already made this mod, it's called a server id, just use %client.bl_id, since that will almost never change. |
| DYLANzzz:
Im not sure. You would probably have to loop through it to get a certain BL_ID or something. --- Code: ---for(&i=0; &i<clientGroup.getCount(); %i++) { if(clientGroup.getObject(%i),bl_id==100) { echo("Found him"); } } --- End code --- --- Quote from: Syntax on September 06, 2010, 12:34:30 PM ---I've already made this mod, it's called a server id, just use %client.bl_id, since that will almost never be changed... --- End quote --- And I think he wants to have a numerical value for everyone (like 0 1 2 3 and not 3605, 11240, 18043, etc etc) |
| Syntax:
--- Quote from: DYLANzzz on September 06, 2010, 12:35:46 PM ---Im not sure. You would probably have to loop through it to get a certain BL_ID or something. --- Code: ---for(&i=0; &i<clientGroup.getCount(); %i++) { if(clientGroup.getObject(%i),bl_id==100) { echo("Found him"); } } --- End code --- And I think he wants to have a numerical value for everyone (like 0 1 2 3 and not 3605, 11240, 18043, etc etc) --- End quote --- Well, I'm thinking he means, if your the 300th player to join his server, your ''server id'' would be 300, which is what i made. It writes a players ''server id'' to a text file, and I use %client.getServerId(); to get the client's ''server id''. If I'm wrong OP, tell me. |
| Navigation |
| Message Index |
| Next page |
| Previous page |