SA-MP Forums Archive
[Ajuda] Lataria - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Lataria (/showthread.php?tid=631673)



Lataria - LLNub - 02.04.2017

Como posso fazer que quando a lataria chegar em 40% a textdraw fique vermelha?

PHP код:
        new DamageString[50], Float:Health;
        
GetVehicleHealth(GetPlayerVehicleID(playerid),Health);
        
format(DamageString50"~g~%d%% L"floatround(Health)/10);
        
PlayerTextDrawSetString(playeridVelo[6], DamageString);
        
PlayerTextDrawShow(playerid,Velo[6]); 



Re: Lataria - valdirdd - 02.04.2017

PHP код:
        new DamageString[50], Float:Health;         
        
GetVehicleHealth(GetPlayerVehicleID(playerid),Health); 
        new 
Lataria =  floatround(Health)/10;
        
format(DamageString50, (Lataria<=40)?("~r~%d%% L"):("~g~%d%% L"), Lataria); 
        
PlayerTextDrawSetString(playeridVelo[6], DamageString);         
        
PlayerTextDrawShow(playerid,Velo[6]); 



Re: Lataria - LLNub - 02.04.2017

Quote:
Originally Posted by valdirdd
Посмотреть сообщение
PHP код:
        new DamageString[50], Float:Health;         
        
GetVehicleHealth(GetPlayerVehicleID(playerid),Health); 
        new 
Lataria =  floatround(Health)/10;
        
format(DamageString50, (Lataria<=40)?("~r~%d%% L"):("~g~%d%% L"), Lataria); 
        
PlayerTextDrawSetString(playeridVelo[6], DamageString);         
        
PlayerTextDrawShow(playerid,Velo[6]); 
Obrigadooo haha