overlocus Posted August 17, 2018 Share Posted August 17, 2018 Hi guys. I have a desire. Do not damage the car while nobody is driving it. pls help me Link to comment
SycroX Posted August 17, 2018 Share Posted August 17, 2018 addEventHandler "onPlayerVehicleExit" setVehicleDamageProof Link to comment
overlocus Posted August 17, 2018 Author Share Posted August 17, 2018 i have rp server and vehicles respawning regularly so is this code also suitable for this? also i cant work this code is this server side or client side ? and can you give this code all in all Link to comment
overlocus Posted August 17, 2018 Author Share Posted August 17, 2018 anybody can help ? Link to comment
Dimos7 Posted August 17, 2018 Share Posted August 17, 2018 https://wiki.multitheftauto.com/wiki/IsVehicleEmpty Link to comment
Mr.Loki Posted August 17, 2018 Share Posted August 17, 2018 (edited) When you spawn the vehicle -> setVehicleDamageProof true onVehicleEnter -> setVehicleDamageProof false onVehicleExit -> setVehicleDamageProof true Edited August 17, 2018 by Mr.Loki Link to comment
Keiichi1 Posted August 17, 2018 Share Posted August 17, 2018 Server for k, v in ipairs(getElementsByType("vehicle")) do setVehicleDamageProof(v, true) end addEventHandler("onVehicleExit", getRootElement(), function() setVehicleDamageProof(source, true) end) addEventHandler("onVehicleEnter", getRootElement(), function() setVehicleDamageProof(source, false) end) Link to comment
overlocus Posted August 17, 2018 Author Share Posted August 17, 2018 (edited) Thanks everybody but i have one more problem. The code failed when vehicle reversing so and the game started to fade. how can i solve this problem? How can I make sure no one can move while the vehicles are idle? Also, the car does not explode during the explosion and is standing still Edited August 17, 2018 by overlocus Link to comment
Mσнαмα∂ Hєℓιѕн Posted August 17, 2018 Share Posted August 17, 2018 3 hours ago, overlocus said: i have rp server and vehicles respawning regularly so is this code also suitable for this? also i cant work this code is this server side or client side ? and can you give this code all in all che khabar _Ary4n_ 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