Is there any way to avoid OnPlayerSpawn?
#1

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?
Reply
#2

?

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;
}
Reply
#3

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)