Help here a bit with my injured system
#1

I makeing a injured system but he wont fall down under 10hp

pawn Код:
}
public DoDeath(playerid)
{
    new Float:VBLife;
    GetPlayerHealth(playerid,VBLife);
    if(VBLife < 10)
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "You were brutally wounded, you can either wait for help or accept your death (/accept death)");
        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, 1);
    }
    return 1;
Reply
#2

Are you using DoDeath with a timer?
Reply
#3

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
Are you using DoDeath with a timer?
Nope.
Reply
#4

Where DoDeath is called?
Reply
#5

On OnPlayerDeath.
Reply
#6

Don't use this function after the player is already dead.

Try OnPlayerGiveDamage or OnPlayerTakeDamage
Reply
#7

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
Don't use this function after the player is already dead.

Try OnPlayerGiveDamage or OnPlayerTakeDamage
Yeah but when i use this i got tp to red county when i got under 10hp

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    new Float:VBLife;
    GetPlayerHealth(playerid,VBLife);
    if(VBLife < 10)
    Wounded[playerid] = 1;
        DoDeath(playerid);

    return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)