[HELP] I need assistance with deathsystem - 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: [HELP] I need assistance with deathsystem (
/showthread.php?tid=318917)
[HELP] I need assistance with deathsystem -
David Barrnet - 17.02.2012
What happens here now is once a player died he falls onto the ground unconscious, however he stays on the ground forever. I need it that the player automatically regains control an can walk again.
Thank you in advance.
pawn Код:
if(Died[playerid] == 1)
{
SetPlayerInterior(playerid,dint[playerid]);
SetPlayerVirtualWorld(playerid,dworld[playerid]);
SetPlayerPos(playerid,dx[playerid],dy[playerid],dz[playerid]);
TogglePlayerControllable(playerid,0);
SetPlayerHealth(playerid, 1);
SetTimerEx("ApplyThatAnim",120,false,"i",playerid);
GameTextForPlayer(playerid,"You've fallen unconscious!",120,5);
SendClientMessage(playerid,COLOR_WHITE,"Once awake, please role play your injury.");
dx[playerid] = 0;
dy[playerid] = 0;
dz[playerid] = 0;
dint[playerid] = 0;
dworld[playerid] = 0;
return 1;
}
Re: [HELP] I need assistance with deathsystem -
milanosie - 17.02.2012
Where is this placed? And use [ pawn] tag to post code,
Re: [HELP] I need assistance with deathsystem -
David Barrnet - 17.02.2012
It's under
pawn Код:
public SetPlayerSpawn(playerid)
Re: [HELP] I need assistance with deathsystem -
milanosie - 17.02.2012
Place at onplayerspawn. And is dx dy dz set at onplayerdeath?
Re: [HELP] I need assistance with deathsystem -
David Barrnet - 17.02.2012
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
new interior = GetPlayerInterior(playerid);
new world = GetPlayerVirtualWorld(playerid);
dx[playerid] = x;
dy[playerid] = y;
dz[playerid] = z;
dint[playerid] = interior;
dworld[playerid] = world;
Died[playerid] = 1;
PlayerInfo[killerid][pKills] += 1;
if(WantedPoints[playerid] > 0)
{
Yup
Re: [HELP] I need assistance with deathsystem -
X-Box - 17.02.2012
I Think that's Impossible
Re: [HELP] I need assistance with deathsystem -
park4bmx - 17.02.2012
are the dx,dy,dz global ?
and theres no such thing as
SetPlayerSpawn
so it should be
OnPlayerSpawn
Re: [HELP] I need assistance with deathsystem -
David Barrnet - 17.02.2012
It is under OnPlayerSpawn. And yes