Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. local bannedIds = {
  2. [16] = true,
  3. [17] = true,
  4. [18] = true,
  5. [39] = true,
  6. [40] = true,
  7. }
  8.  
  9. local hillAreaLS = createColRectangle ( -905.5929, -2933.0986, 4000, 3500 )
  10. local hillAreaSF = createColRectangle( -2994.09448,-1378.01746,2000,4900)
  11. local hillAreaLV = createColRectangle (-905.5929,602.33,4000,2500)
  12.  
  13. function forcePlayerWeaponSF(prevId, curId)
  14. if isElementWithinColShape(source, hillAreaSF) then
  15. if bannedIds[curId] then
  16. setPedWeaponSlot(source, 0)
  17. end
  18. end
  19. end
  20. addEventHandler("onPlayerWeaponSwitch", root, forcePlayerWeaponSF)
  21.  
  22. function forcePlayerWeaponLS(prevId, curId)
  23. if isElementWithinColShape(source, hillAreaLS) then
  24. if bannedIds[curId] then
  25. setPedWeaponSlot(source, 0)
  26. end
  27. end
  28. end
  29. addEventHandler("onPlayerWeaponSwitch", root, forcePlayerWeaponLS)
  30.  
  31.  
  32. function welcomePlayer(hitElem, matchingDim)
  33. if getElementType(hitElem) == "player" and matchingDim then
  34. if source == hillAreaLS then
  35. outputChatBox("Welcome to Los Santos", hitElem)
  36. elseif source == hillAreaSF then
  37. outputChatBox("Welcome to San Fierro", hitElem)
  38. elseif source == hillAreaLV then
  39. outputChatBox("Welcome to Las Venturas", hitElem)
  40.  
  41. local curId = getPedWeapon(hitElem)
  42. if bannedIds[curId] then
  43. setPedWeaponSlot(hitElem, 0) -- Switch player weapon if they have an explosive equipped
  44. end
  45. end
  46. end
  47. end
  48. addEventHandler("onColShapeHit", resourceRoot, welcomePlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement