Quote:
Originally Posted by Jimmmy
Tenta desse jeito
pawn Код:
public OnPlayerUpdate(playerid) { if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid == PLAYER_STATE_DRIVER)) { new Carro = GetPlayerVehicleID(playerid); new Float:vHealth; GetVehicleHealth(Carro, vHealth);
new Bar[80]; if(vHealth > 250){ format(Bar, sizeof(Bar), "_"); } if(vHealth > 250 && vHealth < 500){ format(Bar, sizeof(Bar), "__"); } if(vHealth > 500 && vHealth < 700){ format(Bar, sizeof(Bar), "___"); } if(vHealth > 700 && vHealth < 850){ format(Bar, sizeof(Bar), "_____"); } if(vHealth > 850){ format(Bar, sizeof(Bar), "______"); } vehicle3Dtext[ Carro ] = Create3DTextLabel( Bar, 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 ); Attach3DTextLabelToVehicle( vehicle3Dtext[ Carro ] , Carro, 0.0, 0.0, 2.0); } } return 1; }
public OnPlayerStateChange(playerid, newstate, oldstate) { if(oldstate == PLAYER_STATE_DRIVER) { Delete3DTextLabel( vehicle3Dtext[ vehicle_id ] ); } return 1; }
|
Fiz assim, mais a barra nгo se atualiza com os danos, sempre fica a mesma coisa e quando sai do carro a barra fica :\