SA-MP Forums Archive
Afterlife bug. - 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: Afterlife bug. (/showthread.php?tid=374966)



Afterlife bug. - DeeCaay - 04.09.2012

Spawn at farm after death?

Код:
    if (IsDead[playerid] == 1) {
        SetPlayerPos(playerid,DeathPosX[playerid],DeathPosY[playerid],DeathPosZ[playerid]);
        TogglePlayerControllable(playerid,0);
        SetPlayerCameraPos(playerid, -833.5241,-1358.8575,86.9054);
        SetPlayerCameraLookAt(playerid, -830.8118,-1360.3612,87.0289);
        SendClientMessage(playerid,COLOR_WHITE,"INFO: Type /acceptdeath to leave this position.");
        ApplyAnimationEx(playerid, "PARACHUTE", "FALL_skyDive_DIE", 4.0, 0, 1, 1, 1, -1);
        SetPVarInt(playerid, "Suitcase",0);
        return 1;
    }
Problem: When you're dying you suppose to spawn where you died but now it's spawning at the Red County farm.

Код:
new Float:DeathPosX[MAX_PLAYERS];
new Float:DeathPosY[MAX_PLAYERS];
new Float:DeathPosZ[MAX_PLAYERS];
new IsDead[MAX_PLAYERS];
Top of my script.
OnPlayerDeath =
Код:
IsDead[playerid] = 1;



Re: Afterlife bug. - Emmet_ - 04.09.2012

Put this under OnPlayerDeath:

pawn Код:
new Float:fPosX, Float:fPosY, Float:fPosZ;
GetPlayerPos(playerid, fPosX, fPosY, fPosZ);
DeathPosX[playerid] = fPosX;
DeathPosY[playerid] = fPosY;
DeathPosZ[playerid] = fPosZ;



Re : Re: Afterlife bug. - DeeCaay - 04.09.2012

Quote:
Originally Posted by Emmet_
Посмотреть сообщение
Put this under OnPlayerDeath:

pawn Код:
new Float:fPosX, Float:fPosY, Float:fPosZ;
GetPlayerPos(playerid, fPosX, fPosY, fPosZ);
DeathPosX[playerid] = fPosX;
DeathPosY[playerid] = fPosY;
DeathPosZ[playerid] = fPosZ;
Thank you worked.