SA-MP Forums Archive
Death system help - 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: Death system help (/showthread.php?tid=335971)



Death system help - N0FeaR - 20.04.2012

I want so you fall down when you got under 10hp, if someone is willing to help me, thanks in advance

here is my code

pawn Код:
public DoDeath(playerid)
{
    SendClientMessage(playerid, COLOR_LIGHTRED, "You were brutally wounded, you can either wait for help or accept your death (/acceptdeath)");
    Wounded[playerid] = 1;
    TogglePlayerControllable(playerid, 0);
    SetPlayerPos(playerid, DeathDest[playerid][0],DeathDest[playerid][1],DeathDest[playerid][2]);
    SetPlayerVirtualWorld(playerid,DeathWorld[playerid]);
    SetPlayerInterior(playerid,GetPlayerInterior(playerid));
    ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
    SetPlayerHealth(playerid, 10);
    return 1;
}



Re: Death system help - ViniBorn - 20.04.2012

DoDeath is called by timer?


Re: Death system help - N0FeaR - 20.04.2012

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
DoDeath is called by timer?
Nope.


Re: Death system help - N0FeaR - 20.04.2012

Mabye anyone can help me out?


Re: Death system help - ViniBorn - 20.04.2012

From what I understand, this is
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    new Float:VBLife;
    GetPlayerHealth(playerid,VBLife);
    if(VBLife < 10)
        DoDeath(playerid);

    return true;
}



Re: Death system help - N0FeaR - 20.04.2012

Thank i will test this.


Re: Death system help - N0FeaR - 20.04.2012

I get this

Код:
C:\Users\Robins\Desktop\New folder\pawno\include\/CRP/Publics/OnPlayerTakeDamage.pwn(1) : error 025: function heading differs from prototype



Re: Death system help - ViniBorn - 20.04.2012

Sorry. The correct is :
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)



Re: Death system help - N0FeaR - 21.04.2012

I got one more problem now, is spamming You were brutally wounded, you can either wait for help or accept your death (/accept death) and i got tp to red county when i got 10 under hp you know how to fix?