SA-MP Forums Archive
Is there any way to avoid OnPlayerSpawn? - 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: Is there any way to avoid OnPlayerSpawn? (/showthread.php?tid=574988)



Is there any way to avoid OnPlayerSpawn? - Guss - 22.05.2015

Is there any way to avoid the callback OnPlayerSpawn? I would like to say, if the player enters a game and then exits, it returns to spawn, I would like to exit get your health and money before entering the mini-game. The problem is that I have a lot in OnPlayerSpawn data and for the slightest change i must make many arrangements. Is there any way to avoid OnPlayerSpawn? And if not, how could you tell me this?


Re: Is there any way to avoid OnPlayerSpawn? - [KHK]Khalid - 22.05.2015

?

pawn Код:
new IgnoreSpawn[MAX_PLAYERS];

AvoidSpawn(playerid)
{
    IgnoreSpawn[playerid] = true;
}

public OnPlayerSpawn()
{
    if(IgnoreSpawn[playerid] == true)
    {
        IgnoreSpawn[playerid] = false;
        return 1;
    }
    /*
    * put all your code here...
    * no worry because it will not
        * be executed if IgnoreSpawn is true
    */

    return 1;
}



Respuesta: Is there any way to avoid OnPlayerSpawn? - Juand - 23.05.2015

What wanna do?, you can return the value in 0...

pawn Код:
public OnPlayerSpawn(playerid)
{
      print("This print will not execute");
       return 0;
}