botshara Posted July 23, 2016 Posted July 23, 2016 It is possible make that with hand cant damage car visually ? i know can make that cant damage car phisically ...
Captain Cody Posted July 23, 2016 Posted July 23, 2016 function fixVehiclea() fixVehicle(source) end addEventHandler("onVehicleDamage", getRootElement(), fixVehiclea)
botshara Posted July 24, 2016 Author Posted July 24, 2016 function fixVehiclea() fixVehicle(source) end addEventHandler("onVehicleDamage", getRootElement(), fixVehiclea) not good soloution if vehicle is damaged its fix it fully
EstrategiaGTA Posted July 24, 2016 Posted July 24, 2016 Please, explain what you want in a better way. I didn't really understand.
aka Blue Posted July 24, 2016 Posted July 24, 2016 Check this: function handleVehicleDamage(_, weapon, _, _, _, _, _) if ( weapon == 0 ) then -- If the weapon == fist then cancelEvent( ) end end addEventHandler("onClientVehicleDamage", root, handleVehicleDamage)
botshara Posted July 24, 2016 Author Posted July 24, 2016 Check this: function handleVehicleDamage(_, weapon, _, _, _, _, _) if ( weapon == 0 ) then -- If the weapon == fist then cancelEvent( ) end end addEventHandler("onClientVehicleDamage", root, handleVehicleDamage) Nop, I have this script, with this cant damage car physically (when black smokes go out from motor and cant start motor), but I want make script which cant damage car visually when hitting by hand. Works like anti-DM script for roleplay server
aka Blue Posted July 25, 2016 Posted July 25, 2016 A car doesn't have physically damage -.- You mean the health or the damage proof... function handleVehicleDamage(_, weapon, _, _, _, _, _) local health = getElementHealth( source ) if ( weapon == 0 ) then -- If the weapon == fist then setElementHealth( source, tonumber( health ) ) cancelEvent( ) end end addEventHandler("onClientVehicleDamage", root, handleVehicleDamage)
Captain Cody Posted July 25, 2016 Posted July 25, 2016 Try this tablea = {1,2,3,4,5,6} function preventDamage() for i,v in pairs(tablea) do setVehiclePanelState(source,v,0) end addEventHandler("onVehicleDamage", getRootElement(), preventDamage) When the vehicle is damaged, it automaticly fixes all panels. But vehicle health can still drain
Walid Posted July 25, 2016 Posted July 25, 2016 (edited) @CodyL , instead of using tablea you can use this for i =1, 6 do -- your code here end Edited July 25, 2016 by Guest
Captain Cody Posted July 25, 2016 Posted July 25, 2016 Oh yeh, I forgot about that at the time. Here's an example following @Walids function preventDamage() for i=0,6 do setVehiclePanelState(source,v,0) end addEventHandler("onVehicleDamage", getRootElement(), preventDamage)
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