Jump to content

little help ^_^


IIIIlllllIII

Recommended Posts

Posted

i mean i have shop panel

and i want when i buy Grenade or Satchel Charges i want not be killed with my Satchel Charges and greande

do you understand me i want make anti grenade and Satchel Charges when the player buy Satchel Charges they cant be killed

http://mojrm511.x10.mx

msn:

[email protected]

my server ip:

176.9.40.71:22779

-------------------------------------- 2012 updated--------

Posted
  
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 ) 
  

Posted

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)

Posted
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

http://mojrm511.x10.mx

msn:

[email protected]

my server ip:

176.9.40.71:22779

-------------------------------------- 2012 updated--------

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