Death Bug
#6

pawn Код:
enum dInfo
{
    Float:dX,
    Float:dY,
    Float:dZ
}
new DeathInfo[MAX_PLAYERS][dInfo];

new Death[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    DeathInfo[playerid][dX] = X;
    DeathInfo[playerid][dY] = Y;
    DeathInfo[playerid][dZ] = Z;
    Death[playerid] = 1;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(Death[playerid] == 1)
    {
        SetPlayerPos(playerid, DeathInfo[playerid][dX], DeathInfo[playerid][dY], DeathInfo[playerid][dZ]);
        Death[playerid] = 0;
    }
    return 1;
}
What said Flori it's ok but wrong. Then if you got spawned by an Admin, or by a command, will send you to last position. So you need a variable to declare if you are dead, and he will got spawned in that place only if he die.
Reply


Messages In This Thread
Death Bug - by kevannkw - 26.12.2014, 03:29
Re: Death Bug - by Ryz - 26.12.2014, 03:32
Re: Death Bug - by GuardedMerchant - 26.12.2014, 04:46
Re: Death Bug - by VishvaJeet - 26.12.2014, 11:07
AW: Death Bug - by Flori - 26.12.2014, 11:11
Re: Death Bug - by HY - 26.12.2014, 11:47
Re: Death Bug - by Vince - 26.12.2014, 11:58

Forum Jump:


Users browsing this thread: 2 Guest(s)