Jump to content

little help ^_^


IIIIlllllIII

Recommended Posts

  
function stopGrenadeDamage ( attacker, weapon, bodypart ) 
    if ( weapon == 0 ) and ( attacker == getLocalPlayer() ) then --CHANGE THIS TO THE ID OF GRENADE LAUNCHER w/e 
        cancelEvent() --cancel the event 
    end 
end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopGrenadeDamage ) 
  

Link to comment

BinSlayer1, you weren't very clear with that code. He could not understand and make the code useless.

function stopGrenadeDamage ( attacker, weapon, bodypart ) 
    if weapon == 0 and attacker == getLocalPlayer() then --If the weapon is grenade and you are receiving damage from yourself 
        cancelEvent ( ) --cancel the damage 
    end 
end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopGrenadeDamage ) 

In "weapon == 0", change 0 to the ID of the grenade (search here, in ID, NOT MODEL ID)

Link to comment
BinSlayer1, you weren't very clear with that code. He could not understand and make the code useless.
function stopGrenadeDamage ( attacker, weapon, bodypart ) 
    if weapon == 0 and attacker == getLocalPlayer() then --If the weapon is grenade and you are receiving damage from yourself 
        cancelEvent ( ) --cancel the damage 
    end 
end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopGrenadeDamage ) 

In "weapon == 0", change 0 to the ID of the grenade (search here, in ID, NOT MODEL ID)

thank you very much

and thanks to BinSlayer1

:D

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