Ir para conteúdo
  • 0

Train System


BrunooMaciell

Pergunta

Estou com um erro relacionado ao train system!!

 

Erro

 

[18/03/2016 22:23:32] [Error - MoveEvents Interface]
[18/03/2016 22:23:32] data/movements/scripts/custom/train_celadon.lua:onStepIn
[18/03/2016 22:23:32] Description:
[18/03/2016 22:23:32] (luaDoPlayerSendCancel) Player not found

 

 

Script

 

local m = {
storage = 4591, -- Vridian
place1 = { x = 974, y = 1279, z = 6}, -- Aqui é a Pos pra onde o trem te leva
cancel = "You need to buy a ticket for travel on the train.", -- Mensaje para abortar
success = "Welcome, please stay in place while you reach the desired location.", -- Mensaje para abortar
place = { x = 1156, y = 1351, z = 8} -- Aqui é a Pos do TREM
}

function tp(cid)
if not isCreature(cid) then return true end
doSendMagicEffect(getThingPos(cid),66)
setPlayerStorageValue(cid, m.storage, -1)
return true
end

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if not isCreature(cid) then return true end
if (getCreatureStorage(cid, m.storage) == 1) == TRUE then
doTeleportThing(cid, m.place)
addEvent(tp, 15000)
addEvent(doTeleportThing, 15000, cid, m.place1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, m.success)
doPlayerSendTextMessage(cid,25,"You're currently traveling to Viridian")
setPlayerStorageValue(cid, m.storage, -1)
elseif (getCreatureStorage(cid, m.storage) == 1) == FALSE then
doPlayerSendCancel(cid, m.cancel)
doTeleportThing(cid, fromPosition)
end
return true
end

 

 

Rep+

Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0

Tenta isso amigo:

 

local m = {
storage = 4591, -- Vridian
place1 = { x = 974, y = 1279, z = 6}, -- Aqui é a Pos pra onde o trem te leva
cancel = "You need to buy a ticket for travel on the train.", -- Mensaje para abortar
success = "Welcome, please stay in place while you reach the desired location.", -- Mensaje para abortar
place = { x = 1156, y = 1351, z = 8} -- Aqui é a Pos do TREM
}

function tp(cid)
if not isCreature(cid) then

return false

end

if isCreature(cid) then
doSendMagicEffect(getThingPos(cid),66)
setPlayerStorageValue(cid, m.storage, -1)
return true
end

end

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if not isCreature(cid) then

return false

end
if (getCreatureStorage(cid, m.storage) == 1) == TRUE and isCreature(cid) then

doTeleportThing(cid, m.place)
addEvent(tp, 15000)
addEvent(doTeleportThing, 15000, cid, m.place1)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, m.success)
doPlayerSendTextMessage(cid,25,"You're currently traveling to Viridian")
setPlayerStorageValue(cid, m.storage, -1)
elseif (getCreatureStorage(cid, m.storage) == 1) == FALSE then
doPlayerSendCancel(cid,22, m.cancel)
doTeleportThing(cid, fromPosition)
end
return true
end

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...