Jump to content

[HELP] Turfs Group Color


Lopes

Recommended Posts

Erro Code: call: failed to call 'group:getGroupColor' [string "?"]

function captureTurf(group, element)
    if (group and element) then
        setRadarAreaFlashing(radar[element], false)
        if (capture[group] and isTimer(capture[group])) then
            killTimer(capture[group])
        end
        if (isTimer(timer[group])) then
            killTimer(timer[group])
        end
        local count = 0
        for index, ent in pairs(getElementsByType("player")) do
            local g2 = exports.group:getPlayerGroup(ent)
            if (g2 and g2 == group) then
                if (isElementWithinColShape(ent, element)) then
                    if (isPedInVehicle(ent)) then return end
                    local count = count + 1
                    local countMoney = 300 * count
                    local final = 3500 + countMoney
                    local final = math.floor(final)
                    outputChatBox("Parabéns Você Dominou Esse Territorio e Ganhou"..final, ent, 0, 245, 185)
                    exports.CSFaccounts:GPM(ent, final, "CSFturfs captured a turf")
                end
                local r, g, b = exports.group:getGroupColor(group)
                setRadarAreaColor(radar[element], r or 0, g or 255, b or 0, 150)
                outputChatBox("Seu Grupo Dominou Territorio Com Sucesso "..turfName[element], ent, r, g, b)
                turfOwner[element] = group
                triggerClientEvent(ent, "CSFturfs.removeDrawing", ent)
            end
        end
    end
end

 

Edited by Lopes
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...