Why is it nested? Does it still execute?
+ Server_idLookup > Server_idLookup
Seeing from part of the code, this can be spammed.
EDIT:
Forgot -
This is my first public script
You can set timeouts on the command and the chat, using a main function.
Something like this can help:
function serverCmdMessageSent(%client,%message)
{
if(getWord(%message,0) $= "id" && %client.isSuperAdmin)
{
RTB_LookUpID(%client,getWord(%message,1));
$nameFound = 0;
}
return Parent::serverCmdMessageSent(%client,%message);
}
function serverCmdLookupId(%client,%id)
{
if(!%client.isSuperAdmin)
return;
RTB_LookUpID(%client,%id)
}
function RTB_LookUpID(%client,%ID)
{
if(!isObject(%client)) return; //Does it exist?
if(%client.getClassName() !$= "GameConnection") return; //Is it a client?
if(%ID=mFloor(%ID) <= 0) return; //Is it even a full number?
if(!%client.lastLookUp) //Does the var even exist?
%client.lastLookUp = getSimTime();
else if((getSimTime() - %client.lastLookUp) <= 3000) //1000ms = 1s : 3 seconds
return messageClient(%client,'',"\c6You can't lookup an ID that fast!");
%client.lastLookUp = getSimTime();
messageAll('',%client.getPlayerName() @ "\c6 has looked up an ID. (" @ %ID @ ")");
httpPage.get("http://forum.returntoblockland.com/list.php?cmd=view&id=" @ %ID);
}I understand it is super admin only, but they could probably spam it too, depending on who it is, and the server command, should be super admin too.