Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modaldialog = {
- title = "Warp gate",
- message = "Select place to warp:",
- buttons = {
- {id = 1, value = "Warp"},
- {id = 2, value = "Cancel"},
- {id = 3, value = "Info"},
- },
- choices = {},
- buttonEnter = 1,
- buttonEscape = 2,
- popup = false
- }
- function callback(cid, button, choice)
- if button == 3 then
- local gate = warp:getWarpById(choice)
- doPlayerPopupFYI(cid, string.format("Info about %s's gate:\n\nLevel need: %d\nMana need: %d\nCan warp: yes", gate.name, gate.level, gate.mana))
- elseif button == 1 then
- if choice >= 1 then
- local gate = warp:getWarpById(choice)
- gate:Warp(cid)
- end
- return true
- end
- return true
- end
- for i, v in pairs(warp:getGates()) do
- if i >= 1 then
- table.insert(modaldialog.choices, {id = i, value = v.name})
- end
- end
- function onStepIn(cid)
- addDialog(modaldialog, 1000, cid, callback)
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement