Neproify Posted January 30, 2016 Share Posted January 30, 2016 Hello, I want to disable vehicle damage from player fists. I do this like that: addEventHandler("onClientVehicleDamage", root, function(attacker, weapon, loss, x, y, z, tyre) if weapon == 0 then cancelEvent() source:setDamageProof(true) setTimer(function(source) source:setDamageProof(false) end, 200, 1, source) end end) But it don't work. The health of vehicle is okay, but panels and doors are damaged. Can anyone help me? Link to comment
Xwad Posted January 30, 2016 Share Posted January 30, 2016 it's possible. Use these function. First get the health of the vehicle, after that fix the vehicle (everythink will be repaired, also the health of the vehicle) and after that set the old health of the vehicle. But maybe therer's also a function for that but i dont know about it. getElementHealth fixVehicle setElementHealth 1 Link to comment
1LoL1 Posted January 30, 2016 Share Posted January 30, 2016 it's possible. Use these function. First get the health of the vehicle, after that fix the vehicle (everythink will be repaired, also the health of the vehicle) and after that set the old health of the vehicle. But maybe therer's also a function for that but i dont know about it. getElementHealth fixVehicle setElementHealth You are right's. setElementHealth = only set Health car fixVehicle = repaired all Link to comment
tosfera Posted January 30, 2016 Share Posted January 30, 2016 it's possible. Use these function. First get the health of the vehicle, after that fix the vehicle (everythink will be repaired, also the health of the vehicle) and after that set the old health of the vehicle. But maybe therer's also a function for that but i dont know about it. getElementHealth fixVehicle setElementHealth You are right's. setElementHealth = only set Health car fixVehicle = repaired all Please note that if you hit a pole with a vehicle and someone hits the vehicle with a first afterwards, you're going to repair the entire vehicle. You can also just get the health from the vehicle, get all the panelstates before the player hits the vehicle ( in the same function ) and then reset them back to what they were and set the health back. This might be really tricky but can be done. 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