SA-MP Forums Archive
Timer Doesn't work. - 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: Timer Doesn't work. (/showthread.php?tid=458515)



Timer Doesn't work. - dorperez - 17.08.2013

Whats wrong with that ??

pawn Код:
forward StartFire(playerid);

new Float:RandomSpawn[][3] =
{
    // Positions, (X, Y, Z)
    {-2796.9854, 1224.8180, 20.5429},
    {-2454.2170, 503.8759, 30.0790},
    {-2669.7322, -6.0874, 6.1328}
};

SetTimer("StartFire", 120000, 1); //2 min

public StartFire(playerid)
{
            new rand = random(sizeof(RandomSpawn));
            SetPlayerCheckpoint(playerid,RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2], 3.0);
            CreateObject(18689,RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2], 0.0, 0.0, 0.0, 50000.0);
            SendClientMessageToAll(COLOR_WHITE, "A BIG FIRE HAS STARTED !");
      return 1;
}
Tnx guys


Re: Timer Doesn't work. - dominik523 - 17.08.2013

what are the errors or warnings?


Re: Timer Doesn't work. - andruz99 - 17.08.2013

SetTimer("StartFire", 120000, 1); //2 min is supposed to be under OnGameModeInit

Код:
public OnGameModeInit()
{
SetTimer("StartFire", 120000, 1); //2 min is supposed to be under OnGameModeInit

return 1;
}



Re: Timer Doesn't work. - dorperez - 17.08.2013

Quote:
Originally Posted by dominik523
Посмотреть сообщение
what are the errors or warnings?
There are not warnings or errors.
Quote:
Originally Posted by andruz99
Посмотреть сообщение
SetTimer("StartFire", 120000, 1); //2 min is supposed to be under OnGameModeInit

Код:
public OnGameModeInit()
{
SetTimer("StartFire", 120000, 1); //2 min is supposed to be under OnGameModeInit

return 1;
}
Thats what I did.