pawn Код:
SetPlayerPos(playerid, DeathInfo[playerid][DeathPosX], DeathInfo[playerid][DeathPosY], DeathInfo[playerid][DeathPosZ]);
SetPlayerCameraPos(playerid, DeathInfo[playerid][DeathPosX], DeathInfo[playerid][DeathPosY], DeathInfo[playerid][DeathPosZ]+5);
SetPlayerCameraLookAt(playerid, DeathInfo[playerid][DeathPosX], DeathInfo[playerid][DeathPosY], DeathInfo[playerid][DeathPosZ]);
TogglePlayerControllable(playerid, 0);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_DIE", 4.0, 0, 0, 0, 1, 0);
ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_DIE", 4.0, 0, 0, 0, 1, 0);
ApplyAnimation(playerid,"PARACHUTE","FALL_skyDive_DIE", 4.0, 0, 0, 0, 1, 0);
SetTimerEx("AutoDeath", AUTODEATH_SECONDS * 1000, false, "i", playerid);
SendClientMessage(playerid, COLOR_TWPINK, "------------------ Health Advise -----------------");
SendClientMessage(playerid, COLOR_TWPINK, "You have been critically injured!");
SendClientMessage(playerid, COLOR_TWPINK, "You can '/request medic' or '/acceptdeath'!");
SendClientMessage(playerid, COLOR_TWPINK, "--------------------------------------------------------");
Thats the section for when a player spawns, the if statement is DeathInfo[playerid][IsDead] == 1
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(DeathInfo[playerid][IsDead] == 0)
{
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
DeathInfo[playerid][DeathPosX] = pX;
DeathInfo[playerid][DeathPosY] = pY;
DeathInfo[playerid][DeathPosZ] = pZ;
DeathInfo[playerid][IsDead] = 1;
PlayerInfo[killerid][pKills]++;
PlayerInfo[playerid][pDeaths]++;
SetPVarInt(playerid, "Hospital", ClosestHospital(playerid));
TogglePlayerSpectating(playerid, true);
SpawnPlayer(playerid);
}
else if(DeathInfo[playerid][IsDead] == 1)
{
SetTimerEx("AutoDeath", AUTODEATH_SECONDS * 1000, false, "i", playerid);
}
return 1;
}
And this is when the player dies