Jump to content

turf color


SkatCh

Recommended Posts

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 by Guest
Link to comment
  • Moderators

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

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

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...