06.06.2013, 00:30
Quote:
|
I made this :
forward Cooldowntimer(playerid, idx); public Cooldowntimer(playerid, idx) { PlayerInfo[playerid][pcooldown] - 1; return 1; } And to command i added this one : SetTimer("cooldowntimer", 5000, true); But its not working at all ;( |
As well, you have the "idx" parameter, which isn't used in that function.
Try to use this:
pawn Код:
//// in the top of your gamemode
new Timer:CoolDown;
forward CoolDownTimer(playerid);
//// somewhere in your gamemode
public CoolDownTimer(playerid) {
if(PlayerInfo[playerid][pcooldown] == 0) {
KillTimer(CoolDown);
return 1;
}
PlayerInfo[playerid][pcooldown]--;
return 1;
}
//// On the command you want
CoolDown = SetTimerEx("CoolDownTimer", 5000, true, "i", playerid);


