Kill a timer within a function?
#1

Hello, I wonder how to do a SetTimerEx and the kill it again? I don't want to place the timer in the public scope becuse i want different timers for each player when they call my function.
It's like :
Код:
New TimerCounter[MAX_PLAYERS];

YCMD:starttimer(){
TimerCounter[playerid] = SetTimerEx("Timer", 1000, true, "i", playerid);
}

Public Timer(playerid){
   if(timercounter[playerid] < 10){
   SendClientMessage(playerid, COLOR_YELLOW, "Timer have passed one scound");
   TimerCounter[playerid] ++;
   }
   else{
   SendClientMessage(playerid, COLOR_YELLOW, "Ten secounds have now passed and the timer have been killed");
   }
}
(notice that's not the code it's just a thing i made to get you to understand my problem)
Thanks for all answers!
Reply


Messages In This Thread
Kill a timer within a function? - by Ranama - 29.06.2012, 20:56
Re: Kill a timer within a function? - by [A]ndrei - 29.06.2012, 20:57
Re: Kill a timer within a function? - by Ranama - 29.06.2012, 21:04
Re: Kill a timer within a function? - by [KHK]Khalid - 29.06.2012, 21:08
Re: Kill a timer within a function? - by Ranama - 29.06.2012, 21:11
Re: Kill a timer within a function? - by [KHK]Khalid - 29.06.2012, 21:14
Re: Kill a timer within a function? - by AndreT - 29.06.2012, 21:24

Forum Jump:


Users browsing this thread: 1 Guest(s)