27.11.2010, 22:30
Just put this in OnPlayerDeath
and add this for variables
Use must have this so it can return player pos where he was dead at.
Add this in OnPayerSpawn
pawn Код:
IsDead[playerid] = 1; GetPlayerPos(playerid, deadx[playerid], deady[playerid], deadz[playerid]);
DeadInt[playerid] = GetPlayerInterior(playerid);
DeadWorld[playerid] = GetPlayerVirtualWorld(playerid);
pawn Код:
new DeadInt[MAX_PLAYERS];
new DeadWorld[MAX_PLAYERS];
new Float:deadx[MAX_PLAYERS],Float:deady[MAX_PLAYERS],Float:deadz[MAX_PLAYERS]; new IsDead[MAX_PLAYERS];
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
return 0;
}
pawn Код:
if(IsDead[playerid] == 1) {
SetPlayerPos(playerid, deadx[playerid], deady[playerid], deadz[playerid]);
SetPlayerInterior(playerid, DeadInt[playerid]);
SetPlayerVirtualWorld(playerid, DeadWorld[playerid]);
SetPlayerCameraPos(playerid, deadx[playerid], deady[playerid], deadz[playerid]+5);
SetPlayerCameraLookAt(playerid, deadx[playerid], deady[playerid], deadz[playerid]);
SendClientMessage(playerid, COLOR_LIGHTRED, "You were brutally wounded,now if a medic or anyone else doesn't save you,you will die.");
SendClientMessage(playerid, COLOR_LIGHTRED, "To accept death type /acceptdeath.");
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0);
gPlayerUsingLoopingAnim[playerid] = 1;
return 1;
}