ElitesHost Forums

Full Version: How to create a Timer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone, as we know. Is there people who do not know what is a timer and how to create it. In this tutorial i will teach how to:

We create the timer

Code:

Quote:public OnGameModeInit()
{
                      //==========================================================================
                      // Don't use these lines if it's a filterscript
                      SetGameModeText("Blank Gamemode");

SetTimer("RandomMessage", 5000, 1);


SetTimer is in where create the timer, "RandomMessage" is the name of the callback. (5000 = Five Seconds)

After, we create the forward which will call the callback:

Code:

Quote:forward RandomMessage(playerid);
public RandomMessage(playerid)
{
      SendClientMessage(playerid, 0xFFFFFFFF,"Register at our forum! forum.sa-mp.com");
      return 1;
}


You can create more timers using more stuff.. THis is just a basic tutorial. I hope it helps you...
This tutorial is unhelpful and is messed up, this code wouldn't even compile neither work. I wouldn't explain what are the issues as you are the tutor and you should know what mistakes you have done.

Thread closed.