Jump to content

[help] friendlyfire


Chaos

Recommended Posts

hi,

i have problem with friendlyfire when a player use weapons Cause fires like flame or rpg the other wise will dead due to fire.

for _, v in ipairs ( getElementsByType 'team' ) do 
    setTeamFriendlyFire ( v, false ) 
end 

Link to comment
hi,

i have problem with friendlyfire when a player use weapons Cause fires like flame or rpg the other wise will dead due to fire.

for _, v in ipairs ( getElementsByType 'team' ) do 
    setTeamFriendlyFire ( v, false ) 
end 

getElementsByType ( 'team' ) 

What's the difference..?

Link to comment
addEventHandler( "onClientPlayerDamage", root, 
    function( attacker, weapon ) 
        if attacker and getElementType( attacker ) == "player" and attacker ~= source then 
            local aTeam = getPlayerTeam( attacker ) 
            local sTeam = getPlayerTeam( source ) 
            if sTeam ~= false and sTeam == aTeam then 
                cancelEvent( ) 
            end 
        end 
    end 
) 

Try this

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