04.10.2013, 00:04
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;
}