[Include] [N]Death Sequence - GTA 5 Style Death sequence!
#3

It's a good idea but you should really hook OnPlayerDisconnect() and do your clean up work automatically.

A definite problem area is in this function.

Код:
stock DeathSequenceInitial(playerid)
{
    DeathSeq[playerid][isdead] = true;
    DeathSeq[playerid][skinid] = GetPlayerSkin(playerid);
    GetPlayerPos(playerid, DeathSeq[playerid][deadpos][0], DeathSeq[playerid][deadpos][1], DeathSeq[playerid][deadpos][2]);
    GetPlayerFacingAngle(playerid, DeathSeq[playerid][deadpos][3]);

// Potential problem here - How do you know this function is not called again before the player actually spawns? 
// Don't use this function without actually spawning the player immediately afterwards as a rule of thumb
// Especially in an include
    SetSpawnInfo(playerid, NO_TEAM, DeathSeq[playerid][skinid], DeathSeq[playerid][deadpos][0], DeathSeq[playerid][deadpos][1], DeathSeq[playerid][deadpos][2], DeathSeq[playerid][deadpos][3], 0, 0, 0, 0, 0, 0 );

    TogglePlayerSpectating(playerid, true);
    TogglePlayerSpectating(playerid, false);

    // Might cause problems with AC's / Auto health reset etc
    SetPlayerHealth(playerid, 9999);
    return 1;
}
Reply


Messages In This Thread
[N]Death Sequence - GTA 5 Style Death sequence! - by Nickk888 - 27.04.2018, 20:47
Re: [N]Death Sequence - GTA 5 Style Death sequence! - by Dancsika - 17.05.2018, 13:53
Re: [N]Death Sequence - GTA 5 Style Death sequence! - by Pottus - 17.05.2018, 17:16
Re: [N]Death Sequence - GTA 5 Style Death sequence! - by dani18 - 17.05.2018, 19:49
Re: [N]Death Sequence - GTA 5 Style Death sequence! - by RogueDrifter - 18.05.2018, 08:48

Forum Jump:


Users browsing this thread: 2 Guest(s)