SA-MP Forums Archive
[PAWNO] Timer with warnings - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [PAWNO] Timer with warnings (/showthread.php?tid=250696)



[PAWNO] Timer with warnings - driftpower - 24.04.2011

Hey everyone, good morning

ok, here's my problem, i've this timer to resetweapons every single second that a player is in a fun zone, and that timer is automaticly disabled when the player goes to dm.

here's the code
Код:
new GunTimer1;

forward GunTimer(playerid);

public GunTimer(playerid)
{
	ResetPlayerWeapons(playerid);
}

forward GunTimerOn(playerid);

public GunTimerOn(playerid)
{
    GunTimer1 = SetTimerEx("GunTimer", 1000, 1);
}

forward GunTimerOff(playerid);

public GunTimerOff(playerid)
{
 KillTimer(GunTimer1);
}
I can't see where's the problem, and the Server get's offline when i turn it on.


Re: [PAWNO] Timer with warnings - iggy1 - 24.04.2011

You are using SetTimerEx incorrectly you need to pass "playerid" as an arguement (in this example), like so
pawn Код:
SetTimerEx("GunTimer", 1000, true, "i", playerid);
But instead of using timers why not just store the weapons in an array, and remove them when they enter the funzone, and give them back when they enter a dm? Would be alot better.