//This allows you to message clients with a timeout. //Example: Let's say we message Jhonny's client every time he jumped //Well, that'll cause chat spam right? //With this, you can set a timeout, for example: //smartMessage(jhonny'sClientObject,"You have jumped!",2000); //This will only tell Jhonny he has jumped once, and if he jumps again //Before the 2000 milliseconds is up, it won't say anything. //Enjoy function smartMessage(%client,%message,%timeOut,%type) { if(%client $= "" || %message $= "" || %timeOut $= "") { warn("Field missing \nUsage: smartMessage(%client,%message,%timeout)"); return "0 FIELD MISSING"; } %time = getSimTime(); if(%time - $smartMessageLastTimeOut[%client,%message] > $smartMessageTimeOut[%client,%message]) { %setTimeOut = true; if(%type $= "CenterPrint") commandToClient(%client,'centerprint',%message,3); else if(%type $= "BottomPrint") commandToClient(%client,'bottomprint',%message,3); else messageClient(%client,'',%message); } if(%setTimeOut) { $smartMessageLastTimeOut[%client,%message] = %time; $smartMessageTimeOut[%client,%message] = %timeOut; } return "1 SUCCESS"; }