MaXwEllDeN

Untitled

May 25th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.95 KB | None | 0 0
  1. local events = {
  2.     ["dota"] = {tp_pos = {x = 160, y = 54, z = 7}, event_pos = {x = 720, y = 30, z = 7}, duration = 5},
  3.     ["ctf"] = {tp_pos = {x = 230, y = 150, z = 7}, event_pos = {x = 210, y = 180, z = 6}, duration = 1},
  4. }
  5.  
  6. local function remover(pos, param)
  7.     local tp = getTileItemById(pos, 1347).uid
  8.  
  9.     if tp > 100 then
  10.         doBroadcastMessage("O evento ".. param .." foi fechado!")
  11.         doRemoveItem(tp, 1)
  12.     end
  13.  
  14.     return true
  15. end
  16.  
  17. function onSay(cid, words, param)
  18.     local event = events[param:lower()]
  19.  
  20.     if not event then
  21.         local str = "Eventos disponíveis:"
  22.  
  23.         for i, _ in pairs(events) do
  24.             str = str .. "\n".. string.upper(i:sub(1, 1)) .. i:sub(2, #i)
  25.         end
  26.  
  27.         return doPlayerPopupFYI(cid, str)
  28.     end
  29.  
  30.     addEvent(remover, event.duration * 60000, event.tp_pos, param)
  31.     doBroadcastMessage("[".. getCreatureName(cid) .. "]: O evento ".. param .. " está aberto por ".. event.duration .. " minutos!")
  32.     doCreateTeleport(1387, event.event_pos, event.tp_pos)
  33.  
  34.     return true
  35. end
Advertisement
Add Comment
Please, Sign In to add comment