SetTimerEx
#1

if I want to stop timer job should kill timer or for SetTimerEx is not need?
Reply
#2

sure u also have to use the KillTimer function when using SetTimerEx:

pawn Код:
//definings

new TimerKill[MAX_PLAYERS];

//Set the timer like:

TimerKill[playerid] = SetTimerEx("TimerExample",1000,true,"i",playerid);

//Kill the timer like:

KillTimer(TimerKill[playerid]);
TimerKill[playerid]=-1;
Is that what u wanted to know?
Reply
#3

Yeah dude thanks dude
I just think, that is not need for SetTimerEx.
For SetTimer I know as well, but for this I won't
Reply
#4

It's just an example
pawn Код:
//At The Top
new JobTimer;
pawn Код:
public OnGameModeInit()
{
    JobTimer = SetTimerEx("YourJob", 180000, false, "i", 1);
    return 1;
}

//There you want it
KillTimer(xReactionTimer);
Reply
#5

just use it like above and everything will work properly

@Kostas: u have to use the [playerid], otherwise the timers of different players might mix up!
Reply
#6

Quote:
Originally Posted by BlackWolf120
Посмотреть сообщение
@Kostas: u have to use the [playerid], otherwise the timers of different players might mix up!
Thanks for the information
I never script for RP and I only use Timers that doesn't need playerid.
Reply
#7

Guys thanks. but exmples for me don't need
Reply
#8

The SetTimerEx function got nothing to do with RP but im happy i could help.
Reply
#9

Respect for you both
Reply
#10

Quote:
Originally Posted by BlackWolf120
Посмотреть сообщение
The SetTimerEx function got nothing to do with RP but im happy i could help.
I didn't say that SetTimerEx is only for RP, but I used it only for vehicles and some others. Not for playerid.
Like
pawn Код:
SetTimerEx("cardestroyedhide", 5000, 0, "i", vehicleid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)