View Single Post
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-14-2017 , 21:27   Re: How to limit a command to usage every x minutes
Reply With Quote #2

Store get_systime() in a global variable each time the command is executed. Before actually executing the command, check if get_systime() minus the stored time is greater than 60 (seconds). If it is, execute the command, otherwise, don't execute the command and optionally print a message explaining why the command wasn't executed.

This is quite a simple concept so I'd recommend that you try it out yourself. If you can't get it to work after trying to write the code yourself, the code that you tried and we can help you fix it.

P.S. threads in the "Code Snippets/Tutorials" forum, are either code snippets or tutorials, not requests for anything. Since you are looking for scripting help, you should post this in Scripting Help. I reported the post so maybe a moderator will move it for you.
__________________
fysiks is offline