24.03.2017, 01:14
Don't use the timer.
Create another entry in your enum and use the gettime() + 400 function to save the time plus your desired waiting time (400 in this case) when the player issues the command.
Before the command's functions, make a conditional statement to check if the variable of the player is equal or bigger than the actual gettime() and let the functions execute if the player complies with the requirements.
For saving it just do the same as other integer variables in your PlayerSave function.
The structure would look like this:
Create another entry in your enum and use the gettime() + 400 function to save the time plus your desired waiting time (400 in this case) when the player issues the command.
Before the command's functions, make a conditional statement to check if the variable of the player is equal or bigger than the actual gettime() and let the functions execute if the player complies with the requirements.
For saving it just do the same as other integer variables in your PlayerSave function.
The structure would look like this:
PHP код:
yourcommand
{
check if player variable is NOT over gettime(), then return something;
robbing functions;
set the player variable to = gettime() + 400;
return 1;
}

