Jump to content
  • 0

how can i never die and my car never blow in my server mta s


SonGohanL

Question

10 answers to this question

Recommended Posts

  • 0
  • Moderators
setVehicleDamageProof( theVehicle, damageProof ) -- theVehicle: The vehicle you wish to make damage proof. damageProof: true is damage proof, false is damageable. 

addEventHandler("onClientPlayerDamage", root,  
function () 
cancelEvent() 
end) 

Link to comment
  • 0

untested code, fix it yourself

server:

  
addCommandHandler('godmode', function(p) 
   local status = getElementData(p,'god') and true or false 
   setElementData(p, 'god', not status, true) 
end) 
  
addEventHandler('onVehicleEnter', function(p) 
   local status = getElementData(p,'god') and true or false 
   setVehicleDamageProof(source, status) 
end) 
  
addEventHandler('onVehicleLeave', function(p) 
   local status = getElementData(p,'god') and true or false 
   if status then 
      setVehicleDamageProof(source, not status) 
   end 
end) 
  

 

client:

addEventHandler("onClientPlayerDamage", root, function() 
   if getElementData(source,'god') then cancelEvent() end 
end) 

Link to comment

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...