Hi, i need help with set special area, when target is in {from = {x = 100, y = 100, z = 7}, to = {x = 200, y = 200, z = 7}}
then we cant teleport to him with this talkaction: doPlayerSendCancel(cid, "You cant teleport to this target.")
But i cant add this, idk why, can you help me? ( i need this because quests and players cant teleport for quests.)
@Xikini - can you?
then we cant teleport to him with this talkaction: doPlayerSendCancel(cid, "You cant teleport to this target.")
But i cant add this, idk why, can you help me? ( i need this because quests and players cant teleport for quests.)
@Xikini - can you?
Code:
function onSay(cid, words, param)
local mana = getCreatureMaxMana(cid)/100*80
local pid = 0
pid = getPlayerByNameWildcard(param)
if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then
doPlayerSendCancel(cid, "Player " .. param .. " is not currently online.")
return true
end
if(getCreatureMana(pid) >= (getCreatureMaxMana(pid)/2)) then
if(getCreatureMana(cid) >= (getCreatureMaxMana(cid)/100*80)) then
if(not(isPlayerPzLocked(cid))) then
if(not(getTilePzInfo(getCreaturePosition(cid)))) then
if(not(getTilePzInfo(getCreaturePosition(pid)))) then
doTeleportThing(cid, getCreaturePosition(pid))
doPlayerAddMana(cid, -mana)
else
doPlayerSendCancel(cid, "Your target is in Protection Zone.")
end
else
doPlayerSendCancel(cid, "You are in Protection Zone.")
end
else
doPlayerSendCancel(cid, "You are in battle.")
end
else
doPlayerSendCancel(cid, "You do not have enough mana.")
end
else
doPlayerSendCancel(cid, "Your target do not have enough mana.")
end
return true
end