Jump to content

Anti shoot zone


Captain Cody

Recommended Posts

I created a script but it does nothing and nothing apears in Debugscript

carshop = createColRectangle ( -2001.0808105469, 218.60647583008, 114, 98 ) 
  
addEventHandler( "onColShapeHit", carshop, function(hitPlayer,thePlayer) 
if getElementType(hitPlayer)=="player" then 
    triggerClientEvent(thePlayer, "zoneEnter", thePlayer) 
    toggleControl ( thePlayer, "fire", false ) 
    toggleControl ( thePlayer, "next_weapon", false ) 
    toggleControl ( thePlayer, "previous_weapon", false ) 
    setPedWeaponSlot ( thePlayer, 0 ) 
    toggleControl ( thePlayer, "aim_weapon", false ) 
    toggleControl ( thePlayer, "vehicle_fire", false ) 
    toggleControl ( thePlayer, "vehicle_secondary_fire", false ) 
   end 
end) 
  
addEventHandler( "onColShapeLeave", carshop,function(hitPlayer,thePlayer) 
if getElementType(hitPlayer)=="player"then 
    triggerClientEvent(thePlayer, "zoneExit", thePlayer) 
    toggleControl ( thePlayer, "fire", true ) 
    toggleControl ( thePlayer, "next_weapon", true ) 
    toggleControl ( thePlayer, "previous_weapon", true ) 
    toggleControl ( thePlayer, "aim_weapon", true ) 
    toggleControl ( thePlayer, "vehicle_fire", true ) 
    toggleControl ( thePlayer, "vehicle_secondary_fire", true ) 
    addCommandHandler( "devmode", 
function () 
    setDevelopmentMode ( true ) 
end 
) 
   end 
end) 

Link to comment

Isn't tested.

greenzoneEnter = createColRectangle ( -1957.9560546875, 274.91864013672, 15, 15 ) 
  
addEventHandler( "onColShapeHit", greenzoneEnter, function(hitPlayer) 
if getElementType(hitPlayer)=="player" then 
    triggerClientEvent(hitPlayer, "zoneEnter", hitPlayer) 
    toggleControl ( hitPlayer, "fire", false ) 
    toggleControl ( hitPlayer "next_weapon", false ) 
    toggleControl ( hitPlayer, "previous_weapon", false ) 
    setPedWeaponSlot ( hitPlayer, 0 ) 
    toggleControl ( hitPlayer, "aim_weapon", false ) 
    toggleControl ( hitPlayer, "vehicle_fire", false ) 
    toggleControl ( hitPlayer, "vehicle_secondary_fire", false ) 
   end 
end) 
  
addEventHandler( "onColShapeLeave", greenzoneEnter,function(hitPlayer) 
if getElementType(hitPlayer)=="player" then 
    triggerClientEvent(hitPlayer, "zoneExit", hitPlayer 
    toggleControl ( hitPlayer, "fire", true ) 
    toggleControl ( hitPlayer, "next_weapon", true ) 
    toggleControl ( hitPlayer, "previous_weapon", true ) 
    toggleControl ( hitPlayer, "aim_weapon", true ) 
    toggleControl ( hitPlayer, "vehicle_fire", true ) 
    toggleControl ( hitPlayer, "vehicle_secondary_fire", true ) 
   end 
end) 

Link to comment
  
greenzoneEnter = createColRectangle ( -1957.9560546875, 274.91864013672, 15, 15 ) 
  
addEventHandler( "onColShapeHit", greenzoneEnter, function(hitPlayer) 
if getElementType(hitPlayer)=="player" then 
    triggerClientEvent(hitPlayer, "zoneEnter", hitPlayer) 
    toggleControl ( hitPlayer, "fire", false ) 
    toggleControl ( hitPlayer "next_weapon", false ) 
    toggleControl ( hitPlayer, "previous_weapon", false ) 
    setPedWeaponSlot ( hitPlayer, 0 ) 
    toggleControl ( hitPlayer, "aim_weapon", false ) 
    toggleControl ( hitPlayer, "vehicle_fire", false ) 
    toggleControl ( hitPlayer, "vehicle_secondary_fire", false ) 
   end 
end) 
  
addEventHandler( "onColShapeLeave", greenzoneEnter,function(hitPlayer) 
if getElementType(hitPlayer)=="player" then 
    triggerClientEvent(hitPlayer, "zoneExit", hitPlayer) 
    toggleControl ( hitPlayer, "fire", true ) 
    toggleControl ( hitPlayer, "next_weapon", true ) 
    toggleControl ( hitPlayer, "previous_weapon", true ) 
    toggleControl ( hitPlayer, "aim_weapon", true ) 
    toggleControl ( hitPlayer, "vehicle_fire", true ) 
    toggleControl ( hitPlayer, "vehicle_secondary_fire", true ) 
   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...