Jump to content

visual damage


botshara

Recommended Posts

Posted
function fixVehiclea() 
fixVehicle(source) 
end 
  
addEventHandler("onVehicleDamage", getRootElement(), fixVehiclea) 

not good soloution if vehicle is damaged its fix it fully

Posted

Check this:

function handleVehicleDamage(_, weapon, _, _, _, _, _) 
    if ( weapon == 0 ) then -- If the weapon == fist then 
        cancelEvent( ) 
    end 
end 
addEventHandler("onClientVehicleDamage", root, handleVehicleDamage) 

yDORrdn.png

Posted
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

Posted

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) 

yDORrdn.png

Posted

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

Wolf Inc Discord

Youtube channel
Github

Posted (edited)

@CodyL , instead of using tablea you can use this

52193abcc8.png

for i =1, 6 do 
 -- your code here 
end 

Edited by Guest

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

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) 

Wolf Inc Discord

Youtube channel
Github

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...