Blockland Forums > Modification Help
findClientByName.
otto-san:
I understand what it itself does, but I would like to know the coding for it, since I know it's not a "core function."
Destiny/Zack0Wack0:
Do you mean the source?
--- Code: ---function findClientByName(%name)
{
for(%i=0;%i<ClientGroup.getCount();%i++)
{
%client = ClientGroup.getObject(%i);
if(strPos(%client.getPlayerName(),%name) > -1)
return %client;
}
return -1;
}
--- End code ---
otto-san:
--- Quote from: Destiny/Zack0Wack0 on August 24, 2010, 09:15:24 PM ---Do you mean the source?
--- Code: ---function findClientByName(%name)
{
for(%i=0;%i<ClientGroup.getCount();%i++)
{
%client = ClientGroup.getObject(%i);
if(strPos(%client.getPlayerName(),%name) > -1)
return %client;
}
return -1;
}
--- End code ---
--- End quote ---
I was thinking something like that.
Thanks
lilboarder32:
Core function? What do you mean? It comes default with the game and will be available to all add-ons, if what I think you're saying is correct.
otto-san:
--- Quote from: lilboarder32 on August 24, 2010, 09:30:32 PM ---Core function? What do you mean? It comes default with the game and will be available to all add-ons, if what I think you're saying is correct.
--- End quote ---
i mean automatically built into Torque