I need a timer
#9

Quote:
Originally Posted by scout322
Посмотреть сообщение
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 ;(
So, for other words, the function CoolDownTimer has 2 parameters, and you're simply trying to use that function without the parameters.
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);
That should do the job.
Reply


Messages In This Thread
I need a timer - by scout322 - 05.06.2013, 18:30
Re: I need a timer - by scout322 - 05.06.2013, 18:44
Re: I need a timer - by scout322 - 05.06.2013, 19:55
Re: I need a timer - by Pottus - 05.06.2013, 20:02
Re: I need a timer - by scout322 - 05.06.2013, 20:04
Re: I need a timer - by scout322 - 05.06.2013, 20:10
Re: I need a timer - by scout322 - 05.06.2013, 21:53
Re: I need a timer - by Vince - 05.06.2013, 22:41
Re: I need a timer - by GWMPT - 06.06.2013, 00:30
Re: I need a timer - by scout322 - 06.06.2013, 06:46

Forum Jump:


Users browsing this thread: 1 Guest(s)