SA-MP Forums Archive
Can someone give me a 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: Can someone give me a timer (/showthread.php?tid=415405)



Can someone give me a timer - DerickClark - 13.02.2013

it work


Re: Can someone give me a timer - Windrush - 13.02.2013

Can i See What Is The Callback of
pawn Код:
TextDrawShowForPlayer(playerid, Welcome0);
TextDrawShowForPlayer(playerid, Welcome1);
TextDrawShowForPlayer(playerid, Welcome2);
TextDrawShowForPlayer(playerid, Welcome3);



Re: Can someone give me a timer - DerickClark - 13.02.2013

ty for the code.


Re: Can someone give me a timer - Da_Noob - 13.02.2013

So I'm guessing you want a timer to hide all the textdraws?

pawn Код:
forward HideText(playerid);
pawn Код:
public HideText(playerid)
{
TextDrawHideForPlayer(playerid, Text:Welcome0);
TextDrawHideForPlayer(playerid, Text:Welcome1);
TextDrawHideForPlayer(playerid, Text:Welcome2);
TextDrawHideForPlayer(playerid, Text:Welcome3);
return 1;
}
Under OnPlayerConnect

pawn Код:
SetTimerEx("HideText", 20000,  0, "i", playerid);
You can change the 20000 to whatever you want. 20000 = 20 seconds, 1000 = 1 second.


Re: Can someone give me a timer - new121 - 13.02.2013

Quote:
Originally Posted by Da_Noob
Посмотреть сообщение
Under OnPlayerConnect

pawn Код:
SetTimerEx("HideText", 20000,  0, "i", playerid);
You can change the 20000 to whatever you want. 20000 = 20 seconds, 1000 = 1 second.
That is correct but you should always kill a timer after using it!
PHP код:
new HideTxtDrwTimer[MAX_PLAYERS]; //put this at the top of your script somewhere under #include <a_samp> make sure its above OnGameModeInit though and outside of any other callbacks or functions.
HideTxtDrwTimer[playerid] = SetTimerEx("HideTxtDrws",25000false,"i",playerid);//put this in OnPlayerConnect
forward HideTxtDrws(playerid);
public 
HideTxtDrws(playerid)
{
    
TextDrawHideForPlayer(playeridText:Welcome0);
    
TextDrawHideForPlayer(playeridText:Welcome1);
    
TextDrawHideForPlayer(playeridText:Welcome2);
    
TextDrawHideForPlayer(playeridText:Welcome3);
    
KillTimer(HideTxtDrwTimer[playerid]);
    return 
1;