Jump to content

Health


Gtagasje

Recommended Posts

use 2 things :)

https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup

function StopDamage ( attacker, weapon, bodypart ) 
    cancelEvent() 
end 
bindKey ( "F1" , "down" ,StopDamage)  
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(),StopDamage ) 

Edited :)

Mojrem that is for body part you noob

he want no damage at all

Please Read Wiki for few minutes

Edited by Guest
Link to comment
Thank you, but how do I need to start it on button hit? Just put bindKey above the eventHandler?

try this :D

  
  
  
function StopDamage ( attacker, weapon, bodypart ) 
if ( bodypart == 3 or 4 or 5 or 6 or 7 or 8 or 9 ) then 
   cancelEvent()  
end 
end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), StopDamage ) 
  
bindKey ( "F1" , "down" ,StopDamage)  
  
  
  
  
  
  
  

Link to comment

no it doesn't.

local noDamage = false 
  
function toggleStopDamage() 
  noDamage = not noDamage 
  outputChatBox(noDamage and "Damage is off" or "Damage is on") 
end 
bindKey("F1", "down", toggleStopDamage)  
  
function StopDamage() 
  if noDamage then 
    cancelEvent() 
  end 
end 
addEventHandler("onClientPlayerDamage", localPlayer, StopDamage) 

you'll haev to add "admin check" yourself

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