Interior & VW is fucked up.
#4

It should be something as this:
pawn Код:
new
    gLastVW                 [MAX_PLAYERS],
    gLastInt                [MAX_PLAYERS],
    Float:gLastPos          [MAX_PLAYERS][3],
    bool:gDead              [MAX_PLAYERS]
;

public OnPlayerDeath(playerid) {
    if (!gDead[playerid]) {
        gDead[playerid] = true;
        gLastInt[playerid] = GetPlayerInterior(playerid);
        gLastVW[playerid] = GetPlayerVirtualWorld(playerid);
        GetPlayerPos(playerid, gLastPos[playerid][0], gLastPos[playerid][1], gLastPos[playerid][2]);
    }
    return 1;
}
public OnPlayerSpawn(playerid) {
    if (gDead[playerid]) {
   
        SetPlayerInterior(playerid, gLastInt[playerid]);
        SetPlayerVirtualWorld(playerid, gLastVW[playerid]);
        SetPlayerPos(playerid, gLastPos[playerid][0], gLastPos[playerid][1], gLastPos[playerid][2]);

        /* Animations, etc. there */
       
        SendClientMessage(playerid, -1, "Use /acceptdeath to rest in peace.");
    } else {
        /* He accepted the death, send him to the hospital or somewhere. */
    }
    return 1;
}

COMMAND:acceptdeath(playerid, params[]) {
    if (!gDead[playerid])
        return SendClientMessage(playerid, -1, "You're not dead my man!!!");
   
    gDead[playerid] = false;
    SetPlayerHealth(playerid, 0.0);
    SendClientMessage(playerid, "You just accepted the death.");
    return 1;
}

/* NOTE: if paramedics manage to save him, just set gDead to false */
Reply


Messages In This Thread
Interior & VW is fucked up. - by lQs - 12.05.2013, 12:54
Re: Interior & VW is fucked up. - by [DOG]irinel1996 - 12.05.2013, 13:12
Re: Interior & VW is fucked up. - by lQs - 12.05.2013, 13:14
Re: Interior & VW is fucked up. - by [DOG]irinel1996 - 12.05.2013, 13:28

Forum Jump:


Users browsing this thread: 1 Guest(s)