• 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!

Action Mock Train system V 1.0

Sweet man thank you verry much but its verry awsome best train system ever :D

1 downside players can just logout wile in the cart wich bugs them on the rail.

can you fix that? or post the code to prevent players from logging out wile in cart?
 
Last edited:
Mock, how do to the player not logout when are in train?


Srry my bad english

@
Como faço pro player não logar enquanto estiver no trem?
 
Make it a -NO LOGOUT- zone in your map editor.

Just place the tiles over the train tracks xD
 
Hey, it works fine for me.. but what is the diference?

local SPEED = 200
local PLAYERSPEED = 250

What is the speed of train? i need my train travel very very fast.. what i need to change?

tks
 
dunno absolutly nothing, about what i've to do, it's a training system with a Rail?o_O?
 
Help plz..

Hey, it works fine for me.. but what is the diference?

local SPEED = 200
local PLAYERSPEED = 250

What is the speed of train? i need my train travel very very fast.. what i need to change?

tks
 
the local SPEED its the speed of train and PLAYERSPEED the playerspeed
 
Mock wehre can i paste this that the player must got have Vip and a other Storagevalue to Use Rail System!
Code:
if getPlayerStorageValue(cid,21444) and getPlayerStorageValue(cid,71745) then
 
Mock wehre can i paste this that the player must got have Vip and a other Storagevalue to Use Rail System!
Code:
if getPlayerStorageValue(cid,21444) and getPlayerStorageValue(cid,71745) then

If 71745 is vip storage then it shud work like this
Code:
--Script by mock the bear
--Config
local SPEED = 200
local PLAYERSPEED = 250
--End
local RAILS = {7121, 7122, 7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130} --Thxy rails itemid by nord :P
local CART = {[0] = 7132, [2] = 7132, [3] =7131, [1] =7131}
local CONFIG = {
	[7121] = 0,[7122] = 0,
	[7123] = {EAST, SOUTH},
	[7124] = {WEST, SOUTH},
	[7125] = {EAST, NORTH},
	[7126] = {WEST, NORTH},
	[7127] = 0,[7128] = 0,
	[7129] = 0,[7130] = 0,
	--Random
}
local reverse = {[0] = 2, 3, 0, 1} -- All that table was made by nord.
local function moveTrain(cid, frompos, direc)
	local tab
	if not isPlayer(cid) then
		return
	end
	local pos = getCreaturePosition(cid)
	local rar = findRail(pos)
	if not rar then
		doPlayerSetNoMove(cid, false)
		doRemoveCondition(cid, CONDITION_OUTFIT)
		doChangeSpeed(cid, -PLAYERSPEED)
		doMoveCreature(cid, direc)
	else
		tab = CONFIG[rar]
		if tab and type(tab) == 'table' then
			direc =  tab[tab[1] == reverse[direc] and 2 or 1] -- by nord here
		end
		doSetItemOutfit(cid, CART[direc], -1)
		doMoveCreature(cid, direc)
		addEvent(moveTrain, SPEED, cid, pos,direc)
	end
end
function findRail(p)
	local p_ = {x=p.x, y=p.y, z=p.z}
	for i=0,10 do
		p_.stackpos = i
		local t = getTileThingByPos(p_)
		if isInArray(RAILS, t.itemid) then
			return t.itemid,t.uid
		end
	end
end
function onUse(cid, item, frompos) --Script by mock the bear
	if hasCondition(cid, CONDITION_OUTFIT) or (item.actionid < 500 and item.actionid > 503) then
		return false
	end
[COLOR="red"]    if getPlayerStorageValue(cid,21444)
       if getPlayerStorageValue(cid,71745) then[/COLOR]
	      doTeleportThing(cid, frompos, false)
	      doPlayerSetNoMove(cid, true)
          doChangeSpeed(cid, PLAYERSPEED)
	      addEvent(moveTrain, SPEED, cid, frompos, item.actionid-500)
[COLOR="red"]       else
           doPlayerSendCancel(cid, "You need to be VIP in order to use train!")
       end
    else
        doPlayerSendCancel(cid, "You need to have to ?????????? to use train")
    end[/COLOR]
	return true
end
 
@santigggg
a bug at script
Code:
    if getPlayerStorageValue(cid,21444) [COLOR="red"][U][B]then[/B][/U][/COLOR]
       if getPlayerStorageValue(cid,71745) then
	      doTeleportThing(cid, frompos, false)
You have forgot then

2. No it don't work the players can use the train without Vip ://
W8ing 4 More 4NswerS
 
@santigggg
a bug at script
Code:
    if getPlayerStorageValue(cid,21444) [COLOR="red"][U][B]then[/B][/U][/COLOR]
       if getPlayerStorageValue(cid,71745) then
	      doTeleportThing(cid, frompos, false)
You have forgot then

2. No it don't work the players can use the train without Vip ://
W8ing 4 More 4NswerS

Yeh, sorry, I wasnt thinkin bout it (more than 1 bug)
It shud work like this:
Lua:
--Script by mock the bear
--Config
local SPEED = 200
local PLAYERSPEED = 250
--End
local RAILS = {7121, 7122, 7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130} --Thxy rails itemid by nord :P
local CART = {[0] = 7132, [2] = 7132, [3] =7131, [1] =7131}
local CONFIG = {
	[7121] = 0,[7122] = 0,
	[7123] = {EAST, SOUTH},
	[7124] = {WEST, SOUTH},
	[7125] = {EAST, NORTH},
	[7126] = {WEST, NORTH},
	[7127] = 0,[7128] = 0,
	[7129] = 0,[7130] = 0,
	--Random
}
local reverse = {[0] = 2, 3, 0, 1} -- All that table was made by nord.
local function moveTrain(cid, frompos, direc)
	local tab
	if not isPlayer(cid) then
		return
	end
	local pos = getCreaturePosition(cid)
	local rar = findRail(pos)
	if not rar then
		doPlayerSetNoMove(cid, false)
		doRemoveCondition(cid, CONDITION_OUTFIT)
		doChangeSpeed(cid, -PLAYERSPEED)
		doMoveCreature(cid, direc)
	else
		tab = CONFIG[rar]
		if tab and type(tab) == 'table' then
			direc =  tab[tab[1] == reverse[direc] and 2 or 1] -- by nord here
		end
		doSetItemOutfit(cid, CART[direc], -1)
		doMoveCreature(cid, direc)
		addEvent(moveTrain, SPEED, cid, pos,direc)
	end
end
function findRail(p)
	local p_ = {x=p.x, y=p.y, z=p.z}
	for i=0,10 do
		p_.stackpos = i
		local t = getTileThingByPos(p_)
		if isInArray(RAILS, t.itemid) then
			return t.itemid,t.uid
		end
	end
end
function onUse(cid, item, frompos) --Script by mock the bear
	if hasCondition(cid, CONDITION_OUTFIT) or (item.actionid < 500 and item.actionid > 503) then
		return false
	end
    if getPlayerStorageValue(cid,21444) > 0 then
       if getPlayerStorageValue(cid,71745) > 0 then
	      doTeleportThing(cid, frompos, false)
	      doPlayerSetNoMove(cid, true)
          doChangeSpeed(cid, PLAYERSPEED)
	      addEvent(moveTrain, SPEED, cid, frompos, item.actionid-500)
       else
           doPlayerSendCancel(cid, "You need to be VIP in order to use train!")
       end
    else
        doPlayerSendCancel(cid, "You need to have to ?????????? to use train")
    end
	return true
end
 
Anyone who knows how to make this work with the latest TFS?
It gives no errors in console.
 
Mock, amei o script,'-', to adaptando pro meu server de pokémon e talz...
Queria pedir para os amigos do fórum que me ajudassem aqui, como eu coloco para a viagem de trem ser paga?
_________________________________________________
English version:
Mock, loved the script,'-', i have adapted to my server of Pokemon ...
I would ask the forum for friends to help me as I put the train to be paid?
 
Back
Top