SA-MP Forums Archive
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=217374)



Timer help. - ThePwherer - 27.01.2011

Hey i wanted to set a timer and i wanted to know where to put this code, and also where do i put the message i want to send in command form. Thanks for help! (I love you too haters <3)

forward message(second, msg[]);

public OnGameModeInit()
{
print("Starting timer...");
SetTimerEx("message", 1000, false, "is", 1337, "hello!");
}

public message(second, msg[])
{
printf("%i second has passed, also we have a message: %s", second, msg);
return 1;
}


Re: Timer help. - bartje01 - 27.01.2011

There is already a ongamdemodeinit.
So put
pawn Код:
print("Starting timer...");
SetTimerEx("message", 1000, false, "is", 1337, "hello!");
to your ongamemodeinit

the
pawn Код:
forward message(second,msg[]);
At the top of your scripts below your a_samp include

the public message anywhere in your script.
I recommend at the bottom