Klesh Posted May 9, 2011 Posted May 9, 2011 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.
Discord Moderators Zango Posted May 9, 2011 Discord Moderators Posted May 9, 2011 Could it be the teams are not created prior to this?
Klesh Posted May 9, 2011 Author Posted May 9, 2011 The Teams are created, but i put the scrip on folder with meta and that, but nothing. And im trying to do no only a friendlyfire for team, for any player, i mean any player cant kill another player.
Castillo Posted May 9, 2011 Posted May 9, 2011 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.
Klesh Posted May 10, 2011 Author Posted May 10, 2011 You mean a script with this? friendlyfire.lua? i was do, but not works and the are created in the server with a gamemode. Thanks for any help.
Klesh Posted May 10, 2011 Author Posted May 10, 2011 Some help? Because in the wiki, the script no works.
Klesh Posted May 10, 2011 Author Posted May 10, 2011 The Friendly cant be true right, becuase this desactivates, i try all but nothing work, some help about how can disable friendly for all, any player cant damage another one. Thanks for any help.
Klesh Posted May 10, 2011 Author Posted May 10, 2011 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!
Klesh Posted May 10, 2011 Author Posted May 10, 2011 (edited) Team Code is in Cdm.map Code deleted. Edited May 10, 2011 by Guest
Castillo Posted May 10, 2011 Posted May 10, 2011 That's a map file, i'm asking for the SCRIPT, do you get me? what gamemode are you using btw?
Klesh Posted May 10, 2011 Author Posted May 10, 2011 Like i say before only i try with the script of wiki because is the tutorial -.-. Im using CDM for it.
Klesh Posted May 10, 2011 Author Posted May 10, 2011 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.
Discord Moderators Zango Posted May 11, 2011 Discord Moderators Posted May 11, 2011 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)
karlis Posted May 12, 2011 Posted May 12, 2011 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now