Mistake in OnPlayerDeath
#1

Hello.
I'm trying to spawn at the hospital when i die but it doesn't work.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    IsDead[playerid] = 1;
    if(IsDead[playerid] == 1)
    {
        IsDead[playerid] = 0;
        SetPlayerPos(playerid, 1183.31, -1325.01, 13.58);
        SetPlayerFacingAngle(playerid, -90);
        SetPlayerSkin(playerid,X[playerid][XVar]);
        ResetPlayerWeapons(playerid);
        return 1;
    }
    return 1;
}
I also tried this ->
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsDead[playerid] == 1)
    {
        IsDead[playerid] = 0;
        SetPlayerPos(playerid, 1183.31, -1325.01, 13.58);
        SetPlayerFacingAngle(playerid, -90);
        SetPlayerSkin(playerid,X[playerid][XVar]);
        ResetPlayerWeapons(playerid);
        return 1;
    }
    return 1;
}

public OnPlayerDeath(playerid,killerid,reason)
{
   IsDead[playerid] = 1;
   return 1;
}
none of them works because i spawn at Blueberry falling.
Reply
#2

Try to create a customized Callback like "SetPlayerToSpawn" and call her in OnPlayerSpawn.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)