Jump to content

Territorie Help $


VenomOG

Recommended Posts

Territorie Script Help,
So i got an territorie system that u can take areas and get money every 1hour
but 1 small bug
the player must be in-game to get the money,
anything to fix?
CODE,

function sendTurfPayout ( ) 
    local groupTurfs = { }
    for i, v in pairs ( turfLocs ) do 
        if ( not groupTurfs [ v.owner ] ) then 
            groupTurfs [ v.owner ] = 0
        end 

        if ( not v.attackers ) then 
            groupTurfs [ v.owner ] = groupTurfs [ v.owner ] + 1
        end   
    end

    for i, v in pairs ( getElementsByType ( 'turfs' ) ) do
        local g = exports.Groups:getPlayerGroup ( v )
        if ( g and groupTurfs [ g ] and groupTurfs [ g ] > 0 ) then
        local c = groupTurfs [ g ] * tonumber ( get ( "*PAYOUT_CASH" ) )
        exports["Groups"]:setGroupBank ( g, exports["Groups"]:getGroupBank ( g ) + c )
        exports.Groups:outputGroupLog ( g,"Get Turfing Price: "..tostring ( groupTurfs [ g ] ).."Turf "..tostring(c).."$", v)
        exports.Messages:sendClientMessage ( "Turfing: Here is $"..tostring(c).." for having "..tostring ( groupTurfs [ g ] ).." in your clan bank", v, 0, 255, 0 )
        end
    end
end

 

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