Excuse me, how to use the timer? - 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)
+--- Thread: Excuse me, how to use the timer? (
/showthread.php?tid=497674)
Excuse me, how to use the timer? -
799023555 - 28.02.2014
I'm going to use a timer timing generating a checkpoint. When a player enters the checkpoint, he will get some money and the checkpoint will be reborn after 10 minutes. (When a player enters the checkpoint, the system will tell all the players, checkpoints will be reborn after 10 minutes when a checkpoint is reborn, the system will tell all players check has been reborn.) how to achieve?
Sorry for my bad English.
Re: Excuse me, how to use the timer? -
Knekt - 28.02.2014
I'm not sure if settimerex is really that accurate according to wiki.sa-mp.com, but here's how I would do it:
pawn Код:
new RebornCheckpoint_timer[MAX_PLAYERS];
RebornCheckpoint_timer = SetTimerEx("RebornCheckpoint", 600000, false, "i", playerid);
forward public RebornCheckpoint(playerid);
public RebornCheckpoint(playerid)
{
RebornedCheckpoint = createdynamiccp or whatever you're using
SendClientMessageToAll(-1,"cp has been reborned");
KillTimer(RebornCheckpoint_timer[playerid]);
return 1; //is this really necessary? i'm not sure lol
}
https://sampwiki.blast.hk/wiki/SetTimerEx
Re: Excuse me, how to use the timer? -
FalconWingsX - 28.02.2014
SetTimerEX isn't necessary, since it doesn't need to bind to a player or a vehicle,
https://sampwiki.blast.hk/wiki/SetTimer
Easier way would be to start the timer once the player has entered the checkpoint, and then create the checkpoint once the timer has ended.
Re: Excuse me, how to use the timer? -
Knekt - 28.02.2014
Quote:
Originally Posted by FalconWingsX
SetTimerEX isn't necessary, since it doesn't need to bind to a player or a vehicle,
https://sampwiki.blast.hk/wiki/SetTimer
Easier way would be to start the timer once the player has entered the checkpoint, and then create the checkpoint once the timer has ended.
|
My bad, automatically assumed it was something else it was going to be used for
so yeah, use settimer instead :P