Jump to content

i need your help about just criminals can turf


LilDawage

Recommended Posts

 

function onColShapeHit ( player ) 
  
     if ( player and isElement ( player ) and getElementType ( player ) == "player" and not isPedInVehicle ( player ) ) then
        
        local gang = exports.UGNGroups:getPlayerGroup ( player )
        
        triggerClientEvent ( player, "UGNTurfs:onClientEnterTurfArea", player, turfLocs [ id ] )
        if ( not gang ) then
            return exports.UGNMessages:sendClientMessage ( "You're not in a gang, you cannot turf.", player, 255, 255, 0 )
        end

        local id = tonumber ( getElementData ( source, "UGNTurf:TurfId" ) )
        
        if ( turfLocs[id].owner == gang ) then
            return
        end

        if ( turfLocs[id].attackers and turfLocs[id].attackers ~= gang ) then
            return exports.UGNMessages:sendClientMessage ( "The "..tostring(turfLocs[id].attackers).." gang is already trying to take this turf. Try again later.", player, 255, 0, 0 )
        end

        if ( not turfLocs[id].attackers ) then
            exports.UGNMessages:sendClientMessage ( "You have started to prepare a turf war. Find cover, call backup, and wait for it to begin.", player, 255, 255, 0 )
            local x, y, z = getElementPosition ( source )
            exports.UGNGroups:outputGroupMessage ( getPlayerName ( player ).." is preparing a turf war with "..tostring(turfLocs[id].owner).." in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,true).."! Get there to help him, the war will start in 2 minutes!", gang, 255, 255, 0 )
            setRadarAreaFlashing ( turfLocs[id].radar, true )
            turfLocs[id].attackers = gang
            turfLocs[id].attackProg = 0
            turfLocs[id].prepProg = 0
            setElementData ( turfLocs[id].col, "UGNTurf:TurffingTable", turfLocs [ id ] )
        end
    end

end

 

 

how to Put just Criminals Team can Turf here !! help guys

Edited by NightStar
  • Like 1
Link to comment
4 minutes ago, CodyL said:

Put this in proper lua format and I'll help.

Function onColShapeHit ( player ) 
  
     if ( player and isElement ( player ) and getElementType ( player ) == "player" and not isPedInVehicle ( player ) ) then
        
        local gang = exports.NGGroups:getPlayerGroup ( player )
        
        triggerClientEvent ( player, "UGNTurfs:onClientEnterTurfArea", player, turfLocs [ id ] )
        if ( not gang ) then
            return exports.NGMessages:sendClientMessage ( "You're not in a gang, you cannot turf.", player, 255, 255, 0 )
        end

        local id = tonumber ( getElementData ( source, "UGNTurf:TurfId" ) )
        
        if ( turfLocs[id].owner == gang ) then
            return
        end

        if ( turfLocs[id].attackers and turfLocs[id].attackers ~= gang ) then
            return exports.UGNMessages:sendClientMessage ( "The "..tostring(turfLocs[id].attackers).." gang is already trying to take this turf. Try again later.", player, 255, 0, 0 )
        end

        if ( not turfLocs[id].attackers ) then
            exports.UGNMessages:sendClientMessage ( "You have started to prepare a turf war. Find cover, call backup, and wait for it to begin.", player, 255, 255, 0 )
            local x, y, z = getElementPosition ( source )
            exports.UGNGroups:outputGroupMessage ( getPlayerName ( player ).." is preparing a turf war with "..tostring(turfLocs[id].owner).." in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,true).."! Get there to help him, the war will start in 2 minutes!", gang, 255, 255, 0 )
            setRadarAreaFlashing ( turfLocs[id].radar, true )
            turfLocs[id].attackers = gang
            turfLocs[id].attackProg = 0
            turfLocs[id].prepProg = 0
            setElementData ( turfLocs[id].col, "UGNTurf:TurffingTable", turfLocs [ id ] )
        end
    end

end

 

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