Blockland Forums > Modification Help
Find Any Client
Pages: (1/1)
Greek2me:
Does anyone know of a function to get a client from the server? It can be any client, but it can't use FindClientByName or *ByBL_ID.
I did find this function, findLocalClient(), but I don't know anything about it's usage. Thanks
MegaScientifical:
Having the client number of anyone as a client is completely useless. What are your intentions? I think I actually know an area where it sends client number, although as I said, useless.
If you're doing this serverside, this is how I get the local client. It's an old method I haven't even tested in years, so if it's broken now, I dunno:
--- Code: ---function getLocal() {
for (%c = 0; %c < ClientGroup.getCount(); %c++) {
%client = ClientGroup.getObject(%c);
if(($Server::Dedicated && %client.bl_id == getNumKeyID()) || %client.getRawIP() $= "local")
return %client;
}
}
--- End code ---
Greek2me:
All I want to do is grab a random client so that I can call servercmds with it.
MegaScientifical:
Well, you can only do that junk serverside, so try this:
--- Code: ---function getRandomClient() {
return ClientGroup.getObject(getRandom(ClientGroup.getCount()));
}
--- End code ---
Should work.
Greek2me:
Thanks, that works great. Before I lock this up though, does anyone know the usage for handleClearBricks()? I traced a servercmdclearallbricks and I came on it in this form:
--- Code: ---handleClearBricks(20 MsgClearBricks, Greek2me cleared all bricks.)
--- End code ---
Does anyone know the variables for those arguments?
For those curious, I am trying to clear bricks, but I need to know when they are cleared, and this is the last function called when clearing bricks.
Pages: (1/1)