Xwad Posted December 28, 2014 Share Posted December 28, 2014 How can i disable teammate kill in classic deatmach gamemode? pls help Link to comment
WASSIm. Posted December 28, 2014 Share Posted December 28, 2014 with: setTeamFriendlyFire Link to comment
Xwad Posted December 28, 2014 Author Share Posted December 28, 2014 but where must i write this? Link to comment
xeon17 Posted December 28, 2014 Share Posted December 28, 2014 I suggest you to learn Scripting Link to comment
Xwad Posted December 28, 2014 Author Share Posted December 28, 2014 Okay but pls tell me how to make this script!! Need i create a lua and a meta file? Link to comment
xeon17 Posted December 28, 2014 Share Posted December 28, 2014 Read this, viewtopic.php?f=91&t=83473&p=759228#p759228 Link to comment
Xwad Posted December 28, 2014 Author Share Posted December 28, 2014 i dont understand it:( can you make a rescource for this? pls? Link to comment
xeon17 Posted December 28, 2014 Share Posted December 28, 2014 Just use the code from wiki, the example is doing that what you want... -- get a table with all teams local allTeams = getElementsByType ( "team" ) -- for every team, addEventHandler("onResourceStart", resourceRoot, function () for index, theTeam in ipairs(allTeams) do -- if friendly fire is off, if ( getTeamFriendlyFire ( theTeam ) == false ) then -- switch it on setTeamFriendlyFire ( theTeam, true ) end end) Link to comment
Xwad Posted December 28, 2014 Author Share Posted December 28, 2014 ohhh okay and i need to write it in a lua file? Link to comment
xeon17 Posted December 28, 2014 Share Posted December 28, 2014 https://wiki.multitheftauto.com/wiki/Resources https://wiki.multitheftauto.com/wiki/Sc ... troduction Don't be lazy and check these links,there is everything what you need to know. Link to comment
Xwad Posted December 28, 2014 Author Share Posted December 28, 2014 Ok i have read it and did this. Is it so good? META.XML teamkill.lua -- get a table with all teams local allTeams = getElementsByType ( "team" ) -- for every team, for index, theTeam in ipairs(allTeams) do -- if friendly fire is off, if ( getTeamFriendlyFire ( theTeam ) == false ) then -- switch it on setTeamFriendlyFire ( theTeam, true ) end end Link to comment
Xwad Posted December 28, 2014 Author Share Posted December 28, 2014 When i start the server it says: ERROR: Couldn't parse meta file for resource 'teamkill' Loading of resource 'teamkill' failed Link to comment
Xwad Posted December 28, 2014 Author Share Posted December 28, 2014 Ohhh xddd thatnks dude! Link to comment
Xwad Posted December 29, 2014 Author Share Posted December 29, 2014 It dosent work:((( i tested it with my friend and he can kill me when we are in one team! Have i do something wrong? META.XML teamkill.lua -- get a table with all teams local allTeams = getElementsByType ( "team" ) -- for every team, for index, theTeam in ipairs(allTeams) do -- if friendly fire is off, if ( getTeamFriendlyFire ( theTeam ) == false ) then -- switch it on setTeamFriendlyFire ( theTeam, true ) end end Link to comment
xeon17 Posted December 29, 2014 Share Posted December 29, 2014 Use this.. -- get a table with all teams local allTeams = getElementsByType ( "team" ) -- for every team, addEventHandler("onResourceStart", resourceRoot, function () for index, theTeam in ipairs(allTeams) do -- if friendly fire is off, if ( getTeamFriendlyFire ( theTeam ) == false ) then -- switch it on setTeamFriendlyFire ( theTeam, true ) end end) Link to comment
Xwad Posted December 29, 2014 Author Share Posted December 29, 2014 does not work i start the script in the admin panel but it does not work Link to comment
Xwad Posted December 29, 2014 Author Share Posted December 29, 2014 but where must i place this folder? in the rescources or in gameplay? Link to comment
Catalyst Posted December 29, 2014 Share Posted December 29, 2014 Place files in [MTA server directory]/mods/deathmatch/resources/ Do /refresh as an admin on the server or restart the server Then try /start and look on F8 if any errors come up. Link to comment
Xwad Posted December 29, 2014 Author Share Posted December 29, 2014 ok it works thanks! 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