public OnPlayerUpdate(playerid) { if(UsingMask[playerid]==1) { new string[124]; new Float:armour; GetPlayerArmour(playerid, armour); new Float:health; GetPlayerHealth(playerid,health); format(string,sizeof(string), "HP:%0.f Armour:%0.f",health ,armour ); new Text3D:label = Create3DTextLabel(string, COLOR_GREY, 30.0, 40.0, 45.0, 40.0, 0); Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.1); } return 1; } |
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) { if(issuerid != INVALID_PLAYER_ID) { new string[256]; new attacker[MAX_PLAYER_NAME]; GetPlayerName(issuerid, attacker, sizeof (attacker)); format(string, sizeof(string), "-%.0f From %s", amount,attacker); SetPlayerChatBubble(playerid, string, COLOR_RED, 20.0, 3000); } return 1; } |
public OnPlayerUpdate(playerid) { if(UsingMask[playerid]==1) { new string[124]; new Float:armour; GetPlayerArmour(playerid, armour); new Float:health; GetPlayerHealth(playerid,health); format(string,sizeof(string), "HP:%.2f Armour:%.2f",health ,armour ); label = Create3DTextLabel(string, COLOR_GREY, 30.0, 40.0, 45.0, 40.0, 0); } else { Delete3DTextLabel(label); } return 1; } |
public OnPlayerUpdate(playerid) { if(UsingMask[playerid]==1) { new string[124]; new Float:armour; GetPlayerArmour(playerid, armour); new Float:health; GetPlayerHealth(playerid,health); format(string,sizeof(string), "HP:%.2f Armour:%.2f",health ,armour ); label = Create3DTextLabel(string, COLOR_GREY, 30.0, 40.0, 45.0, 40.0, 0); Update3DTextLabelText(label, COLOR_GREY, string); } else { Delete3DTextLabel(label); } return 1; } |
new Text3D:label[MAX_PLAYERS];
new isusinglabel[MAX_PLAYERS];
public OnPlayerUpdate(playerid)
{
if(UsingMask[playerid] == 1)
{
new string[124];
new Float:armour;
GetPlayerArmour(playerid, armour);
new Float:health;
GetPlayerHealth(playerid,health);
format(string,sizeof(string), "HP:%0.f\nArmour:%0.f", health, armour);
label[playerid] = Create3DTextLabel(string, COLOR_GREY, 30.0, 40.0, 45.0, 40.0, 0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.1);
isusinglabel[playerid] = 1;
}
else
{
if(isusinglabel[playerid] != 0)
{
Delete3DTextLabel(label[playerid]);
isusinglabel[playerid] = 0;
}
}
return 1;
}
public OnPlayerConnect(playerid)
{
isusinglabel[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(isusinglabel[playerid] != 0)
{
Delete3DTextLabel(label[playerid]);
isusinglabel[playerid] = 0;
}
return 1;
}