Advertisement
Guest User

Untitled

a guest
Sep 21st, 2014
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. do
  2.     local dontUse = {'weapons.bombs.RN-24', 'weapons.bombs.RN-28'}
  3.     local function shot(event)
  4.         if event.id == world.event.S_EVENT_SHOT and event.initiator then and Unit.getPlayerName(event.initiator) then -- if player
  5.             if event.weapon then
  6.                 for i = 1, #dontUse do
  7.                     if event.weapon then
  8.                         if dontUse[i] == Object.getTypeName(event.weapon) then
  9.                             local name = Weapon.getDesc(event.weapon).displayName
  10.                             Object.destroy(event.weapon)
  11.                             trigger.action.outText(tostring(Unit.getPlayerName(event.initiator)) .. ' has launched a ' .. name .. '. This weapon is not allowed in this mission.', 10)
  12.                             break
  13.                         end
  14.                     end
  15.                 end
  16.             end        
  17.         end    
  18.     end
  19.     world.addEventHandler({id = 1337, f = shot, onEvent = function(self, event) self.f(event)end})
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement