Jump to content

[help] turf.


Chronos

Recommended Posts

hello , well i made turf system but i have a problem.

    local pArea     = createRadarArea( 2130, 630, 200, 100, 0, 255, 0, 175 ) 
    local pArea2     = createRadarArea( 2488.8793945313, 680.78289794922, 250, 130, 0, 255, 0, 175 ) 
function radar ( player ) 
local playerGang = getElementData ( player, "gang" ) 
local turfGang = getElementData ( pCuboid, "getTurfGang", true ) 
    if (turfGang == playerGang) then 
    else 
        if not getPlayerTeam(player) then return end 
    local team = getPlayerTeam ( player ) 
    if (getTeamName( team ) == "Criminal") then 
    local playerGang = getElementData ( player, "gang" ) 
    if ( playerGang ) then 
        if ( isTimer ( beachturfTimer ) ) then 
            return 
        end 
  
        local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) 
        local turfGang = getElementData ( pCuboid2, "getTurfGang", true ) 
        setRadarAreaFlashing ( pArea, false ) 
        if turfGang then 
        outputChatBox("Entrer zone"..turfGang..". to provoke this turf stay here", player, 0, 255, 0, false) 
        else 
        outputChatBox("this turf without owner stay here to take it.", player, 0, 255, 0, false) 
        outputChatBox("Capturing turf progress 1/10", player, 0, 255, 0, false) 
        outputChatBox("Capturing turf progress 2/10", player, 0, 255, 0, false) 
        outputChatBox("Capturing turf progress 3/10", player, 0, 255, 0, false) 
        outputChatBox("Capturing turf progress 4/10", player, 0, 255, 0, false) 
        outputChatBox("Capturing turf progress 5/10", player, 0, 255, 0, false) 
        outputChatBox("Capturing turf progress 6/10", player, 0, 255, 0, false) 
        outputChatBox("Capturing turf progress 7/10", player, 0, 255, 0, false) 
        outputChatBox("Capturing turf progress 8/10", player, 0, 255, 0, false) 
        outputChatBox("Capturing turf progress 9/10", player, 0, 255, 0, false) 
        outputChatBox("Capturing turf progress 10/10", player, 0, 255, 0, false) 
        setRadarAreaFlashing ( pArea, true ) 
        outputChatBox("stay here to claim this turf.", player, 0, 255, 0, false) 
        outputChatBox("Preparing turf war progress  1/10", player, 0, 255, 0, false) 
        outputChatBox("Preparing turf war progress  2/10", player, 0, 255, 0, false) 
        outputChatBox("Preparing turf war progress  3/10", player, 0, 255, 0, false) 
        outputChatBox("Preparing turf war progress  4/10", player, 0, 255, 0, false) 
        outputChatBox("Preparing turf war progress  5/10", player, 0, 255, 0, false) 
        outputChatBox("Preparing turf war progress  6/10", player, 0, 255, 0, false) 
        outputChatBox("Preparing turf war progress  7/10", player, 0, 255, 0, false) 
        outputChatBox("Preparing turf war progress  8/10", player, 0, 255, 0, false) 
        outputChatBox("Preparing turf war progress  9/10", player, 0, 255, 0, false) 
        outputChatBox("Preparing turf war progress  10/10", player, 0, 255, 0, false) 
        end 
         
  
        beachturfTimer = setTimer ( 
            function ( ) 
                local beachTurfCplayers = getElementColShape ( pCuboid ) 
                local players = getElementsWithinColShape ( pCuboid, "player" ) 
                setRadarAreaColor ( pArea, tonumber(r), tonumber(g), tonumber(b), 100 ) 
                for _, player in ipairs ( players ) do 
                    outputChatBox("congratulation,your gang gas taken the turf.", player, 0, 255, 0, false) 
                    triggerClientEvent("onTakeTurf", player) 
                    givePlayerMoney ( player, 5000 ) 
                    setElementData ( pCuboid, "getTurfGang", playerGang ) 
                end 
                setRadarAreaFlashing ( pArea, false ) 
            end 
            ,120000, 1 
        ) 
    end 
end 
end 
end 
addEventHandler ( "onColShapeHit", pCuboid, radar ) 

the problem is in outputChatpox i test it ,when i entrer the turf the count start to fast.

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