07.01.2016, 21:50
Change this:
To this:
This will give a 5 seconds cooldown. You don't need to add *60 because SetTimerEx and SetTimer are in milliseconds ( 1000 milliseconds = 1 second ). You also want to have it on true, because if it's on false, the timer will be set only once and FishingTime callback will be called only once. If we make it True, it will call it until FishTime[playerid] = 0;
Also, public FishingTime(playerid) or whatever you got should include this:
Код:
if(Fished[playerid] >= 5) { Fished[playerid] = 0; FishTime[playerid] = 60*5; SetTimerEx("FishingTime", 1000, false, "i", playerid); }
Код:
if(Fished[playerid] >= 5) { Fished[playerid] = 0; FishTime[playerid] = 5; SetTimerEx("FishingTime", 1000, true, "i", playerid); }
Also, public FishingTime(playerid) or whatever you got should include this:
Код:
if(FishTime[playerid] > 0) { FishTime[playerid]--; }