Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 forcePlayerWeaponSF(prevId, curId)
- if isElementWithinColShape(source, hillAreaSF) then
- if bannedIds[curId] then
- setPedWeaponSlot(source, 0)
- end
- end
- end
- addEventHandler("onPlayerWeaponSwitch", root, forcePlayerWeaponSF)
- function forcePlayerWeaponLS(prevId, curId)
- if isElementWithinColShape(source, hillAreaLS) then
- if bannedIds[curId] then
- setPedWeaponSlot(source, 0)
- end
- end
- end
- addEventHandler("onPlayerWeaponSwitch", root, forcePlayerWeaponLS)
- function welcomePlayer(hitElem, matchingDim)
- if getElementType(hitElem) == "player" and matchingDim then
- if source == hillAreaLS then
- outputChatBox("Welcome to Los Santos", hitElem)
- elseif source == hillAreaSF then
- outputChatBox("Welcome to San Fierro", hitElem)
- elseif source == hillAreaLV then
- outputChatBox("Welcome to Las Venturas", hitElem)
- local curId = getPedWeapon(hitElem)
- if bannedIds[curId] then
- setPedWeaponSlot(hitElem, 0) -- Switch player weapon if they have an explosive equipped
- end
- end
- end
- end
- addEventHandler("onColShapeHit", resourceRoot, welcomePlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement