Author Topic: Find Any Client  (Read 531 times)

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

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: [Select]
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;
}
}
« Last Edit: October 30, 2010, 02:30:51 PM by MegaScientifical »

All I want to do is grab a random client so that I can call servercmds with it.

Well, you can only do that junk serverside, so try this:

Code: [Select]
function getRandomClient() {
return ClientGroup.getObject(getRandom(ClientGroup.getCount()));
}

Should work.

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: [Select]
handleClearBricks(20 MsgClearBricks, Greek2me cleared all bricks.)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.