Blockland Forums > Modification Help
Get clients in server
(1/3) > >>
ThinkInvisible:
I need a script to list all clients in a server - the script itself is clientsided.

clientGroup.getCount() isn't working, so i assume that's server sided.

Can someone tell me what to do here? Thanks.
Kalphiter:
listClients(); if it has what you're looking for.
otto-san:
ok


--- Code: ---for(%i = 0; %i < serverConnection.getCount(); %i++)
{
  %b = serverConnection.getObject(%i);
  if(%b.getClassName(); $= "Player")
    echo(%b.getShapeName());
}
--- End code ---

edit: This of course only gets players that are spawned.
ThinkInvisible:

--- Quote from: Kalphiter on March 25, 2011, 08:09:07 PM ---listClients(); if it has what you're looking for.

--- End quote ---

According to my console, that's not a function.

It needs to be client-sided, and get the number of clients on the server.
This is what i have so far:

--- Code: --- %count=clientGroup.getCount(); //Does not work
for(%i=0;%i<%count;%i++)
{
%obj=%c.getObject(%i); //Also does not work because the first one doesn't
                                                     //blah blah blah stuff here
}
--- End code ---


Quoterefafterpost: otto-san, that returns the players, which i assume is spawned players. This needs to cover all clients in the server, even the dead or non-spawned ones.
otto-san:
I tried experimenting with that, I never got it to work.
Navigation
Message Index
Next page

Go to full version