Zdravim, rád bych chtěl poprosit o pomoct s Hp labelem.
new Text3D:hpLabel[MAX_PLAYERS];
new Float:hp,strHp[20];
GetPlayerHealth(playerid,hp);
format(strHp,sizeof(strHp),"HP: %.2f",hp);
hpLabel[playerid] = Create3DTextLabel(strHp,0xFF0000FF,0.0,0.0,0.0,40,0,0); //vytvoří label
Attach3DTextLabelToPlayer(hpLabel[playerid],playerid,0.0,0.0,0.6); //připojí k hráči label
public OnPlayerTakeDamage(playerid,issuerid,Float:amount,weaponid)
{
new Float:hp,strHp[20];
GetPlayerHealth(playerid,hp);
format(strHp,sizeof(strHp),"HP: %.2f",hp);
Update3DTextLabelText(hpLabel[playerid],0xFF0000FF,strHp); //aktualizuje label
return 1;
}
public OnPlayerDisconnect(playerid)
{
Delete3DTextLabel(hpLabel[playerid]); //smaže label
return 1;
}
Jelikož je Update v OnPlayerTakeDemage a aktualizuje se to strašně pomalu (Po dalším hitu) tak bych chtěl udělat nějaký timer, ale nevím jak mám tuhle funkci "napojit" na ten timer..
Dotaz
Pajda 0
Zdravim, rád bych chtěl poprosit o pomoct s Hp labelem.
Jelikož je Update v OnPlayerTakeDemage a aktualizuje se to strašně pomalu (Po dalším hitu) tak bych chtěl udělat nějaký timer, ale nevím jak mám tuhle funkci "napojit" na ten timer..
Nějak takhle by to mělo vypadat, nebo se mýlím?
Link to comment
Share on other sites
4 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now