Jump to content

[HELP]Turf System Whit Changes


Recommended Posts

Hello, I wanted to change a resource called turf, but errors occurred meant that instead of having getPlayerTeam getPlayerGang but this would not work says getPlayerGang is a nil value, here are the original and modified code

Original:

server side:

local pArea     = createRadarArea( 2130, 630, 200, 100, 255, 255, 255, 125 ) 
    local pArea2     = createRadarArea( 2488.8793945313, 680.78289794922, 250, 130, 255, 255, 255, 125 ) 
    local pCuboid   = createColCuboid( 2133.1950683594, 633.66455078125, 10, 197.5, 92, 30 ) 
    local pCuboid2   = createColCuboid( 2486.5935058594, 678.20172119141, 9.5689830780029,  245, 133, 30 ) 
    local pArea3     = createRadarArea( 1858, 623, 140, 165, 255, 255, 255, 125 ) 
    local pCuboid3   = createColCuboid( 1856.2864990234, 627.07629394531, 9,  138.25, 152.75, 30 ) 
    local pArea4     = createRadarArea( 1577, 663, 180, 130, 255, 255, 255, 125 ) 
    local pCuboid4   = createColCuboid( 1576.8956298828, 662.84362792969, 9.671875, 181, 120.5, 30 )  
    local pArea5     = createRadarArea( 2778, 834, 110, 190, 255, 255, 255, 125 ) 
    local pCuboid5   = createColCuboid( 2777.4248046875, 833.88018798828, 9.6484375,  113.5, 188, 30 )  
      
addEventHandler("onResourceStart", resourceRoot, 
function() 
    outputDebugString("|~| Turf system by manve1 |~| Has been turned on! |~| This system was downloaded from MTA Community. |~|", 3, 0, 255, 0) 
end  
) 
  
--[[addEventHandler("onResourceStop", resourceRoot, 
function() 
    outputDebugString("|~| Turf system by manve1 |~| Has been turned off! |~| This system was downloaded from MTA Community. |~|", 3, 0, 255, 0) 
  
    saveS = xmlLoadFile( 'file_saves.xml' ) 
    local save_info = xmlFindChild(saveS, 'turf', 0) 
    xmlNodeSetAttribute( save_info, 'saved', 'nothing new' ) 
  
end  
)]] 
            addEventHandler( 
                'onColShapeHit', pCuboid, 
                function( player ) 
                    if (getPlayerTeam( player )) then 
                        local pTeam = getPlayerTeam( player ) 
                        local iR, iG, iB = getTeamColor( pTeam ) 
                        local rR, gG, bB = getRadarAreaColor( pArea ) 
                        if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                            triggerClientEvent(player, 'friendly', player) 
                        else 
                        setRadarAreaFlashing( pArea, true ) 
                        triggerClientEvent(player, 'time', player) 
                        triggerClientEvent(player, 'countdown', player) 
                        pArea1Timer = setTimer( function() 
                        setRadarAreaColor (pArea, iR, iG, iB, 100); 
                        givePlayerMoney( player, 4000 ); 
                        outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", player, 0, 255, 0, true ); 
                        setRadarAreaFlashing( pArea, false ) 
                        end, 6000, 1 ) 
                        end 
                    else 
                        triggerClientEvent(player, 'group', player) 
                    end 
                end 
        ) 
  
    addEventHandler( 
        'onColShapeLeave', root,    
        function( player ) 
            if( source == pCuboid ) then 
                setRadarAreaFlashing( pArea, false ) 
                triggerClientEvent(player, 'time2', player) 
                triggerClientEvent(player, 'friendly2', player) 
                if isTimer( pArea1Timer ) then 
                    killTimer( pArea1Timer ) 
                end 
            end 
        end 
    ) 
     
    ----------------------------- 
    addEventHandler(  
        'onColShapeHit', root, 
        function( p ) 
          if (getPlayerTeam( p )) then 
            if( source == pCuboid2 ) then 
                local pTeam = getPlayerTeam( player ) 
                local iR, iG, iB = getTeamColor( pTeam ) 
                local rR, gG, bB = getRadarAreaColor( pArea2 ) 
                if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                        triggerClientEvent(player, 'friendly', player) 
                else 
                setRadarAreaFlashing( pArea2, true ) 
                triggerClientEvent(player, 'time', player) 
                pArea2Timer = setTimer( function() 
                setRadarAreaColor (pArea2, iR2, iG2, iB2, 100); 
                givePlayerMoney( p, 4000 ); 
                outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); 
                setRadarAreaFlashing( pArea2, false ) 
                end, 600000, 1 ) 
                end 
                end 
          else   
                triggerClientEvent(player, 'group', player) 
          end 
             
        end 
    ) 
  
    addEventHandler( 
        'onColShapeLeave', root,    
        function( p ) 
            if( source == pCuboid2 ) then 
                setRadarAreaFlashing( pArea2, false ) 
                triggerClientEvent(player, 'time2', player) 
                triggerClientEvent(player, 'friendly2', player) 
                if isTimer( pArea2Timer ) then 
                    killTimer( pArea2Timer ) 
                end 
            end 
        end 
    ) 
     
    ------------------------------------ 
     
        addEventHandler(  
        'onColShapeHit', root, 
        function( p ) 
          if (getPlayerTeam( p )) then 
            if( source == pCuboid3 ) then 
                local pTeam = getPlayerTeam( player ) 
                local iR, iG, iB = getTeamColor( pTeam ) 
                local rR, gG, bB = getRadarAreaColor( pArea3 ) 
                if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                    triggerClientEvent(player, 'friendly', player) 
                else 
                setRadarAreaFlashing( pArea3, true ) 
                triggerClientEvent(player, 'time', player) 
                pArea3Timer = setTimer( function() 
                setRadarAreaColor (pArea3, iR2, iG2, iB2, 100); 
                givePlayerMoney( p, 4000 ); 
                outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); 
                setRadarAreaFlashing( pArea3, false ) 
                end, 600000, 1 ) 
                end 
            end 
          else   
                triggerClientEvent(player, 'group', player) 
          end 
             
        end 
    ) 
  
    addEventHandler( 
        'onColShapeLeave', root,    
        function( p ) 
            if( source == pCuboid3 ) then 
                setRadarAreaFlashing( pArea3, false ) 
                triggerClientEvent(player, 'time2', player) 
                triggerClientEvent(player, 'friendly2', player) 
                if isTimer( pArea3Timer ) then 
                    killTimer( pArea3Timer ) 
                end 
            end 
        end 
    ) 
     
    ------------------------------------- 
     
            addEventHandler(  
        'onColShapeHit', root, 
        function( p ) 
          if (getPlayerTeam( p )) then 
            if( source == pCuboid4 ) then 
                local pTeam = getPlayerTeam( player ) 
                local iR, iG, iB = getTeamColor( pTeam ) 
                local rR, gG, bB = getRadarAreaColor( pArea4 ) 
                if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                    triggerClientEvent(player, 'friendly', player) 
                else 
                setRadarAreaFlashing( pArea4, true ) 
                triggerClientEvent(player, 'time', player) 
                pArea4Timer = setTimer( function() 
                setRadarAreaColor (pArea4, iR2, iG2, iB2, 100); 
                givePlayerMoney( p, 4000 ); 
                outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); 
                setRadarAreaFlashing( pArea4, false ) 
                end, 600000, 1 ) 
                end 
            end 
          else   
                triggerClientEvent(player, 'group', player) 
          end 
             
        end 
    ) 
  
    addEventHandler( 
        'onColShapeLeave', root,    
        function( p ) 
            if( source == pCuboid4 ) then 
                setRadarAreaFlashing( pArea4, false ) 
                triggerClientEvent(player, 'time2', player) 
                triggerClientEvent(player, 'friendly2', player) 
                if isTimer( pArea3Timer ) then 
                    killTimer( pArea3Timer ) 
                end 
            end 
        end 
    ) 
     
    ----------------------------------- 
     
                addEventHandler(  
        'onColShapeHit', root, 
        function( p ) 
          if (getPlayerTeam( p )) then 
            if( source == pCuboid5 ) then 
                local pTeam = getPlayerTeam( player ) 
                local iR, iG, iB = getTeamColor( pTeam ) 
                local rR, gG, bB = getRadarAreaColor( pArea5 ) 
                if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                    triggerClientEvent(player, 'friendly', player) 
                else 
                setRadarAreaFlashing( pArea5, true ) 
                triggerClientEvent(player, 'time', player) 
                pArea5Timer = setTimer( function() 
                setRadarAreaColor (pArea5, iR2, iG2, iB2, 100); 
                givePlayerMoney( p, 4000 ); 
                outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); 
                setRadarAreaFlashing( pArea5, false ) 
                end, 600000, 1 ) 
                end 
            end 
          else   
                triggerClientEvent(player, 'group', player) 
          end 
             
        end 
    ) 
  
    addEventHandler( 
        'onColShapeLeave', root,    
        function( p ) 
            if( source == pCuboid5 ) then 
                setRadarAreaFlashing( pArea5, false ) 
                triggerClientEvent(player, 'time2', player) 
                triggerClientEvent(player, 'friendly2', player) 
                if isTimer( pArea5Timer ) then 
                    killTimer( pArea5Timer ) 
                end 
            end 
        end 
    ) 
  

modified:

Server Side:

 exports [ "gang_system" ]:getPlayerGang ( player ) 
    local pArea     = createRadarArea( 2130, 630, 200, 100, 255, 255, 255, 125 ) 
    local pArea2     = createRadarArea( 2488.8793945313, 680.78289794922, 250, 130, 255, 255, 255, 125 ) 
    local pCuboid   = createColCuboid( 2133.1950683594, 633.66455078125, 10, 197.5, 92, 30 ) 
    local pCuboid2   = createColCuboid( 2486.5935058594, 678.20172119141, 9.5689830780029,  245, 133, 30 ) 
    local pArea3     = createRadarArea( 1858, 623, 140, 165, 255, 255, 255, 125 ) 
    local pCuboid3   = createColCuboid( 1856.2864990234, 627.07629394531, 9,  138.25, 152.75, 30 ) 
    local pArea4     = createRadarArea( 1577, 663, 180, 130, 255, 255, 255, 125 ) 
    local pCuboid4   = createColCuboid( 1576.8956298828, 662.84362792969, 9.671875, 181, 120.5, 30 )  
    local pArea5     = createRadarArea( 2778, 834, 110, 190, 255, 255, 255, 125 ) 
    local pCuboid5   = createColCuboid( 2777.4248046875, 833.88018798828, 9.6484375,  113.5, 188, 30 )  
      
addEventHandler("onResourceStart", resourceRoot, 
function() 
    outputDebugString("|~| Turf system by manve1 |~| Has been turned on! |~| This system was downloaded from MTA Community. |~|", 3, 0, 255, 0) 
end  
) 
  
--[[addEventHandler("onResourceStop", resourceRoot, 
function() 
    outputDebugString("|~| Turf system by manve1 |~| Has been turned off! |~| This system was downloaded from MTA Community. |~|", 3, 0, 255, 0) 
  
    saveS = xmlLoadFile( 'file_saves.xml' ) 
    local save_info = xmlFindChild(saveS, 'turf', 0) 
    xmlNodeSetAttribute( save_info, 'saved', 'nothing new' ) 
  
end  
)]] 
            addEventHandler( 
                'onColShapeHit', pCuboid, 
                function( player ) 
                    if (getPlayerGang( player )) then 
                        local pTeam = getPlayerGang( player ) 
                        local iR, iG, iB = getTeamColor( pTeam ) 
                        local rR, gG, bB = getRadarAreaColor( pArea ) 
                        if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                            triggerClientEvent(player, 'friendly', player) 
                        else 
                        setRadarAreaFlashing( pArea, true ) 
                        triggerClientEvent(player, 'time', player) 
                        triggerClientEvent(player, 'countdown', player) 
                        pArea1Timer = setTimer( function() 
                        setRadarAreaColor (pArea, iR, iG, iB, 100); 
                        givePlayerMoney( player, 4000 ); 
                        outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", player, 0, 255, 0, true ); 
                        setRadarAreaFlashing( pArea, false ) 
                        end, 6000, 1 ) 
                        end 
                    else 
                        triggerClientEvent(player, 'group', player) 
                    end 
                end 
        ) 
  
    addEventHandler( 
        'onColShapeLeave', root,    
        function( player ) 
            if( source == pCuboid ) then 
                setRadarAreaFlashing( pArea, false ) 
                triggerClientEvent(player, 'time2', player) 
                triggerClientEvent(player, 'friendly2', player) 
                if isTimer( pArea1Timer ) then 
                    killTimer( pArea1Timer ) 
                end 
            end 
        end 
    ) 
     
    ----------------------------- 
    addEventHandler(  
        'onColShapeHit', root, 
        function( p ) 
          if (getPlayerGang( p )) then 
            if( source == pCuboid2 ) then 
                local pTeam = getPlayerGang( player ) 
                local iR, iG, iB = getTeamColor( pTeam ) 
                local rR, gG, bB = getRadarAreaColor( pArea2 ) 
                if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                        triggerClientEvent(player, 'friendly', player) 
                else 
                setRadarAreaFlashing( pArea2, true ) 
                triggerClientEvent(player, 'time', player) 
                pArea2Timer = setTimer( function() 
                setRadarAreaColor (pArea2, iR2, iG2, iB2, 100); 
                givePlayerMoney( p, 4000 ); 
                outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); 
                setRadarAreaFlashing( pArea2, false ) 
                end, 600000, 1 ) 
                end 
                end 
          else   
                triggerClientEvent(player, 'group', player) 
          end 
             
        end 
    ) 
  
    addEventHandler( 
        'onColShapeLeave', root,    
        function( p ) 
            if( source == pCuboid2 ) then 
                setRadarAreaFlashing( pArea2, false ) 
                triggerClientEvent(player, 'time2', player) 
                triggerClientEvent(player, 'friendly2', player) 
                if isTimer( pArea2Timer ) then 
                    killTimer( pArea2Timer ) 
                end 
            end 
        end 
    ) 
     
    ------------------------------------ 
     
        addEventHandler(  
        'onColShapeHit', root, 
        function( p ) 
          if (getPlayerGang( p )) then 
            if( source == pCuboid3 ) then 
                local pTeam = getPlayerGang( player ) 
                local iR, iG, iB = getTeamColor( pTeam ) 
                local rR, gG, bB = getRadarAreaColor( pArea3 ) 
                if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                    triggerClientEvent(player, 'friendly', player) 
                else 
                setRadarAreaFlashing( pArea3, true ) 
                triggerClientEvent(player, 'time', player) 
                pArea3Timer = setTimer( function() 
                setRadarAreaColor (pArea3, iR2, iG2, iB2, 100); 
                givePlayerMoney( p, 4000 ); 
                outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); 
                setRadarAreaFlashing( pArea3, false ) 
                end, 600000, 1 ) 
                end 
            end 
          else   
                triggerClientEvent(player, 'group', player) 
          end 
             
        end 
    ) 
  
    addEventHandler( 
        'onColShapeLeave', root,    
        function( p ) 
            if( source == pCuboid3 ) then 
                setRadarAreaFlashing( pArea3, false ) 
                triggerClientEvent(player, 'time2', player) 
                triggerClientEvent(player, 'friendly2', player) 
                if isTimer( pArea3Timer ) then 
                    killTimer( pArea3Timer ) 
                end 
            end 
        end 
    ) 
     
    ------------------------------------- 
     
            addEventHandler(  
        'onColShapeHit', root, 
        function( p ) 
          if (getPlayerGang( p )) then 
            if( source == pCuboid4 ) then 
                local pTeam = getPlayerGang( player ) 
                local iR, iG, iB = getTeamColor( pTeam ) 
                local rR, gG, bB = getRadarAreaColor( pArea4 ) 
                if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                    triggerClientEvent(player, 'friendly', player) 
                else 
                setRadarAreaFlashing( pArea4, true ) 
                triggerClientEvent(player, 'time', player) 
                pArea4Timer = setTimer( function() 
                setRadarAreaColor (pArea4, iR2, iG2, iB2, 100); 
                givePlayerMoney( p, 4000 ); 
                outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); 
                setRadarAreaFlashing( pArea4, false ) 
                end, 600000, 1 ) 
                end 
            end 
          else   
                triggerClientEvent(player, 'group', player) 
          end 
             
        end 
    ) 
  
    addEventHandler( 
        'onColShapeLeave', root,    
        function( p ) 
            if( source == pCuboid4 ) then 
                setRadarAreaFlashing( pArea4, false ) 
                triggerClientEvent(player, 'time2', player) 
                triggerClientEvent(player, 'friendly2', player) 
                if isTimer( pArea3Timer ) then 
                    killTimer( pArea3Timer ) 
                end 
            end 
        end 
    ) 
     
    ----------------------------------- 
     
                addEventHandler(  
        'onColShapeHit', root, 
        function( p ) 
          if (getPlayerGang( p )) then 
            if( source == pCuboid5 ) then 
                local pTeam = getPlayerGang( player ) 
                local iR, iG, iB = getTeamColor( pTeam ) 
                local rR, gG, bB = getRadarAreaColor( pArea5 ) 
                if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                    triggerClientEvent(player, 'friendly', player) 
                else 
                setRadarAreaFlashing( pArea5, true ) 
                triggerClientEvent(player, 'time', player) 
                pArea5Timer = setTimer( function() 
                setRadarAreaColor (pArea5, iR2, iG2, iB2, 100); 
                givePlayerMoney( p, 4000 ); 
                outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); 
                setRadarAreaFlashing( pArea5, false ) 
                end, 600000, 1 ) 
                end 
            end 
          else   
                triggerClientEvent(player, 'group', player) 
          end 
             
        end 
    ) 
  
    addEventHandler( 
        'onColShapeLeave', root,    
        function( p ) 
            if( source == pCuboid5 ) then 
                setRadarAreaFlashing( pArea5, false ) 
                triggerClientEvent(player, 'time2', player) 
                triggerClientEvent(player, 'friendly2', player) 
                if isTimer( pArea5Timer ) then 
                    killTimer( pArea5Timer ) 
                end 
            end 
        end 
    ) 
  

I want to change the Teams For gang ,They are the resource gang_system of castillo https://community.multitheftauto.com/ind ... ls&id=1514

Link to comment
    local pArea     = createRadarArea( 2130, 630, 200, 100, 255, 255, 255, 125 ) 
    local pArea2     = createRadarArea( 2488.8793945313, 680.78289794922, 250, 130, 255, 255, 255, 125 ) 
    local pCuboid   = createColCuboid( 2133.1950683594, 633.66455078125, 10, 197.5, 92, 30 ) 
    local pCuboid2   = createColCuboid( 2486.5935058594, 678.20172119141, 9.5689830780029,  245, 133, 30 ) 
    local pArea3     = createRadarArea( 1858, 623, 140, 165, 255, 255, 255, 125 ) 
    local pCuboid3   = createColCuboid( 1856.2864990234, 627.07629394531, 9,  138.25, 152.75, 30 ) 
    local pArea4     = createRadarArea( 1577, 663, 180, 130, 255, 255, 255, 125 ) 
    local pCuboid4   = createColCuboid( 1576.8956298828, 662.84362792969, 9.671875, 181, 120.5, 30 ) 
    local pArea5     = createRadarArea( 2778, 834, 110, 190, 255, 255, 255, 125 ) 
    local pCuboid5   = createColCuboid( 2777.4248046875, 833.88018798828, 9.6484375,  113.5, 188, 30 ) 
      
addEventHandler("onResourceStart", resourceRoot, 
function() 
    outputDebugString("|~| Turf system by manve1 |~| Has been turned on! |~| This system was downloaded from MTA Community. |~|", 3, 0, 255, 0) 
end 
) 
  
--[[addEventHandler("onResourceStop", resourceRoot, 
function() 
    outputDebugString("|~| Turf system by manve1 |~| Has been turned off! |~| This system was downloaded from MTA Community. |~|", 3, 0, 255, 0) 
  
    saveS = xmlLoadFile( 'file_saves.xml' ) 
    local save_info = xmlFindChild(saveS, 'turf', 0) 
    xmlNodeSetAttribute( save_info, 'saved', 'nothing new' ) 
  
end 
)]] 
            addEventHandler( 
                'onColShapeHit', pCuboid, 
                function( player ) 
                    if (getPlayerGang( player )) then 
                        local pGang = exports [ "gang_system" ]:getPlayerGang ( player ) 
                        local iR, iG, iB = exports [ "gang_system" ]:getGangColor ( pGang ) 
                        local rR, gG, bB = getRadarAreaColor( pArea ) 
                        if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                            triggerClientEvent(player, 'friendly', player) 
                        else 
                        setRadarAreaFlashing( pArea, true ) 
                        triggerClientEvent(player, 'time', player) 
                        triggerClientEvent(player, 'countdown', player) 
                        pArea1Timer = setTimer( function() 
                        setRadarAreaColor (pArea, iR, iG, iB, 100); 
                        givePlayerMoney( player, 4000 ); 
                        outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", player, 0, 255, 0, true ); 
                        setRadarAreaFlashing( pArea, false ) 
                        end, 6000, 1 ) 
                        end 
                    else 
                        triggerClientEvent(player, 'group', player) 
                    end 
                end 
        ) 
  
    addEventHandler( 
        'onColShapeLeave', root,   
        function( player ) 
            if( source == pCuboid ) then 
                setRadarAreaFlashing( pArea, false ) 
                triggerClientEvent(player, 'time2', player) 
                triggerClientEvent(player, 'friendly2', player) 
                if isTimer( pArea1Timer ) then 
                    killTimer( pArea1Timer ) 
                end 
            end 
        end 
    ) 
    
    ----------------------------- 
    addEventHandler( 
        'onColShapeHit', root, 
        function( p ) 
          if (getPlayerGang( p )) then 
            if( source == pCuboid2 ) then 
                local pGang = exports [ "gang_system" ]:getPlayerGang ( p ) 
                local iR, iG, iB = exports [ "gang_system" ]:getGangColor ( pGang ) 
                local rR, gG, bB = getRadarAreaColor( pArea2 ) 
                if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                        triggerClientEvent(p, 'friendly', p) 
                else 
                setRadarAreaFlashing( pArea2, true ) 
                triggerClientEvent(p, 'time', p) 
                pArea2Timer = setTimer( function() 
                setRadarAreaColor (pArea2, iR2, iG2, iB2, 100); 
                givePlayerMoney( p, 4000 ); 
                outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); 
                setRadarAreaFlashing( pArea2, false ) 
                end, 600000, 1 ) 
                end 
                end 
          else  
                triggerClientEvent(p, 'group', p) 
          end 
            
        end 
    ) 
  
    addEventHandler( 
        'onColShapeLeave', root,   
        function( p ) 
            if( source == pCuboid2 ) then 
                setRadarAreaFlashing( pArea2, false ) 
                triggerClientEvent(p, 'time2', p) 
                triggerClientEvent(p, 'friendly2', p) 
                if isTimer( pArea2Timer ) then 
                    killTimer( pArea2Timer ) 
                end 
            end 
        end 
    ) 
    
    ------------------------------------ 
    
        addEventHandler( 
        'onColShapeHit', root, 
        function( p ) 
          if (getPlayerGang( p )) then 
            if( source == pCuboid3 ) then 
                local pGang = exports [ "gang_system" ]:getPlayerGang ( p ) 
                local iR, iG, iB = exports [ "gang_system" ]:getGangColor ( pGang ) 
                local rR, gG, bB = getRadarAreaColor( pArea3 ) 
                if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                    triggerClientEvent(p, 'friendly', p) 
                else 
                setRadarAreaFlashing( pArea3, true ) 
                triggerClientEvent(p, 'time', p) 
                pArea3Timer = setTimer( function() 
                setRadarAreaColor (pArea3, iR2, iG2, iB2, 100); 
                givePlayerMoney( p, 4000 ); 
                outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); 
                setRadarAreaFlashing( pArea3, false ) 
                end, 600000, 1 ) 
                end 
            end 
          else  
                triggerClientEvent(p, 'group', p) 
          end 
            
        end 
    ) 
  
    addEventHandler( 
        'onColShapeLeave', root,   
        function( p ) 
            if( source == pCuboid3 ) then 
                setRadarAreaFlashing( pArea3, false ) 
                triggerClientEvent(p, 'time2', p) 
                triggerClientEvent(p, 'friendly2', p) 
                if isTimer( pArea3Timer ) then 
                    killTimer( pArea3Timer ) 
                end 
            end 
        end 
    ) 
    
    ------------------------------------- 
    
            addEventHandler( 
        'onColShapeHit', root, 
        function( p ) 
          if (getPlayerGang( p )) then 
            if( source == pCuboid4 ) then 
                local pGang = exports [ "gang_system" ]:getPlayerGang ( p ) 
                local iR, iG, iB = exports [ "gang_system" ]:getGangColor ( pGang ) 
                local rR, gG, bB = getRadarAreaColor( pArea4 ) 
                if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                    triggerClientEvent(p, 'friendly', p) 
                else 
                setRadarAreaFlashing( pArea4, true ) 
                triggerClientEvent(p, 'time', p) 
                pArea4Timer = setTimer( function() 
                setRadarAreaColor (pArea4, iR2, iG2, iB2, 100); 
                givePlayerMoney( p, 4000 ); 
                outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); 
                setRadarAreaFlashing( pArea4, false ) 
                end, 600000, 1 ) 
                end 
            end 
          else  
                triggerClientEvent(p, 'group', p) 
          end 
            
        end 
    ) 
  
    addEventHandler( 
        'onColShapeLeave', root,   
        function( p ) 
            if( source == pCuboid4 ) then 
                setRadarAreaFlashing( pArea4, false ) 
                triggerClientEvent(p, 'time2', p) 
                triggerClientEvent(p, 'friendly2', p) 
                if isTimer( pArea3Timer ) then 
                    killTimer( pArea3Timer ) 
                end 
            end 
        end 
    ) 
    
    ----------------------------------- 
    
                addEventHandler( 
        'onColShapeHit', root, 
        function( p ) 
          if (getPlayerGang( p )) then 
            if( source == pCuboid5 ) then 
                local pGang = exports [ "gang_system" ]:getPlayerGang ( p ) 
                local iR, iG, iB = exports [ "gang_system" ]:getGangColor ( pGang ) 
                local rR, gG, bB = getRadarAreaColor( pArea5 ) 
                if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 
                    triggerClientEvent(p, 'friendly', p) 
                else 
                setRadarAreaFlashing( pArea5, true ) 
                triggerClientEvent(p, 'time', p) 
                pArea5Timer = setTimer( function() 
                setRadarAreaColor (pArea5, iR2, iG2, iB2, 100); 
                givePlayerMoney( p, 4000 ); 
                outputChatBox( "Congratulations, #FFFF00 you have taken the turf!", p, 0, 255, 0, true ); 
                setRadarAreaFlashing( pArea5, false ) 
                end, 600000, 1 ) 
                end 
            end 
          else  
                triggerClientEvent(p, 'group', p) 
          end 
            
        end 
    ) 
  
    addEventHandler( 
        'onColShapeLeave', root,   
        function( p ) 
            if( source == pCuboid5 ) then 
                setRadarAreaFlashing( pArea5, false ) 
                triggerClientEvent(p, 'time2', p) 
                triggerClientEvent(p, 'friendly2', p) 
                if isTimer( pArea5Timer ) then 
                    killTimer( pArea5Timer ) 
                end 
            end 
        end 
    ) 
  

Link to comment
  • 2 months later...

Line 34 and 35 :

local rR, gG, bB = getRadarAreaColor( pArea ) 
                        if ( iR == rR ) and ( iG == gG ) and ( iB == bB ) then 

line 42:

getRadarAreaColor (pArea, iR, iG, iB, 100); 

change :

setRadarAreaColor (pArea, rR, gG, bB, 100); 

it change is good?

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