Guest Posted October 21, 2012 Share Posted October 21, 2012 Hi! I have a problem with my script stations and vehicle condition. Vehicle starts to burn when the condition of the vehicle is 32%, and the bar is not yet finished. How do I fix this? Link: http://fotoo.pl/show.php?img=392776_fuel.png.html Link to the script: http://www.sendspace.pl/file/49aa25b2cc385f16661d98f Link to comment
denny199 Posted October 21, 2012 Share Posted October 21, 2012 I think you've got some wrong calculations carHealth = getElementHealth(vehicle)/10; must be carHealth = getElementHealth(vehicle)/10 - 10 Will return when burning 0.7867876..blabla but the bar isn't synced then. Just lol arround with it. Link to comment
Guest Posted October 22, 2012 Share Posted October 22, 2012 Ehh, now if i create new car, vehicle condition is 90%. Now it burning <14-13%. I would like to at the entrance to the newly created vehicle, vehicle status was equal to 100%, and that the vehicle was on fire when the state was equal to 0%. Link to comment
Guest Posted October 23, 2012 Share Posted October 23, 2012 I'm quite perplexing problem. Now, once subtracted from HealthHeight 1.36, and I would like to subtract all the time. http://pastebin.com/Y8teD8dL Link to comment
SDK Posted October 24, 2012 Share Posted October 24, 2012 Car health ranges from a little above 1000 to 250, between 250 and 0 the car is burning. To ignore the under 250 part you can use math.max(). So to get it in a percentage: carHealth = ( math.max(getElementHealth(vehicle) - 250, 0) ) / 7.5 Slap some rounding function on that and you should be good to go. Link to comment
Guest Posted October 24, 2012 Share Posted October 24, 2012 It is also not good. The initial value is 100%, but I want to 160% and the vehicle began to burn at 0%. Link to comment
Aibo Posted October 24, 2012 Share Posted October 24, 2012 It is also not good. The initial value is 100%, but I want to 160% and the vehicle began to burn at 0%. carHealth = ( math.max(getElementHealth(vehicle) - 250, 0) ) / 7.5 * 1.6 Link to comment
Guest Posted October 24, 2012 Share Posted October 24, 2012 It's almost a good, but not totality. When the condition of the vehicle is 13%, the bar is no longer visible. dxDrawRectangle(x-30,(y/2)+44,16,21,colour); local HealthHeight = ((136/100)*carHealth); local stan = ( math.max(getElementHealth(vehicle) - 360, 1) ) / 7.5 * 1.6 local yOffset = stan-136 dxDrawRectangle(x-50,(y/2)-71-yOffset,16,stan,0x99990000); dxDrawText(tostring(HealthHeight-36)..'%',x-105,y-65); dxDrawText(tostring(fuel)..'%',x-105,y-50); Link to comment
Aibo Posted October 24, 2012 Share Posted October 24, 2012 what does 136 mean? what is carHealth? Link to comment
Guest Posted October 24, 2012 Share Posted October 24, 2012 I can not explain this too you because i do not know the fine with English, and even then I use google translator. In addition, it is not my code. Just when the state of the vehicle is equal to 13%, you can not see the belt. Link to comment
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