DRW Posted April 4, 2016 Posted April 4, 2016 So I'm using Castillo's Gang System (https://community.multitheftauto.com/?p ... ls&id=1514) and this script has an export called "getGangMembers" which is supposed to return a table. I need that, so I made a command which is this: addCommandHandler ("getmembers",function(player,cmd,gang,sgang) for i,gangmembers in ipairs (exports.gang_system:getGangMembers (gang.." "..sgang)) do for i,members in pairs (gangmembers) do outputChatBox (members) end end end) When I use this command along with the gang name, well, it outputs three chat messages, which means each member has a table part with three parameters: 1,2 and 3. Every parameter is printed to the chatbox. I only want the script to select the third parameter only and ignore the first two. So, instead of printing to the chatbox: 1,2 and 3 it'll have to print the third parameter only. Tried using this: addCommandHandler ("getmembers",function(player,cmd,gang,sgang) for i,gangmembers in ipairs (exports.gang_system:getGangMembers (gang.." "..sgang)) do for i,members in pairs (gangmembers) do outputChatBox (members[3]) -- Added the [3] here, but either [1] or [2] don't work end end end) Also tried to use ipairs instead of pairs but it didn't work either. ¿What should I do? Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
KariiiM Posted April 6, 2016 Posted April 6, 2016 addCommandHandler ("getmembers", function(player,cmd,...) -- type /getmembers for index, members in pairs(exports.gang_system:getGangMembers(table.concat({...}," "))) do if members[3] then outputChatBox(members[3],player) end end end)
KariiiM Posted April 6, 2016 Posted April 6, 2016 addCommandHandler ("getmembers", function(player,cmd,...) -- type /getmembers for index, members in pairs(exports.gang_system:getGangMembers(table.concat({...}," "))) do if members[3] then outputChatBox(members[3],player) end end end)
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