//A
if(!%client.lastCmdtime)
%client.lastCmdtime = $sim::time - 15;
//B
if(%client.lastCmdtime + 15 < $sim::time)
{
//Stuffs goes here
messageClient(%client, '', "\c3You executed your command!");
%client.lastCmdtime = $sim::time;
}
//C
else
{
messageClient(%client, '', "\c3No Spamming");
return;
}
Heres a quick breakdown:
A -- Checks if the variable "%client.lastCmdtime" exists. If it does not, it creates the variable and assigns &sim::time to it (The current time).
B -- If the variable %client.lastCmdtime plus 15 is less than the current time it executes the stuff and sets %client.lastCmdtime to the current time. The 15 in the if statement is saying: "If 15 seconds have gone by then execute it".
C -- Well, i'm sure you already know this: "Else message the client and 'return;' the script (stop it)
Hope this helps!
EDIT: Just saw Jetz's post. Yeah, instead of putting "//B" in an if statement, you could just:
if(%client.lastCmdtime + 15 > $sim::time)
messageClient(%client, '', "\c3No Spamming");
return;
And remove "//C"
Either way would work fine.