29.03.2013, 00:14
So i've this code to show a textlabel with the hp/armour of the player, the problem is: it keeps saying: Hp 0 / Armour 0, why?
I placed it on OnPlayerSpawn.
pawn Код:
new Float:hp, Float:am;
GetPlayerHealth(playerid,hp);
GetPlayerArmour(playerid,am);
new stringk[128];
format(stringk,sizeof(stringk),"{FFFFFF}Hp: {F70505}%0.2f {FFFFFF}- Armour: {F70505}%0.2f",hp,am);
new Text3D:PlayerLabel = Create3DTextLabel(stringk, -1, 0.0, 0.0, 40.0, 20.0, 0, 1);
Attach3DTextLabelToPlayer(PlayerLabel, i, 0.0, 0.0, 0.47);