FabianoBN
l|¬¬"|l
Thanks man.
Nice ^^!
Nice ^^!
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
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
--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
if getPlayerStorageValue(cid,21444) [COLOR="red"][U][B]then[/B][/U][/COLOR]
if getPlayerStorageValue(cid,71745) then
doTeleportThing(cid, frompos, false)
@santigggg
a bug at script
You have forgot thenCode:if getPlayerStorageValue(cid,21444) [COLOR="red"][U][B]then[/B][/U][/COLOR] if getPlayerStorageValue(cid,71745) then doTeleportThing(cid, frompos, false)
2. No it don't work the players can use the train without Vip ://
W8ing 4 More 4NswerS
--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
dunno absolutly nothing, about what i've to do, it's a training system with a Rail??