• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Travel system by Red Boss!

narko

vertrauenswürdig ~
Joined
Oct 19, 2008
Messages
1,317
Solutions
2
Reaction score
131
Location
Unknown
Hello
Is good system for bigs server
this system only works in boats!
travel.lua:
Code:
local t = {
boat1from = {x=1111, y=1111, z=7},
boat1to = {x=1111, y=1111, z=7},
boat2from = {x=1111, y=1111, z=7},
boat2to = {x=1111, y=1111, z=7},
}
local citys = {
["venore"] = {pos = {x=32952, y=32022, z=6}, lvl = 8, cost = 100, vip = 0},
["thais"] = {pos = {x=32310, y=32210, z=6}, lvl = 8, cost = 100, vip = 0},
["ab'dendriel"] = {pos = {x=32734, y=31668, z=6}, lvl = 8, cost = 100, vip = 0},
["vip"] = {pos = {x=32285, y=32891, z=6}, lvl = 8, cost = 100, vip = 1}
}
function getPlayerVipDays(cid)
local Info = db.getResult("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
local days= Info:getDataInt("vipdays")
Info:free()
return days
end
return LUA_ERROR
end
function onSay(cid, words, param, channel)
if isPlayer(cid) and isInRange(getThingPos(cid), t.boat1from, t.boat1to) or isPlayer(cid) and isInRange(getThingPos(cid), t.boat2from, t.boat2to) then
local travel = citys[param]
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Current sailds: pon aqui tus ciudades. Example /travel city.")
return true
end
local notexist = citys[param]
if (not notexist) then
doPlayerSendCancel(cid,"city not exist.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
end
if(getPlayerMoney(cid) < travel.cost) then
doPlayerSendCancel(cid, "You need ".. citys[param].cost .." gp.")
elseif(getPlayerLevel(cid) < travel.lvl) then
doPlayerSendCancel(cid, "You need lvl ".. citys[param].lvl .." to travel.")
elseif(getPlayerVipDays(cid) < travel.vip) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need bought vip access in the Website: http://neroxia.net/?subtopic=shopsystem")
elseif(isPlayerPzLocked(cid) == true) then
doPlayerSendCancel(cid, "You are currently in a fight.")
else
doPlayerRemoveMoney(cid, travel.cost)
doTeleportThing(cid, travel.pos)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully travel to ".. param ..".")
end
return true
end
end
for one rl mal is:
Lua:
local t = {
thaisfrom = {x=32307, y=32205, z=6},
thaisto = {x=32314, y=32222, z=6},
carlinfrom = {x=32384, y=31819, z=6},
carlinto = {x=32390, y=31823, z=6},
venorefrom = {x=32950, y=32019, z=6},
venoreto = {x=32959, y=32025, z=6},
edronfrom = {x=33170, y=31762, z=6},
edronto = {x=33180, y=31767, z=6},
abfrom = {x=32731, y=31661, z=6},
abto = {x=32737, y=31678, z=6},
ankrafrom = {x=33089, y=32882, z=6},
ankrato = {x=33095, y=32886, z=6},
darafrom = {x=33285, y=32479, z=6},
darato = {x=33293, y=32484, z=6},
svafrom = {x=32336, y=31106, z=6},
svato = {x=32345, y=31111, z=6},
yalafrom = {x=32798, y=31266, z=6},
yalato = {x=32807, y=31274, z=6},
farfrom = {x=33022, y=31550, z=10},
farto = {x=33028, y=31555, z=10},
vipfrom = {x=968, y=1062, z=7},
vipto = {x=976, y=1065, z=7},
lbfrom = {x=32282, y=32886, z=6},
lbto = {x=32289, y=32895, z=6},
goromafrom = {x=32156, y=32549, z=6},
goromato = {x=32165, y=32570, z=6},
portfrom = {x=32521, y=32780, z=6},
portto = {x=32539, y=32787, z=6},
}
local citys = {
["venore"] = {pos = {x=32952, y=32022, z=6}, lvl = 8, cost = 100, vip = 0},
["thais"] = {pos = {x=32310, y=32210, z=6}, lvl = 8, cost = 100, vip = 0},
["ab'dendriel"] = {pos = {x=32734, y=31668, z=6}, lvl = 8, cost = 100, vip = 0},
["liberty bay"] = {pos = {x=32285, y=32891, z=6}, lvl = 8, cost = 100, vip = 0},
["port hope"] = {pos = {x=32527, y=32784, z=6}, lvl = 8, cost = 100, vip = 0},
["ankrahmun"] = {pos = {x=33092, y=32883, z=6}, lvl = 8, cost = 100, vip = 0},
["darashia"] = {pos = {x=33289, y=32481, z=6}, lvl = 8, cost = 100, vip = 0},
["edron"] = {pos = {x=33173, y=31764, z=6}, lvl = 8, cost = 100, vip = 0},
["svargrond"] = {pos = {x=32342, y=31108, z=6}, lvl = 8, cost = 100, vip = 0},
["yalahar"] = {pos = {x=32803, y=31272, z=6}, lvl = 8, cost = 100, vip = 0},
["farmine"] = {pos = {x=33025, y=31553, z=10}, lvl = 8, cost = 100, vip = 0},
["oken"] = {pos = {x=31200, y=31154, z=6}, lvl = 20, cost = 400, vip = 0},
["gengia"] = {pos = {x=4270, y=30179, z=6}, lvl = 20, cost = 400, vip = 0},
["pyre"] = {pos = {x=31081, y=30171, z=6}, lvl = 20, cost = 400, vip = 0},
["carlin"] = {pos = {x=32388, y=31821, z=6}, lvl = 8, cost = 100, vip = 0},
["vip"] = {pos = {x=971, y=1063, z=7}, lvl = 8, cost = 100, vip = 1},
["goroma"] = {pos = {x=32161, y=32558, z=6}, lvl = 8, cost = 100, vip = 0},
["cormaya"] = {pos = {x=33287, y=31955, z=6}, lvl = 8, cost = 100, vip = 0},
}
function getPlayerVipDays(cid)
local Info = db.getResult("SELECT `vipdays` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1")
if Info:getID() ~= LUA_ERROR then
local days= Info:getDataInt("vipdays")
Info:free()
return days
end
return LUA_ERROR
end
function onSay(cid, words, param, channel)
if isPlayer(cid) and isInRange(getThingPos(cid), t.thaisfrom, t.thaisto) or isPlayer(cid) and isInRange(getThingPos(cid), t.carlinfrom, t.carlinto) or isPlayer(cid) and isInRange(getThingPos(cid), t.venorefrom, t.venoreto) or isPlayer(cid) and isInRange(getThingPos(cid), t.edronfrom, t.edronto)or isPlayer(cid) and isInRange(getThingPos(cid), t.abfrom, t.abto)or isPlayer(cid) and isInRange(getThingPos(cid), t.ankrafrom, t.ankrato)or isPlayer(cid) and isInRange(getThingPos(cid), t.darafrom, t.darato)or isPlayer(cid) and isInRange(getThingPos(cid), t.svafrom, t.svato)or isPlayer(cid) and isInRange(getThingPos(cid), t.yalafrom, t.yalato)or isPlayer(cid) and isInRange(getThingPos(cid), t.farfrom, t.farto)or isPlayer(cid) and isInRange(getThingPos(cid), t.vipfrom, t.vipto)or isPlayer(cid) and isInRange(getThingPos(cid), t.lbfrom, t.lbto)or isPlayer(cid) and isInRange(getThingPos(cid), t.goromafrom, t.goromato)or isPlayer(cid) and isInRange(getThingPos(cid), t.portfrom, t.portto) then
local travel = citys[param]
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Current sailds: venore, goroma, thais, ab'dendriel, liberty bay, port hope, ankrahmun, darashia, edron, svargrond, yalahar, farmine, carlin, oken, pyre, gengia, cormaya and VIP (For vip need vip access). Example /travel carlin.")
return true
end
local notexist = citys[param]
if (not notexist) then
doPlayerSendCancel(cid,"city not exist.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
end
if(getPlayerMoney(cid) < travel.cost) then
doPlayerSendCancel(cid, "You need ".. citys[param].cost .." gp.")
elseif(getPlayerLevel(cid) < travel.lvl) then
doPlayerSendCancel(cid, "You need lvl ".. citys[param].lvl .." to travel.")
elseif(getPlayerVipDays(cid) < travel.vip) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need bought vip access in the Website: http://neroxia.net/?subtopic=shopsystem")
elseif(isPlayerPzLocked(cid) == true) then
doPlayerSendCancel(cid, "You are currently in a fight.")
else
doPlayerRemoveMoney(cid, travel.cost)
doTeleportThing(cid, travel.pos)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully travel to ".. param ..".")
end
return true
end
end
in talkaction.xml:
Code:
    <talkaction words="!travel;/travel" event="script" value="travel.lua"/>
U need kekox vip system
Code:
ALTER TABLE `accounts` ADD
`vipdays` int(11) NOT NULL DEFAULT 0;
thanks!
 
Last edited:
Back
Top