13.07.2016, 09:50
(
Последний раз редактировалось SamBum; 14.07.2016 в 05:37.
)
My Problem:
I update 3dtext label when player take damage, it will appear their real health, armour. But it delay the last update about their health, armour.
Example: When player have 100 health and 100 armour, and they got damage from some source (example it will take 10 damage). In fact 3d text label will appear player have 90 health. But in my script, It will appear 100 health, and if they continuous been attack again, It will appear 90 health (But in real, it's 80 health)
I have put this script onto OnPlayerUpdate, but the problem is the 3dtextlabel is spamming, more time people more lagger.
I update 3dtext label when player take damage, it will appear their real health, armour. But it delay the last update about their health, armour.
Example: When player have 100 health and 100 armour, and they got damage from some source (example it will take 10 damage). In fact 3d text label will appear player have 90 health. But in my script, It will appear 100 health, and if they continuous been attack again, It will appear 90 health (But in real, it's 80 health)
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid) { Delete3DTextLabel(masknamelabel[playerid]); new string[128]; if(PlayerInfo[playerid][pDangdeomask] == 1) { GetPlayerHealth(playerid, health); GetPlayerArmour(playerid, armour); masknamelabel[playerid] = Create3DTextLabel(" ",0x9ACD32AA,30.0,40.0,50.0,15.0,0); format(string,sizeof(string),"Nguoi la mat #%d\nMau: %d, Giap: %d", GetPlayerSQLId(playerid), floatround(health), floatround(armour)); Update3DTextLabelText(masknamelabel[playerid], 0x9ACD32AA, string); Attach3DTextLabelToPlayer(masknamelabel[playerid], playerid, 0.0, 0.0, 0.4); } return 1; }