function onSay(cid, words, param, channel)
local destinations = {
["1"] = {p = {x=501, y=515, z=7}, l = 10, c = 100, v = 12345},
["2"] = {p = {x=500, y=439, z=7}, l = 20, c = 200, v = 67891},
["3"] = {p = {x=761, y=657, z=10}, l = 50, c = 300, v = 23456}
}
local tp = destinations[param]
if(param == "") then
doPlayerSendCancel(cid, "Command param required.")
return true
end
if(getPlayerLevel(cid) < tp.l) then
doPlayerSendCancel(cid, "Your level is not high enough.")
elseif(getTileInfo(getCreaturePosition(cid)).protection) then
doPlayerSendCancel(cid, "You are currently in a fight.")
elseif(getPlayerPremiumDays(cid) < 1) then
doPlayerSendCancel(cid, "You must have premium.")
else
doPlayerRemoveMoney(cid, tp.c)
doTeleportThing(cid, tp.p)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully teleported to ".. param ..".")
end
return true
end
In pz tell me "You are Currently in a fight" this is my script, I need only can be done in Pz zone...
function onSay(cid, words, param, channel)
local destinations = {
["1"] = {p = {x=501, y=515, z=7}, l = 10, c = 100, v = 12345},
["2"] = {p = {x=500, y=439, z=7}, l = 20, c = 200, v = 67891},
["3"] = {p = {x=761, y=657, z=10}, l = 50, c = 300, v = 23456}
}
local tp = destinations[param]
if(param == "") then
doPlayerSendCancel(cid, "Command param required.")
return true
end
if(getPlayerLevel(cid) < tp.l) then
doPlayerSendCancel(cid, "Your level is not high enough.")
[B]if not getTileInfo(getCreaturePosition(cid)).protection then
[/B]doPlayerSendCancel(cid, "You are currently in a fight.")
elseif(getPlayerPremiumDays(cid) < 1) then
doPlayerSendCancel(cid, "You must have premium.")
else
doPlayerRemoveMoney(cid, tp.c)
doTeleportThing(cid, tp.p)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully teleported to ".. param ..".")
end
return true
end
function onSay(cid, words, param, channel)
local destinations = {
["1"] = {p = {x=501, y=515, z=7}, l = 10, c = 100, v = 12345},
["2"] = {p = {x=500, y=439, z=7}, l = 20, c = 200, v = 67891},
["3"] = {p = {x=761, y=657, z=10}, l = 50, c = 300, v = 23456}
}
local tp = destinations[param]
if(param == "") then
doPlayerSendCancel(cid, "Command param required.")
return true
end
if(getPlayerLevel(cid) < tp.l) then
doPlayerSendCancel(cid, "Your level is not high enough.")
if not getTileInfo(getCreaturePosition(cid)).protection then
doPlayerSendCancel(cid, "You are currently in a fight.")
elseif(getPlayerPremiumDays(cid) < 1) then
doPlayerSendCancel(cid, "You must have premium.")
else
doPlayerRemoveMoney(cid, tp.c)
doTeleportThing(cid, tp.p)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully teleported to ".. param ..".")
end
return true
end
end
local destinations = {
["one"] = {{x=501, y=515, z=7}, 10, 100},
["two"] = {{x=500, y=439, z=7}, 20, 200},
["three"] = {{x=761, y=657, z=10}, 50, 300}
}
function onSay(cid, words, param, channel)
local tp = destinations[param:lower()]
if not param or not tp then
doPlayerSendCancel(cid, "Command param required.")
elseif getPlayerLevel(cid) < tp[2] then
doPlayerSendCancel(cid, "Your level is not high enough.")
elseif not getTileInfo(getCreaturePosition(cid)).protection then
doPlayerSendCancel(cid, "You are not in a protection zone.")
elseif not isPremium(cid) then
doPlayerSendCancel(cid, "You must have premium.")
else
doPlayerRemoveMoney(cid, tp[3])
doTeleportThing(cid, tp[1])
doSendMagicEffect(tp[1], CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully teleported to ".. param:lower() ..".")
end
return true
end