How can i make a cooldown for a command? Like /mycommand, Only to be used by player every 2 mins (Like kits cooldown!)
I have 2 commands, /a and /b, When player types /b, he gets a cooldown for command /a for X seconds :S Thats what i need. I need a command dictionary for that?
Solved Adding a cooldown to a command?
Discussion in 'Rust Development' started by TheMechanical97, Jan 19, 2016.
-
You will need to store the timestamp of when the player last used the command, then use a TimeSpan to check the duration between the saved TimeStamp and the current time - if the TimeSpan.TotalSeconds is above lets say 60 seconds, then allow them to perform the command again and re-save the timestamp again.
-
wow gonna search it on google
-
-
okay mate
-
-
I did it, but dont know why players need to type the command 2 times the first time to create the timestamp :S
[DOUBLEPOST=1453244714][/DOUBLEPOST]Its workinganyways