10.11.2014, 20:09
You learn the most things from creating things yourself, so I'll just tell you what you should do, then I expect you're gonna try that and then we'll see futher.
* Create a player-based boolean variable (don't use PVars), called something like "HasPlayerUsedPClassCommand" (something like that, not literally, just make sure you know what the variable is for). Use the standard value 'false' (that's done by default so yeah).
* In the command, check the value of this variable. If it's true, they won't be able to use the command because the cooldown isn't over yet (Use it after the PremiumLevel thing, same way).
* If they do succeed to use the command (so if the value was false), run the command (that's just the GivePlayerWeapon stuff). After that, set the value to true.
* Now the important thing: Use a timer to reset the variable back to false. Check it out here: https://sampwiki.blast.hk/wiki/SetTimerEx
* In the callback you called with SetTimerEx(), just put the value back to false and eventually send a message to the player.
It's really simple if you know what you're doing.
* Create a player-based boolean variable (don't use PVars), called something like "HasPlayerUsedPClassCommand" (something like that, not literally, just make sure you know what the variable is for). Use the standard value 'false' (that's done by default so yeah).
* In the command, check the value of this variable. If it's true, they won't be able to use the command because the cooldown isn't over yet (Use it after the PremiumLevel thing, same way).
* If they do succeed to use the command (so if the value was false), run the command (that's just the GivePlayerWeapon stuff). After that, set the value to true.
* Now the important thing: Use a timer to reset the variable back to false. Check it out here: https://sampwiki.blast.hk/wiki/SetTimerEx
* In the callback you called with SetTimerEx(), just put the value back to false and eventually send a message to the player.
It's really simple if you know what you're doing.