22.02.2011, 18:42
It's somewhat of some scripting to do but basically you would do:
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
SetPVarFloat(playerid, "Dead_PosX", X);
SetPVarFloat(playerid, "Dead_PosY", Y);
SetPVarFloat(playerid, "Dead_PosZ", Z);
SetPVarInt(playerid, "Dead_Int", GetPlayerInterior(playerid));
SetPVarInt(playerid, "Dead_World", GetPlayerVirtualWorld(playerid));
SetPVarInt(playerid, "Dead", 1);
}
public OnPlayerSpawn(playerid)
{
if(GetPVarInt(playerid, "Dead") == 1)
{
SetPlayerPos(playerid,GetPVarFloat(playerid, "Dead_PosX"),GetPVarFloat(playerid, "Dead_PosY"),GetPVarFloat(playerid, "Dead_PosZ"));
SetPlayerInterior(playerid,GetPVarInt(playerid, "Dead_Int"));
SetPlayerVirtualWorld(playerid,GetPVarInt(playerid, "Dead_World"));
DeletePVar(playerid,"Dead_PosX");
DeletePVar(playerid,"Dead_PosY");
DeletePVar(playerid,"Dead_PosZ");
DeletePVar(playerid,"Dead_Int");
DeletePVar(playerid,"Dead_World");
TogglePlayerControllable(playerid,false);
SetCameraBehindPlayer(playerid);
SetPlayerHealth(playerid,1.0);
ApplyAnimation(playerid, "PARACHUTE", "FALL_skyDive_DIE", 4.0, 0, 1, 1, 1, -1);
// Message saying you need to type /accept death or w/e you want.
}
}
// Accept death command //
// Do really whatever you want possibly SpawnPlayer(playerid);
SpawnPlayer(playerid);
SetPlayerHealth(playerid,50.0);
DeletePVar(playerid,"Dead");