I need something like PlayerSendCancel "You need 100 level":
and the next one :
if dont have local level=200
or
if getPlayerSkill(cid,0) >= 70
dont exchaust this item
Lua:
function onUse(cid, item, frompos, item2, topos)
local storage = 90022 -- Make sure to select non-used storage.
local cooldown = 5 -- in seconds.
local level = 100
if getPlayerStorageValue(cid, storage) <= os.time() then
setPlayerStorageValue(cid, storage, os.time() + cooldown)
if getPlayerSkill(cid,0) >= 50 then
if item.uid == 10122 and getPlayerLevel(cid) >= level then
local tekst = "You are teleported."
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE , tekst)
pos = {x=1025, y=1154, z=10}
doTeleportThing(cid, pos)
doSendMagicEffect(pos, 32)
else
return 0
end
else
doPlayerSendTextMessage(cid, 22, "Sorry, you need 50 Strength")
doSendMagicEffect(getPlayerPosition(cid),2)
end
else
doPlayerSendCancel(cid, "Can only be executed once every " .. cooldown .. " seconds. Remaining cooldown: " .. getPlayerStorageValue(cid, storage) - os.time())
doSendMagicEffect(getPlayerPosition(cid),2)
end
return 1
end
and the next one :
if dont have local level=200
or
if getPlayerSkill(cid,0) >= 70
dont exchaust this item
Lua:
local scroll = 11585
local temple = {x=1022, y=1023, z=7}
local level = 200
function onUse(cid, item, frompos, item2, topos)
local storage = 90010 -- Make sure to select non-used storage.
local cooldown = 3600 -- in seconds.
if getPlayerStorageValue(cid, storage) <= os.time() then
setPlayerStorageValue(cid, storage, os.time() + cooldown)
if getPlayerSkill(cid,0) >= 70 then
if item.itemid == scroll and getPlayerLevel(cid) >= level then
doTeleportThing(cid, temple, TRUE)
doSendMagicEffect(temple,3)
doSendAnimatedText(temple, "Temple!", 12)
return 0
end
else
doPlayerSendCancel(cid, "Sorry, you need 200lvl and 70 Strength")
doSendMagicEffect(getPlayerPosition(cid),2)
end
else
doPlayerSendCancel(cid, "Can only be executed once every " .. cooldown .. " seconds. Remaining cooldown: " .. getPlayerStorageValue(cid, storage) - os.time())
doSendMagicEffect(getPlayerPosition(cid),2)
end
return 1
end