Klesh Posted May 9, 2011 Share 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. Link to comment
Discord Moderators Zango Posted May 9, 2011 Discord Moderators Share Posted May 9, 2011 Could it be the teams are not created prior to this? Link to comment
Klesh Posted May 9, 2011 Author Share 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. Link to comment
Castillo Posted May 9, 2011 Share 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. Link to comment
Klesh Posted May 10, 2011 Author Share 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. Link to comment
Klesh Posted May 10, 2011 Author Share Posted May 10, 2011 Some help? Because in the wiki, the script no works. Link to comment
Klesh Posted May 10, 2011 Author Share 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. Link to comment
Castillo Posted May 10, 2011 Share Posted May 10, 2011 DON'T TRIPLE-POST!! Post your code here. Link to comment
Klesh Posted May 10, 2011 Author Share 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! Link to comment
Klesh Posted May 10, 2011 Author Share Posted May 10, 2011 (edited) Team Code is in Cdm.map Code deleted. Edited May 10, 2011 by Guest Link to comment
Castillo Posted May 10, 2011 Share 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? Link to comment
Klesh Posted May 10, 2011 Author Share 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. Link to comment
Castillo Posted May 10, 2011 Share Posted May 10, 2011 Post the script part where it creates the teams. Link to comment
Klesh Posted May 10, 2011 Author Share 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. Link to comment
Discord Moderators Zango Posted May 11, 2011 Discord Moderators Share 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) Link to comment
Klesh Posted May 11, 2011 Author Share Posted May 11, 2011 Yes i will test the code. Thanks for your help. Link to comment
karlis Posted May 12, 2011 Share 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. Link to comment
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