Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local events = {
- ["dota"] = {tp_pos = {x = 160, y = 54, z = 7}, event_pos = {x = 720, y = 30, z = 7}, duration = 5},
- ["ctf"] = {tp_pos = {x = 230, y = 150, z = 7}, event_pos = {x = 210, y = 180, z = 6}, duration = 1},
- }
- local function remover(pos, param)
- local tp = getTileItemById(pos, 1347).uid
- if tp > 100 then
- doBroadcastMessage("O evento ".. param .." foi fechado!")
- doRemoveItem(tp, 1)
- end
- return true
- end
- function onSay(cid, words, param)
- local event = events[param:lower()]
- if not event then
- local str = "Eventos disponÃveis:"
- for i, _ in pairs(events) do
- str = str .. "\n".. string.upper(i:sub(1, 1)) .. i:sub(2, #i)
- end
- return doPlayerPopupFYI(cid, str)
- end
- addEvent(remover, event.duration * 60000, event.tp_pos, param)
- doBroadcastMessage("[".. getCreatureName(cid) .. "]: O evento ".. param .. " está aberto por ".. event.duration .. " minutos!")
- doCreateTeleport(1387, event.event_pos, event.tp_pos)
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment