local s = 1234 -- storage
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, s) >= 1 then
doPlayerSendCancel(cid, "Sorry, you've already used this item")
else
setPlayerStorageValue(cid, s, 1)
end
return TRUE
end
local s = 45000 -- storage
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 45000) >= 1 then
doPlayerSendCancel(cid, "Sorry, you've already used this item")
else
setPlayerStorageValue(cid, 45000, 1)
end
return TRUE
end
local s = 4500 -- storage
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, s) >= 1 then
doPlayerSendCancel(cid, "Sorry, you've already used this item")
else
setPlayerStorageValue(cid, s, 1)
end
return TRUE
end
<action itemid="5785" event="script" value="other/tpdoll.lua"/>
local teleport = {
['depot'] = {x=1032, y=1002, z=7},
['temple'] = {x=1000, y=995, z=7},
['monster tele'] = {x=830, y=826, z=7},
['quests'] = {x=830, y=826, z=7},
['quest tele'] = {x=830, y=826, z=7},
['trainers'] = {x=994, y=865, z=7},
}
function onSay(cid, words, param, channel)
if (getPlayerStorageValue(cid, 45000) == 1) then
local s = teleport[param:lower()]
if (s) then
if not(isPlayerPzLocked(cid)) then
doTeleportThing(cid, s)
doSendMagicEffect(s, CONST_ME_TELEPORT)
else
doPlayerSendCancel(cid, 'You are PZlocked.')
end
else
doPlayerSendCancel(cid, 'Destination doesn\'t exist.')
end
return true
end
doPlayerSendCancel(cid, 'You haven\'t bought this talkaction.')
return false
end