SkatCh Posted June 29, 2014 Share Posted June 29, 2014 (edited) guys please i want to create an export fuction (getGroupTurfColor) to call it when a gang hit a turf area : a part of the script : function command_turfcolor(player, _, r, g, b) local gang = getPlayerGang(player) if (not gang) then return end if (canPlayerDoActionInGroup(player, "changeTurfColor")) then if (r and g and b) then r = tonumber(r) g = tonumber(g) b = tonumber(b) if (r and g and b) then if (r >= 0 and r <= 255 and g >= 0 and g <= 255 and b >= 0 and b <= 255) then local colorTable = {math.floor(r), math.floor(g), math.floor(b)} dbExec(con, "UPDATE gangSysGangs SET turfColor=? WHERE name=?", toJSON(colorTable), gang) gangs[gang][5] = colorTable exports.COG_text:output("Turfcolor set to "..colorTable[1]..", "..colorTable[2]..", "..colorTable[3], player, colorTable[1], colorTable[2], colorTable[3]) else i tried this but it dosen't work : function getGroupTurfColor(gang) if (not groupTable) then return 255, 255, 255 end local color = fromJSON(gangs[gang][5]) return colorTable[1], colorTable[2], colorTable[3] end function="getGroupTurfColor" type="server"/> Edited June 30, 2014 by Guest Link to comment
Moderators IIYAMA Posted June 29, 2014 Moderators Share Posted June 29, 2014 Nothing is saved at index 6? (export function > script a both) and I don't see anything that is storing anything at groupTable.(export function) So it is for me an puzzle which can't be solved because of a leak of information. Please post the required information and not more then that. Link to comment
SkatCh Posted June 29, 2014 Author Share Posted June 29, 2014 i think you don't undrestand my question it's just a part from the script i already create the table using sqlite : dbExec(con, "CREATE TABLE IF NOT EXISTS gangSysGangs (name TEXT, count TEXT, leader TEXT, lastactive TEXT, message TEXT,turfcolor TINYTEXT, chatcolor TINYTEXT, invitesUsed INTEGER)") all what i need is i want to create an export function to call it from turf script to get the group turf color did you undrestand what i mean . Link to comment
Mr_Moose Posted June 30, 2014 Share Posted June 30, 2014 Is that some kind of combined group and turf system or what do you have so far? The solution you tried will only work if you planning to install the AC turf system together with Sebbe (Smart) group system. If you're using another system or made your own then ofc it won't work. Post the full code, or at least the part where the table and storage structure are declared. Link to comment
SkatCh Posted June 30, 2014 Author Share Posted June 30, 2014 but bro you said that it will wok with any group system i already checked ur forum can you gave me you Skype or can i Pm u . Link to comment
Mr_Moose Posted June 30, 2014 Share Posted June 30, 2014 but bro you said that it will wok with any group system i already checked ur forum can you gave me you Skype or can i Pm u . It will still depend on how the group system is made, how it's table structure are and what names you are using on the tables, everything has to be correct in order to make it work. Sorry to say it but it won't work just like that. Either modify the turf system to work with your group system or modify your group system with a proper table structure to use the given solution, it's up to you. 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