Excuse me, how to use the timer?
#1

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

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
Reply
#3

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)