FelipeMallmann Posted October 27, 2015 Share Posted October 27, 2015 Hey guys, I need some help, it's my first time working with tables, I want to understand how it really works.. I have these 2 local variable, the first one gets the gang that owns the gangzone, and the second gets all members from this group (online and offline members) or at least it should get. My problem is this for _,v ipairs because I get an error that says i cant do getElementData from a table. Just to you guys undertand: I'm trying to get all members from a group and give money to all members, but I'm getting problems with this for and tables. How can I outPutChatBox the table to see if I'm getting the right names ? local turfGang = executeSQLQuery("SELECT GangOwner FROM Turf_System WHERE Turfs=?", "Turf["..tostring(3).."]" ) local gangMembers = executeSQLQuery("SELECT member_account FROM gang_members WHERE gang_name=?", turfGang ) --local players = getElementsByType ( "player" ) for _, v in ipairs( gangMembers ) do if getElementData(v, "gang") == turfGang then outputChatBox("sucesso", getRootElement(), 0, 255, 0, false ) --giveplayermoney... end end 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