GetPlayerInterior returns 0 OnPlayerDeath?
#1

I have a death revival system for my roleplay server, which works perfectly. Until the person dies inside of an interior. It resets their interior to 0 rather than the actual interior ID.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new
        Float:  myPos [ 4 ],
        int,
        vw;
       
    GetPlayerPos( playerid, myPos [ 0 ], myPos [ 1 ], myPos [ 2 ] );
    GetPlayerFacingAngle( playerid, myPos [ 3 ] );
    int = GetPlayerInterior( playerid );
    vw = GetPlayerVirtualWorld( playerid );
   
    plJustDied [ playerid ] = true;
    plDeathPosition [ playerid ] [ 0 ] = myPos [ 0 ], plDeathPosition [ playerid ] [ 1 ] = myPos [ 1 ],
    plDeathPosition [ playerid ] [ 2 ] = myPos [ 2 ], plDeathPosition [ playerid ] [ 3 ] = myPos [ 3 ];
    plDeathInterior [ playerid ] = int;
    plDeathVirtualWorld [ playerid ] = vw;
    return true;
}
Reply
#2

Try this?
pawn Код:
//at the top
int[MAX_PLAYERS];
//OnPlayerDeath
int[playerid] = GetPlayerInterior(playerid);
//Anywhere (maybe OnPlayerSpawn?)
SetPlayerInterior(playerid,int[playerid]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)