Help me with onplayerdeath
#32

Just put this in OnPlayerDeath
pawn Код:
IsDead[playerid] = 1; GetPlayerPos(playerid, deadx[playerid], deady[playerid], deadz[playerid]);
    DeadInt[playerid] = GetPlayerInterior(playerid);
    DeadWorld[playerid] = GetPlayerVirtualWorld(playerid);
and add this for variables
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];
Use must have this so it can return player pos where he was dead at.
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
   
    return 0;
}
Add this in OnPayerSpawn
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;
        }
Reply


Messages In This Thread
Help me with onplayerdeath - by gangster350 - 27.11.2010, 20:22
Re: Help me with onplayerdeath - by WillyP - 27.11.2010, 20:24
Re: Help me with onplayerdeath - by gangster350 - 27.11.2010, 20:25
Re: Help me with onplayerdeath - by WillyP - 27.11.2010, 20:29
Re: Help me with onplayerdeath - by gangster350 - 27.11.2010, 20:30
Re: Help me with onplayerdeath - by WillyP - 27.11.2010, 20:31
Re: Help me with onplayerdeath - by gangster350 - 27.11.2010, 20:34
Re: Help me with onplayerdeath - by WillyP - 27.11.2010, 20:36
Re: Help me with onplayerdeath - by gangster350 - 27.11.2010, 20:40
Re: Help me with onplayerdeath - by XePloiT - 27.11.2010, 20:41
Re: Help me with onplayerdeath - by WillyP - 27.11.2010, 20:41
Re: Help me with onplayerdeath - by gangster350 - 27.11.2010, 20:42
Re: Help me with onplayerdeath - by XePloiT - 27.11.2010, 20:46
Re: Help me with onplayerdeath - by gangster350 - 27.11.2010, 20:47
Re: Help me with onplayerdeath - by gangster350 - 27.11.2010, 20:55
Re: Help me with onplayerdeath - by WillyP - 27.11.2010, 20:57
Re: Help me with onplayerdeath - by gangster350 - 27.11.2010, 20:58
Re: Help me with onplayerdeath - by WillyP - 27.11.2010, 20:59
Re: Help me with onplayerdeath - by gangster350 - 27.11.2010, 21:00
Re: Help me with onplayerdeath - by WillyP - 27.11.2010, 21:02
Re: Help me with onplayerdeath - by gangster350 - 27.11.2010, 21:03
Re: Help me with onplayerdeath - by WillyP - 27.11.2010, 21:05
Re: Help me with onplayerdeath - by gangster350 - 27.11.2010, 21:06
Re: Help me with onplayerdeath - by WillyP - 27.11.2010, 21:07
Re: Help me with onplayerdeath - by Auxxx - 27.11.2010, 21:09
Re: Help me with onplayerdeath - by gangster350 - 27.11.2010, 21:09
Re: Help me with onplayerdeath - by WillyP - 27.11.2010, 21:11
Re: Help me with onplayerdeath - by gangster350 - 27.11.2010, 21:11
Re: Help me with onplayerdeath - by Auxxx - 27.11.2010, 21:35
Re: Help me with onplayerdeath - by gangster350 - 27.11.2010, 21:50
Re: Help me with onplayerdeath - by XePloiT - 27.11.2010, 22:09
Re: Help me with onplayerdeath - by Lilcuete - 27.11.2010, 22:30
Re: Help me with onplayerdeath - by Auxxx - 28.11.2010, 10:09
Re: Help me with onplayerdeath - by gangster350 - 28.11.2010, 14:38

Forum Jump:


Users browsing this thread: 9 Guest(s)