MA
action

ALGUEM PODE ME AJUDAR SYSTEM TRAIN

Por MaiconPaulo, 24 de fev. de 2014 em Scripts

script
11
992
MaiconPauloM
24 de fevereiro de 2014 às 16:11

COMO FUNCIONA ONDE COLOKO ACTION PORQUE TIPO FIZ TUDO MAIS NAO EXPLICA SE TENHO KE COLOKAR O ACTION ID EM ALGUM ITEM O NA TRILHA ACHEI KE ERA SO FAZER O TRILHO E BOTA O CARRINHO AJUDA AE

 

 

 

--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
doTeleportThing(cid, frompos, false)
doPlayerSetNoMove(cid, true)
doChangeSpeed(cid, PLAYERSPEED)
addEvent(moveTrain, SPEED, cid, frompos, item.actionid-500)
return true
end

24 de fevereiro de 2014 às 16:18

área incorreta, reportado para que movam .


ta uma bagunça seu tópico ..

 

pelo que eu conseguir entender , acho que os item ja estão definidos no script..

 

vá em data / actions / script . cria um arquivo.lua coloca o scrip dentro.

 

e em data / actions / action.Xml. e coloca a tag :

<action actionid="2000" script="NomedoArquivo.lua"/>

actionid = coloca um numero de action que não tem no seu ot .

 

abre o RME e coloca esse action no cariinho .

24 de fevereiro de 2014 às 16:25

@billthox A Tag no Actions.xml tem que estar assim:

 

 

<action itemid="7131" event="script" value="arquivo.lua" />
<action itemid="7132" event="script" value="arquivo.lua" />

 

Agora e so colocar o Action 503 no Carrinho pelo RME.

MaiconPauloM
24 de fevereiro de 2014 às 16:43

olha eu fiz tudo sertin como dis nos script mais to falando assim depois que eu fizer tudo tenho ke coloka o 7131 no action do trenzinho no rme ?

24 de fevereiro de 2014 às 16:51

sim !

24 de fevereiro de 2014 às 16:55

não man, vou ter dizer como fazer, Primeiro cole esse Script no arquivo.lua do Trem:

 

local SPEED = 250
local PLAYERSPEED = 270
--End
local RAILS = {7121, 7122, 7123, 7124, 7125, 7126, 7127, 7128, 7129, 7130}
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,
        [152] = {NORTH, SOUTH},
        [153] = {SOUTH, NORTH},        
        [154] = {EAST, WEST},  
        [155] = {WEST, EAST},
        --Random
}
local reverse = {[0] = 2, 3, 0, 1}
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]
                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
        doTeleportThing(cid, frompos, false)
        doPlayerSetNoMove(cid, true)
    doChangeSpeed(cid, PLAYERSPEED)
        addEvent(moveTrain, SPEED, cid, frompos, item.actionid-500)
        return true
end

 

 

Agora coloque essa tag substituindo a que tinha do trem em actions.xml:

 

<action itemid="7131" event="script" value="arquivo.lua" />
<action itemid="7132" event="script" value="arquivo.lua" />

 

 

 

Agora e so ir pelo RME e colocar a Action 503 no Carrinho......

24 de fevereiro de 2014 às 16:57

a duvida dele era se ele tem que colocar o action id no carrinho ..

 

falei que Sim .

Editado Fevereiro 24 por DuuhCarvalho

24 de fevereiro de 2014 às 17:01

No proprio script dele tinha essa linha:

 

if hasCondition(cid, CONDITION_OUTFIT) or (item.actionid < 500 and item.actionid > 503) then

 

Ai mandei ele colocar a action 503 no primeiro Post que fiz, ai depois ele veio perguntar se era pra colocar a action 7131 '-'

MaiconPauloM
24 de fevereiro de 2014 às 17:02

OBRIGADO A VCS DOIS DESCULPA PELA COMPRICAÇAO NAO SOU MUITO INTELIGENTE E NEM SEI DA REP

24 de fevereiro de 2014 às 17:06

OBRIGADO A VCS DOIS DESCULPA PELA COMPRICAÇAO NAO SOU MUITO INTELIGENTE E NEM SEI DA REP

 

Fica de boa, mas cuidado na próxima vez que for criar um tópico, verifique se estar na área correta

zipter98Z
24 de fevereiro de 2014 às 18:01

Como dito acima, área incorreta. Como vejo que sua dúvida já foi sanada, moverei direto para resolvidos. Tenha mais cuidado da próxima vez.