Fishing : Make Player Wait
#2

Change this:

Код:
        if(Fished[playerid] >= 5)
	{
		Fished[playerid] = 0;
		FishTime[playerid] = 60*5;
		SetTimerEx("FishingTime", 1000, false, "i", playerid);
	}
To this:

Код:
        if(Fished[playerid] >= 5)
	{
		Fished[playerid] = 0;
		FishTime[playerid] = 5;
		SetTimerEx("FishingTime", 1000, true, "i", playerid);
	}
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(FishTime[playerid] > 0) { FishTime[playerid]--; }
Reply


Messages In This Thread
Fishing : Make Player Wait - by Mikeydoo - 07.01.2016, 21:46
Re: Fishing : Make Player Wait - by Lucky13 - 07.01.2016, 21:50
Re: Fishing : Make Player Wait - by Mikeydoo - 07.01.2016, 21:52
Re: Fishing : Make Player Wait - by Lucky13 - 07.01.2016, 21:55
Re: Fishing : Make Player Wait - by Mikeydoo - 07.01.2016, 22:02
Re: Fishing : Make Player Wait - by Lucky13 - 07.01.2016, 22:04
Re: Fishing : Make Player Wait - by Mikeydoo - 07.01.2016, 22:09
Re: Fishing : Make Player Wait - by Lucky13 - 07.01.2016, 22:13
Re: Fishing : Make Player Wait - by Mikeydoo - 07.01.2016, 22:19
Re: Fishing : Make Player Wait - by Lucky13 - 07.01.2016, 22:23

Forum Jump:


Users browsing this thread: 1 Guest(s)