Jump to content

little help ^_^


IIIIlllllIII

Recommended Posts

Posted

hi guys

i want to know how to make anti weapon on the same player

not anti attacker weapon

for example i want make anti weapon 16 and 39

how i make it on the same player

note not anti weapon for attacker.

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

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

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