JDB
OtLand Veteran
- Joined
- Jun 1, 2009
- Messages
- 4,145
- Solutions
- 2
- Reaction score
- 115
Code:
local destinations = {
["temple"] = {p = {x=100, y=100, z=7}, l = 10, c = 100, v = 12345},
["trainers"] = {p = {x=200, y=200, z=7}, l = 20, c = 200, v = 67891},
["depot"] = {p = {x=300, y=300, z=7}, l = 50, c = 300, v = 23456}
}
function onSay(cid, words, param, channel)
local tp = destinations[param]
if param == "" or not tp then
return doPlayerSendCancel(cid, "Command param required.")
end
if not doPlayerRemoveMoney(cid, tp.c) then
return doPlayerSendCancel(cid, "You do not have enough money.")
elseif(getPlayerLevel(cid) < tp.l) then
return doPlayerSendCancel(cid, "Your level is not high enough.")
elseif(getPlayerStorageValue(cid, tp.v) == -1) then
return doPlayerSendCancel(cid, "You must have VIP.")
elseif(isPlayerPzLocked(cid) == true) then
return doPlayerSendCancel(cid, "You are currently in a fight.")
elseif(getPlayerPremiumDays(cid) < 1) then
return doPlayerSendCancel(cid, "You must have premium.")
end
return doTeleportThing(cid, tp.p) and doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully teleported to " .. param .. ".")
end
Last edited: