Timer help! - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Timer help! (
/showthread.php?tid=248547)
Timer help! -
IvancheBG - 14.04.2011
Can someone tell me how to make a timer "like type /help to see the commands".I look in
https://sampwiki.blast.hk/wiki/SetTimer and did it but the timer isnt working.Can some tell how.
Re: Timer help! -
xRyder - 14.04.2011
What do you actually want to create?
Like a textdraw or just send client message?
Re: Timer help! -
IvancheBG - 14.04.2011
I want when i connect in my server all player to in the chat Type /Help To See The Commands and then i want it to repeat in 1 minute.
Re: Timer help! -
Pooh7 - 14.04.2011
http://forum.sa-mp.com/showthread.ph...ight=pmessages
Re: Timer help! -
Seven_of_Nine - 14.04.2011
OnPlayerConnect:
pawn Код:
SetTimer("help",60000,false);
anywhere:
pawn Код:
forward help;
public help {
//Feel free to edit the message :D
SendClientMessageToAll(your color here,"/help to see commands");
SetTimer("help",60000,false);
}
Re: Timer help! -
Cameltoe - 14.04.2011
Quote:
Originally Posted by Seven_of_Nine
OnPlayerConnect:
pawn Код:
SetTimer("help",60000,false);
anywhere:
pawn Код:
forward help;
public help { //Feel free to edit the message :D SendClientMessageToAll(your color here,"/help to see commands"); SetTimer("help",60000,false); }
|
After a couple players connect, that snippet would spam them all alot.
Re: Timer help! -
xRyder - 14.04.2011
@Seven_of_Nine - Why not set the timer to repeate...? Instead of making it run over and over, you can make it much easier.
+
What Cameltoe said in post above. That would be problem...
Re: Timer help! -
IvancheBG - 14.04.2011
OK what to do then?Pooh 7 i want my on timer not this FS.
Re: Timer help! -
Cameltoe - 14.04.2011
Quote:
Originally Posted by Pooh7
|
Not what he wanted at all.
Quote:
Originally Posted by xRyder
@Seven_of_Nine - Why not set the timer to repeate...? Instead of making it run over and
|
pawn Код:
new
HelpTimer[MAX_PLAYERS];
command(help, playerid, params[])
{
if(HelpTimer[playerid]) { KillTimer(HelpTimer[playerid]); HelpTimer[playerid] = 0; }
else SetTimerEx("HelpFunction", 60 * 1000, true, "i", playerid);
return 1;
}
forward HelpFunction(playerid);
public HelpFunction(playerid)
{
SendClientMessage(playerid, 0x0, "Help message # 1.");
return 1;
}
Should work, and wont spam the players.
Remember to kill the timer OnPlayerDisconnect.
Re: Timer help! -
IvancheBG - 14.04.2011
Ok but where to put all these stuff