Lally Posted October 30, 2016 Share Posted October 30, 2016 Hello guys. I myself need a resource for the car. When the car has to say that 30% hp car to stop and not start until it is repaired. Thank you all. Link to comment
Walid Posted October 31, 2016 Share Posted October 31, 2016 onVehicleDamage : This event is triggered when a vehicle is damaged. OR just use a timer local mathCeil = math.ceil function checkVehicleDamage() local vehicles = getElementsByType("vehicle") for i=1, #vehicles do local vehiclehealth = mathCeil(getElementHealth (vehicles[i])) if tonumber(vehiclehealth) < 255.5 then setVehicleEngineState (vehicles[i], false ) setVehicleDamageProof(vehicles[i], true) setElementHealth(vehicles[i],255) end end end setTimer(checkVehicleDamage, 100, 0) Link to comment
Malak Posted October 31, 2016 Share Posted October 31, 2016 better to use event onclientvehicledamage Link to comment
Lally Posted November 2, 2016 Author Share Posted November 2, 2016 (edited) Thanks Walid. But now it's another matter if the minigun shooting say in the car and exploding begin to spawn infinite pieces of the car and make it lag. If you can help me out here a pictures of evidence. Photo And if you ask my doing something like a text when you enter the car and start the car as you try to give a text as the engine is broken. Edited November 2, 2016 by Lally Link to comment
Walid Posted November 4, 2016 Share Posted November 4, 2016 5 minutes ago, Lally said: Can you help me Don't use onVehicleDamage, just use my code with a timer ^^ function destroyVehicleOnExplode() destroyElement (source) end addEventHandler("onVehicleExplode", root, destroyVehicleOnExplode) Link to comment
Lally Posted November 4, 2016 Author Share Posted November 4, 2016 Is very good! But now the problem is that I bind the j to start the car and gender has no effect if it is broken or not. And if you mess and fix it no longer hurt. Link to comment
Lally Posted November 6, 2016 Author Share Posted November 6, 2016 (edited) @Walid Can you help me? You're only helping me Edited November 6, 2016 by Lally Link to comment
Walid Posted November 6, 2016 Share Posted November 6, 2016 On 04/11/2016 at 5:25 PM, Lally said: Is very good! But now the problem is that I bind the j to start the car and gender has no effect if it is broken or not. And if you mess and fix it no longer hurt. 3 minutes ago, Lally said: @Walid Can you help me? You're only helping me Try to do it by yourself then post your code here. Link to comment
Lally Posted November 6, 2016 Author Share Posted November 6, 2016 The thing is not under quite as experienced and skilled. Anyway I thank you very much for everything. You can close this topic because this topic is apparently finished. 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