Timer crashing my GM
#1

Well, I use a timer to detect when a player leaves the airport:
pawn Код:
forward OtherTimer();
forward CheckForExitAirport(playerid);
pawn Код:
OnGameModeInit //blabla
SetTimer("OtherTimer", 1000, 1);
pawn Код:
public OtherTimer()
{
    new string[256];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
      {
        if (TutStep[i] == 1) CheckForExitAirport(i);
        //blabla
      }
     }// blabla
    return 1;
}
pawn Код:
public CheckForExitAirport(playerid)
{
    if(!PlayerToPoint(80.0, playerid, NOOB_X, NOOB_Y, NOOB_Z))
    {
      PlayerPlaySound(playerid, 1138, 0.0, 0.0, 0.0);
      SendClientMessage(playerid, COLOR_WHITE, "");
        SendClientMessage(playerid, COLOR_GREEN, "Ok, vous avez rйusssi а quitter l'aйroport, c'est une premiиre йtape.");
        SendClientMessage(playerid, COLOR_GREEN, "Maintenant il vous faut un peu d'argent, allez donc retirer quelques dollars а la banque.");
        SetPlayerCheckpoint(playerid, 1462.45874,-1012.13733,26.84379, 5.0); //Bank Entrance
        TutStep[playerid] = 2;
    }
}
But the problem is that as soon as I leave the airport I hear the sound and then I get "Gamemode restarting" server didn't respond, etc...

Any idea? Thanks in advance
Reply
#2

put a space on the SendClientMessage " " instead of ""
Reply
#3

Quote:
Originally Posted by Daren_Jacobson
put a space on the SendClientMessage " " instead of ""
It works, thanks

Btw, why "" doesn't work?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)