Help Please Health change
#10

Quote:
Originally Posted by Tree of Fat
pawn Код:
new Float:PlayerHP[MAX_PLAYERS];
forward OnPlayerHealthReduced(playerid, Float:hp);

public OnPlayerConnect(playerid)
{
    PlayerHP = 100.0;
    return 1;
}

public OnPlayerUpdate(playerid)
{
    new Float:hp;
    GetPlayerHealth(playerid, hp);
    if (PlayerHP[playerid] > hp)
    {
        OnPlayerHealthChange(playerid, oldhealth, newhealth);
    }
    PlayerHP[playerid] = hp;
    return 1;
}

public OnPlayerHealthReduced(playerid, Float:hp)
{
    // And with this, you can detect if a player's health has changed.
    return 1;
}
Now shut the hell up.
correction: PlayerHP[playerid] = 100.0;

"Now shut the hell up." mlol
Reply


Messages In This Thread
Help Please Health change - by Cem - 19.11.2009, 00:25
Re: Help Please Health change - by BP13 - 19.11.2009, 00:55
Re: Help Please Health change - by Cem - 19.11.2009, 00:58
Re: Help Please Health change - by Cem - 19.11.2009, 20:06
Re: Help Please Health change - by dice7 - 19.11.2009, 20:09
Re: Help Please Health change - by Cem - 19.11.2009, 22:20
Re: Help Please Health change - by Cem - 20.11.2009, 22:50
Re: Help Please Health change - by oncedead - 20.11.2009, 22:58
Re: Help Please Health change - by MenaceX^ - 20.11.2009, 23:04
Re: Help Please Health change - by ExoSanty - 21.11.2009, 04:59

Forum Jump:


Users browsing this thread: 1 Guest(s)