Jump to content

Help please with disabling grenades and satchels in LS


DonOmar

Recommended Posts

Here is an example made by Tails:

local bannedIds = { 
    [16] = true, 
    [17] = true, 
    [18] = true, 
    [39] = true, 
    [40] = true, 
} 
  
local hillAreaLS = createColRectangle (  -905.5929, -2933.0986, 4000, 3500 ) 
local hillAreaSF =  createColRectangle( -2994.09448,-1378.01746,2000,4900) 
local hillAreaLV =  createColRectangle   (-905.5929,602.33,4000,2500) 
  
function forcePlayerWeapon(prevId, curId) 
    if isElementWithinColShape(source, hillAreaLS) then 
        if bannedIds[curId] then 
            outputChatBox("blocked explosives") 
            setPedWeaponSlot(source, 0) 
        end 
    end 
end 
addEventHandler("onPlayerWeaponSwitch", root, forcePlayerWeapon) 

Edited by Guest
Link to comment
idk how to create it iam a noob scripter xD

here is an ex made by tails:

local bannedIds = {     --- weapon IDs 
    [16] = true, 
    [17] = true, 
    [18] = true, 
    [39] = true, 
    [40] = true, 
} 
  
local hillAreaLS = createColRectangle (  -905.5929, -2933.0986, 4000, 3500 ) 
  
function forcePlayerWeapon(prevId, curId) 
    if isElementWithinColShape(source, hillAreaLS) then 
        if bannedIds[curId] then 
            outputChatBox("blocked explosives") 
            setPedWeaponSlot(source, 0) 
        end 
    end 
end 
addEventHandler("onPlayerWeaponSwitch", root, forcePlayerWeapon) 

Link to comment

anyways here( it only allows you to use explosives in las venturas):

local bannedIds = { 
    [16] = true, 
    [17] = true, 
    [18] = true, 
    [39] = true, 
    [40] = true, 
} 
  
local colshape = createColRectangle ( 861.20703125, 600, 2100, 2400 ) 
redzonemaparea = createRadarArea (861.20703125, 600, 2100, 2400, 255, 0, 0, 120) 
  
function colshapehit(player) 
if (getElementType(player) == "player" ) then 
outputChatBox("You've Entered/Left Las Venturas!", player, 255, 0, 0) 
end 
end 
addEventHandler("onColShapeHit", colshape, colshapehit) 
addEventHandler("onColShapeLeave", colshape, colshapehit) 
  
function forcePlayerWeapon(prevId, curId) 
    if not isElementWithinColShape(source, colshape) then 
        if bannedIds[curId] then 
            outputChatBox("You can only use explosives in Las venturas!") 
            setPedWeaponSlot(source, 0) 
        end 
    end 
end 
addEventHandler("onPlayerWeaponSwitch", root, forcePlayerWeapon) 

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