Jump to content

Friendly Fire


Klesh

Recommended Posts

Posted

I was reading on wiki.mta about friendly fire teams but the code on wiki no works;

addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), 
function () 
local allTeams = getElementsByType ( "team" ) 
for index, theTeam in ipairs(allTeams) do 
        setTeamFriendlyFire ( theTeam, false ) 
    end 
end) 

Thanks for Any help.

Posted

Disable the friendly fire for every team?

team1 = createTeam(text,r,g,b) 
setTeamFriendlyFire(team1,false) 

I had problems in the past setting for all the teams.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

DON'T TRIPLE-POST!!

Post your code here.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Sorry for Spam.

The code is the same from wiki.

addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), 
function () 
local allTeams = getElementsByType ( "team" ) 
for index, theTeam in ipairs(allTeams) do 
        setTeamFriendlyFire ( theTeam, false ) 
    end 
end) 

Teams created by a gamemode.

Citizens

Private Corp.

[s.T.A.R.S]

Girls

Tested, doesn t works!

Posted

Post your team's code -_-.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

That's a map file, i'm asking for the SCRIPT, do you get me? what gamemode are you using btw?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Post the script part where it creates the teams.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Citizens = createTeam(text,r,g,b) 
[S.T.A.R.S] = createTeam(text,r,g,b) 
Private Corp = createTeam(text,r,g,b) 
Girls = createTeam(text,r,g,b) 
setTeamFriendlyFire(citizens,false) 
setTeamFriendlyFire([S.T.A.R.S],false) 
setTeamFriendlyFire(Private Corp,false) 
setTeamFriendlyFire(Girls,false) 
end) 

There is one, but the problem is how to enable for all friendly fire nobody cant kill another.

  • Moderators
Posted

Oh you want to enable friendly fire for all teams?

addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), 
function () 
local allTeams = getElementsByType ( "team" ) 
for index, theTeam in ipairs(allTeams) do 
        setTeamFriendlyFire ( theTeam, true ) 
    end 
end) 

Posted
  
    Citizens = createTeam(text,r,g,b) 
    [S.T.A.R.S] = createTeam(text,r,g,b) 
    Private Corp = createTeam(text,r,g,b) 
    Girls = createTeam(text,r,g,b) 
    setTeamFriendlyFire(citizens,false) 
    setTeamFriendlyFire([S.T.A.R.S],false) 
    setTeamFriendlyFire(Private Corp,false) 
    setTeamFriendlyFire(Girls,false) 
    end) 
  

i found 7 syntax errors here, you should reread wiki.

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