JDB
OtLand Veteran
- Joined
- Jun 1, 2009
- Messages
- 4,145
- Solutions
- 2
- Reaction score
- 115
Nothing Special although my other thread was outdated. eace:
data/talkactions/talkactions.xml
data/talkactions/scripts/teleport.lua
Premium, VIP, Level, and Cost [Configurable]
data/talkactions/talkactions.xml
PHP:
<talkaction log="no" words="/tp" access="0" event="script" value="teleport.lua"/>
data/talkactions/scripts/teleport.lua
Premium, VIP, Level, and Cost [Configurable]
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 == "") then
doPlayerSendCancel(cid, "Command param required.")
return true
end
if(getPlayerMoney(cid) < tp.c) then
doPlayerSendCancel(cid, "You do not have enough money.")
elseif(getPlayerLevel(cid) < tp.l) then
doPlayerSendCancel(cid, "Your level is not high enough.")
elseif(getPlayerStorageValue(cid, tp.v) == -1) then
doPlayerSendCancel(cid, "You must have VIP.")
elseif(isPlayerPzLocked(cid) == true) 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
Last edited: