local cfg = {
tp = {x= 995, y= 1024, z= 7}, -- where tp is created
tpto = {x= 1356, y= 921, z= 13}, -- where it tp's to
messagecreate = 'Message Here', -- broadcast message on create
messageremove = 'Messag remove here', -- broadcast message on remove
minutes = 2 -- amount of minutes to wait
}
function onSay(cid, words, param)
if getGlobalStorageValue(3330) ~= 1 then
doCreateTeleport(1387, cfg.tpto, cfg.tp)
doBroadcastMessage(cfg.messagecreate)
addEvent(onRemove, cfg.minutes * 60 * 1000)
setGlobalStorageValue(3330, 1)
else
doPlayerSendCancel(cid, "The teleport is already created! You have to wait " .. minutes .. " minutes to create it again!")
end
return true
end
function onRemove()
doRemoveItem(getTileItemById(cfg.tp, 1387).uid)
doSendMagicEffect(cfg.tp, CONST_ME_POFF)
doBroadcastMessage(cfg.messageremove)
setGlobalStorageValue(3330, 0)
return true
end