format(str, sizeof(str), "%.0i%", Player[playerid][pFome]);
PlayerTextDrawSetString(playerid, PLAYER_HUD[playerid][9], str);
if(Player[playerid][pFome] <= 77) {
PlayerTextDrawColor(playerid,PLAYER_HUD[playerid][9], COR_VERMELHO);
PlayerTextDrawShow(playerid, PLAYER_HUD[playerid][9]);
}
PlayerTextDrawHide(playerid, PLAYER_HUD[playerid][9]);
PlayerTextDrawShow(playerid, PLAYER_HUD[playerid][9]);
Tem que esconder o textdraw e depois mostrб-lo para atualizar.
PHP код:
|
new Float:health2;
GetPlayerHealth(playerid, health2);
if(health2 >= 50) {
PlayerTextDrawColor(playerid,PLAYER_HUD[playerid][5], 0x03FF35FF); //VERDE
}
if(health2 < 40) {
PlayerTextDrawColor(playerid,PLAYER_HUD[playerid][5], 0xFF7403FF); //AMARELO
}
if(health2 < 15) {
PlayerTextDrawColor(playerid,PLAYER_HUD[playerid][5], COR_VERMELHO); //VERMELHO
}
PlayerTextDrawHide(playerid, PLAYER_HUD[playerid][5]);//HEALTH
PlayerTextDrawShow(playerid, PLAYER_HUD[playerid][5]);//HEALTH