[Question] Removing Player Name Tags
#2

You can't hide or show the health or armor with any functions, but you can always do it this way:

pawn Код:
new Text3D:gHealthArmor[MAX_PLAYERS];
new Float:gFloatVars[MAX_PLAYERS][2];

public OnPlayerConnect(playerid)
{
    gHealthArmor[playerid] = Create3DTextLabel("{FFFF00}Armor:{FFFFFF} 0.0\n{FF0000}Health:{FFFFFF} 100.0", -1, 0.0, 0.0, 0.0, 20.0, 0);
    Attach3DTextLabelToPlayer(gHealthArmor[playerid], playerid, 0.0, 0.0, 0.54);
   
    gFloatVars[playerid][0] = 100.0; // Health
    gFloatVars[playerid][1] = 0.0; // Armor
    return 1;
}

public OnPlayerUpdate(playerid)
{
    new
        string[64],
        Float:health,
        Float:armor;

    GetPlayerHealth(playerid, health);
    GetPlayerArmour(playerid, armor);
   
    if (floatcmp(health, gFloatVars[playerid][0]) != 0 || floatcmp(armor, gFloatVars[playerid][1]) != 0)
    {
        format(string, sizeof(string), "{FFFF00}Armor:{FFFFFF} %.1f\n{FF0000}Health:{FFFFFF} %.1f", gFloatVars[playerid][0], gFloatVars[playerid][1]);
        Update3DTextLabelText(gHealthArmor[playerid], -1, string);
    }
    return 1;
}
Reply


Messages In This Thread
[Question] Removing Player Name Tags - by ***Niko*** - 03.10.2013, 23:57
Re: [Question] Removing Player Name Tags - by Emmet_ - 04.10.2013, 00:04
Re: [Question] Removing Player Name Tags - by ***Niko*** - 04.10.2013, 01:14
Re: [Question] Removing Player Name Tags - by xXSPRITEXx - 04.10.2013, 01:24
Re: [Question] Removing Player Name Tags - by EiresJason - 04.10.2013, 01:25
Re: [Question] Removing Player Name Tags - by ***Niko*** - 04.10.2013, 01:42
Re: [Question] Removing Player Name Tags - by EiresJason - 04.10.2013, 01:52
Re: [Question] Removing Player Name Tags - by ***Niko*** - 04.10.2013, 02:03
Re: [Question] Removing Player Name Tags - by EiresJason - 04.10.2013, 02:05
Re: [Question] Removing Player Name Tags - by ***Niko*** - 04.10.2013, 02:25

Forum Jump:


Users browsing this thread: 1 Guest(s)