SA-MP Forums Archive
First timer not running? - 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: First timer not running? (/showthread.php?tid=283633)



First timer not running? - Memoryz - 15.09.2011

This is my ongamemodeinit:

pawn Код:
public OnGameModeInit()
{
    SetGameModeText("Team DM");
    SetTeamCount(2);
    AddPlayerClass(287, 887.95794678,-2409.54443359,23.77285576, 180, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(272, 887.95794678,-2409.54443359,23.77285576, 180, 0, 0, 0, 0, 0, 0);
    Map = 0;
    SendRconCommand("mapname Round End");
    LoadLostMap();
    SetNameTagDrawDistance(8.0);
    CreateVehicle(520, 0.0, 0.0, 0.0, 0.0, 0, 0, 1);
    SetTimer("MatchCron",1000,1);
    SetTimer("servercron",5090,1);
    mysql_init();
    mysql_connect(MYSQLHOST, MYSQLUSER, MYSQLKEY, MYSQLDB);
    CheckMySQLConnection();
    return 1;
}
The first timer NEVER runs, only the second, I can even switch their positions, the first one will never run.

I am clueless on how to fix this, can anyone help me out?


Re: First timer not running? - [L3th4l] - 15.09.2011

Post the "MatchCron" callback, something is probably stopping it from running. You could also add debug lines at the start of the callback and at the end. Also add debug lines under OGMI.


Re: First timer not running? - Memoryz - 15.09.2011

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
Post the "MatchCron" callback, something is probably stopping it from running.
If I put servercron on top, servercron wont run, and matchcron will.

It's nothing to do with the callbacks themselves


Re: First timer not running? - Kar - 15.09.2011

What is LoadLostMap();


Re: First timer not running? - Memoryz - 15.09.2011

Quote:
Originally Posted by Kar
Посмотреть сообщение
What is LoadLostMap();
It just creates objects.


Re: First timer not running? - =WoR=Varth - 15.09.2011

Post "MatchCron" and "servercron" code?


Re: First timer not running? - Memoryz - 15.09.2011

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
Post "MatchCron" and "servercron" code?
It has nothing to do with them, I just added a fake timer to the front, and the two both work perfectly. But I need them to work without a fake timer infront of them both.


Re: First timer not running? - RelaxCafe - 15.09.2011

Are you sure you have spelled it right? Isn't it suppose to be "MatchRcon" and not "MatchCron"?


Re: First timer not running? - Kar - 16.09.2011

pawn Код:
public OnGameModeInit()
{
    SetTimer("MatchCron",1000,1);
    SetTimer("servercron",5090,1);
    SetGameModeText("Team DM");
    SetTeamCount(2);
    AddPlayerClass(287, 887.95794678,-2409.54443359,23.77285576, 180, 0, 0, 0, 0, 0, 0);
    AddPlayerClass(272, 887.95794678,-2409.54443359,23.77285576, 180, 0, 0, 0, 0, 0, 0);
    Map = 0;
    SendRconCommand("mapname Round End");
    LoadLostMap();
    SetNameTagDrawDistance(8.0);
    CreateVehicle(520, 0.0, 0.0, 0.0, 0.0, 0, 0, 1);
    mysql_init();
    mysql_connect(MYSQLHOST, MYSQLUSER, MYSQLKEY, MYSQLDB);
    CheckMySQLConnection();
    return 1;
}
try that?