[PAWNO] Timer with warnings
#1

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.
Reply
#2

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)