Jump to content

Weapons in greenzone


-Doc-

Recommended Posts

Here i scripted a code about what you're wanted for it's server side

so add a meta like that


Server.lua (Server side)

local GreenZone = createColRectangle ( ) --Put your Greenzone pos plus Size of it. Example:(x,z,255,130) 
    local Radar = createRadarArea () -- Put greenzone (pos plus Size,Color of Zone,Alpha) 
  
  
function zoneEnter ( thePlayer, matchingDimension ) 
      if matchingDimension and isElement(thePlayer) and getElementType(thePlayer) == "player" then 
         triggerClientEvent(thePlayer, "zoneEnter", thePlayer) 
         getPedWeapon(localPlayer) == 11 then 
         getPedWeapon(localPlayer) == 14 then 
         toggleControl ( thePlayer, "fire", false ) 
         toggleControl ( thePlayer, "next_weapon", false ) 
         toggleControl ( thePlayer, "previous_weapon", false ) 
          outputChatBox( "You've entered to the greenzone,you can use only Dildo and Flowers.",thePlayer, 255,0,0) 
      end 
  
    end 
    addEventHandler ( "onColShapeHit", GreenZone, zoneEnter ) 
      
function zoneExit ( thePlayer, matchingDimension ) 
        if matchingDimension and isElement(thePlayer) and getElementType(thePlayer) == "player" then 
         triggerClientEvent(thePlayer, "zoneExit", thePlayer) 
         toggleControl ( thePlayer, "fire", true ) 
         toggleControl ( thePlayer, "next_weapon", true ) 
         toggleControl ( thePlayer, "previous_weapon", true ) 
       outputChatBox ( "You've left the greenzone,now all your ammos will works.",thePlayer,255,0,0) 
        end 
    end 
    addEventHandler ( "onColShapeLeave", GreenZone,zoneExit ) 

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