SA-MP Forums Archive
Help me with 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help me with onplayerdeath (/showthread.php?tid=193875)

Pages: 1 2


Help me with onplayerdeath - gangster350 - 27.11.2010

public OnPlayerDeath(playerid, killerid, reason)
{
TogglePlayerControllable(playerid, 0);
pdeath[playerid] = 1;

SendClientMessage(playerid, 0xFF4646FF, "You are Died Type /acceptdeath For Accept your Avoid Death !");
SetPlayerPos(playerid,1583.4307,-1634.7228,13.3905);
ApplyAnimation(playerid,"PED","KO_skid_front",4.1, 0,0,0,1,0);
ApplyAnimation(playerid,"PED","KO_skid_front",4.1, 0,0,0,1,0);
ApplyAnimation(playerid,"PED","KO_skid_front",4.1, 0,0,0,1,0);
new Float, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
---------------------------------------------------------------------------------------------------------------------

i Got /acceptdeath System but when i am Dead

it Dont make me to my Pos example i am dead at Idlewood it teleport me at
LSPD

But, when he dies it spawns him back while doing the animation, how can I make him do the animation, while staying exactly where he died ? and then after using the command moving him to a certain point ! ?


Re: Help me with onplayerdeath - WillyP - 27.11.2010

WTF? You've done that at the wrong point.


Re: Help me with onplayerdeath - gangster350 - 27.11.2010

wtf but for me all good only the Position when he died it dont get at his Old position it teleport him at PD


Re: Help me with onplayerdeath - WillyP - 27.11.2010

I don't understand.


Re: Help me with onplayerdeath - gangster350 - 27.11.2010

But, when he dies it spawns him back while doing the animation, how can I make him do the animation, while staying exactly where he died ?


Re: Help me with onplayerdeath - WillyP - 27.11.2010

I doubt that would be possible, because the player is already dead.


Re: Help me with onplayerdeath - gangster350 - 27.11.2010

new pdeath[MAX_PLAYERS];

public OnPlayerDeath(playerid, killerid, reason)
{
TogglePlayerControllable(playerid, 0);
pdeath[playerid] = 1;

SendClientMessage(playerid, 0xFF4646FF, "You are Died Type /acceptdeath For Accept your Avoid Death !");
SetPlayerPos(playerid,1583.4307,-1634.7228,13.3905);
ApplyAnimation(playerid,"PED","KO_skid_front",4.1, 0,0,0,1,0);
ApplyAnimation(playerid,"PED","KO_skid_front",4.1, 0,0,0,1,0);
ApplyAnimation(playerid,"PED","KO_skid_front",4.1, 0,0,0,1,0);
new Float, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);

return 1;
}


if (strcmp("/acceptdeath", cmdtext, true, 10) == 0)
{
if(pdeath[playerid] == 0) return SendClientMessage(playerid, 0xFF4646FF, "You are not dead.");
GivePlayerMoney(playerid, -500);
pdeath[playerid] = 0;
TogglePlayerControllable(playerid, 1);
return 1;
}

under stand more?


Re: Help me with onplayerdeath - WillyP - 27.11.2010

The command is useless. The player is already dead, meaning even if you typed the command, he would be dead already.


Re: Help me with onplayerdeath - gangster350 - 27.11.2010

Yeah but i want they get is old Position before they typed /acceptdeath


Exemple they died at Motel
When he died but if they dont type /acceptdeath i want he Get his Old position
When he dead

if u know LSRP PR-RP

Like when they get killed He Respawn at the same Position so after they typed /acceptdeath it spawn him at the Hospital




-----Omfg Sorry for my bad english i am french---


Re: Help me with onplayerdeath - XePloiT - 27.11.2010

Victious got a point but just in case...
try to put the "SetPlayerPos(playerid,1583.4307,-1634.7228,13.3905);"
after the last ApplyAnimation


Re: Help me with onplayerdeath - WillyP - 27.11.2010

I don't code RP.

But use variables/PVars for pos saving.


Re: Help me with onplayerdeath - gangster350 - 27.11.2010

@Xeploit

yeah thanks you that after the dead but when they need to accept death i want him to get his Old Position with the anim - SORRY FOR BAD english-


Re: Help me with onplayerdeath - XePloiT - 27.11.2010

sec.. i don't getting you.... you mean...: the player dies and then he stays dead at the same position until he types
/AccepDeath... after this he respawns at the same position...
I've got it right?


Re: Help me with onplayerdeath - gangster350 - 27.11.2010

@Xeploit Yeah you right bro !


Re: Help me with onplayerdeath - gangster350 - 27.11.2010

Anything?


Re: Help me with onplayerdeath - WillyP - 27.11.2010

Maybe 'TogglePlayerControllable(0);'

This forum requires that you wait 120 seconds between posts. Please try again in 35 seconds.


Re: Help me with onplayerdeath - gangster350 - 27.11.2010

isec.. i don't getting you.... you mean...: the player dies and then he stays dead at the same position until he types
/AccepDeath... after this he respawns at the same position...
I've got it right?
-----------------------------------------------------------------------------------------------------------------
i Want that


Re: Help me with onplayerdeath - WillyP - 27.11.2010

Quote:
Originally Posted by gangster350
Посмотреть сообщение
isec.. i don't getting you.... you mean...: the player dies and then he stays dead at the same position until he types
/AccepDeath... after this he respawns at the same position...
I've got it right?
-----------------------------------------------------------------------------------------------------------------
i Want that
Yes........


Re: Help me with onplayerdeath - gangster350 - 27.11.2010

toggle player do just freeze the player -.- why that should help? i already got that


Re: Help me with onplayerdeath - WillyP - 27.11.2010

Maybe get the player's pos and set his own pos back to his death pos.