Blockland Forums > Modification Help

Get clients in server

Pages: << < (2/3) > >>

ThinkInvisible:


--- Quote from: otto-san on March 25, 2011, 08:10:36 PM ---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.

--- End quote ---

Correction :

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


otto-san:

I keep making that mistake! D:

It's only with getClassName(). It's annoying.

So long as you caught it, haha.

ThinkInvisible:

The problem still stands. We needs Badspot, or Xalos, or Bauklotz, or SOMEBODY.

lilboarder32:

What exactly are you trying to do? You can get the names from the Player List:

--- Code: ---for(%i=0;%i<NPL_List.rowCount();%i++)
{
   %name = getField(NPL_List.getRowText(%i),1);
   //Do stuff with name?
}
--- End code ---


otto-san:


--- Quote from: lilboarder32 on March 25, 2011, 09:31:00 PM ---What exactly are you trying to do? You can get the names from the Player List:

--- Code: ---for(%i=0;%i<NPL_List.rowCount();%i++)
{
   %name = getField(NPL_List.getRowText(%i),1);
   //Do stuff with name?
}
--- End code ---

--- End quote ---
Oh lol.

Pages: << < (2/3) > >>

Go to full version