SA-MP Forums Archive
OnPlayerDeath - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerDeath (/showthread.php?tid=427201)



OnPlayerDeath - viddo - 31.03.2013

Alright I've got a question, I added this line on OnPlayerDeath: JustDied[playerid] = 1; It should do the following under SetPlayerSpawn but when the player dies he gets teleported to the last location he logged out at, I want the "JustDied" function to happen at the same location the player died at.


Code:
pawn Код:
if(JustDied[playerid] == 1)
            {
                if(GetPlayerVirtualWorld(playerid) != 0 || PlayerInfo[playerid][pVirWorld] != 0)
                {
                    SetPlayerVirtualWorld(playerid, 0);
                    PlayerInfo[playerid][pVirWorld] = 0;
                }
                PlayerInfo[playerid][pMuted] == 1;
                PlayerPlaySound(playerid, 6003, 1589.053344,-1638.123168,14.122960);
                SetTimerEx("Dedshit",1000,0,"i",playerid);
                SendClientMessage(playerid, COLOR_RED, " You are injured, You have 5 minutes before you respawn !");
                SetTimerEx("Dedspawn",60000,0,"i",playerid);
                return 1;
            }



Re: OnPlayerDeath - por12802 - 01.04.2013

Check ur script at positon save command on the setplayerspawn or anywhere

Then u have to edit it