SA-MP Forums Archive
Timer bug? - 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: Timer bug? (/showthread.php?tid=249907)



Timer bug? - Tommy_Mandaz - 21.04.2011

Hey, this is my timer:

pawn Код:
SetTimer("TruckerDeliver", 30000, 0);
I want it so that when the player enters the checkpoint it starts it so I did this:

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
        SetTimer("TruckerDeliver", 30000, 0);
    return 1;
}
The problem is once one person enters the checkpoint the timer starts for everyone? I only want it to start for that on player who entered the checkpoint help?


Re: Timer bug? - antonio112 - 21.04.2011

For that, you`ll have to use SetTimerEx, like:
pawn Код:
SetTimerEx( "TruckerDeliver", 1000, false, "i", playerid );
And for the TruckerDeliver function, use:
pawn Код:
forward TruckerDeliver(playerid);
public TruckerDeliver(playerid)
{
 //bla bla
}



Re: Timer bug? - Tommy_Mandaz - 21.04.2011

Thanks so much