Death system help
#1

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;
}
Reply
#2

DoDeath is called by timer?
Reply
#3

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

Mabye anyone can help me out?
Reply
#5

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;
}
Reply
#6

Thank i will test this.
Reply
#7

I get this

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

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

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)