Postado Julho 24, 2016 8 anos Instalei o Zombie Event, acontece que quando o evento acaba sempre fica 1 player na arena que não é telestransportado pro templo... Eu imagino que seja em movements nesse script: dofile('data/zombieEvent.lua') zombieespera = {x=31851, y=32453, z=7} function onStepIn(cid, item, position, fromPosition) local player = Player(cid) if not player then return false end if Game.getStorageValue(ze_stateGlobalStorage) == 2 then player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event has already started.') player:teleportTo(fromPosition, true) return false end if Game.getStorageValue(ze_stateGlobalStorage) == 0 then player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event has not started yet.') player:teleportTo(fromPosition, true) return false end if Game.getStorageValue(ze_joinCountGlobalStorage) > ze_maxPlayers then player:teleportTo(fromPosition, true) player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event is already full! ['.. Game.getStorageValue(zeJoinedCountGlobalStorage) ..'/'.. zeMaxPlayers ..']') return false end player:teleportTo(zombieespera) Game.setStorageValue(ze_joinCountGlobalStorage, Game.getStorageValue(ze_joinCountGlobalStorage) + 1) Game.broadcastMessage(string.format('%s has joined the Zombie Event! [%s/'.. ze_maxPlayers ..'].', player:getName(), Game.getStorageValue(ze_joinCountGlobalStorage)), MESSAGE_STATUS_WARNING) player:setStorageValue(ze_joinStorage, 1) return true end O motivo de achar que é esse script é que quando o primeiro player entra ele da o aviso "Player tal tal has joined Zombie Event [0/100]. " ao invés de ser [1/100]... Ou seja, ele não esta registrando o primeiro player? Não entendo muito as funções, gostaria da ajuda de quem entende para me ensinar por favor... Editado Julho 24, 2016 8 anos por Leo Zanin (veja o histórico de edições)
Postado Julho 25, 2016 8 anos @Leo Zanin Tente assim: Spoiler dofile('data/zombie_system.lua') function onStepIn(cid, item, position, fromPosition) local player = Player(cid) if not player then return false end if Game.getStorageValue(zeStartedGlobalStorage) == 2 then player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event has already started.') player:teleportTo(fromPosition, true) return false end if Game.getStorageValue(zeStartedGlobalStorage) == 0 then player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event has not started yet.') player:teleportTo(fromPosition, true) return false end if Game.getStorageValue(zeJoinedCountGlobalStorage) > zeMaxPlayers then player:teleportTo(fromPosition, true) player:sendTextMessage(MESSAGE_INFO_DESCR, 'The Zombie Event is already full! ['.. Game.getStorageValue(zeJoinedCountGlobalStorage) ..'/'.. zeMaxPlayers ..']') return false end player:teleportTo(zeWaitingRoomPos) Game.setStorageValue(zeJoinedCountGlobalStorage, Game.getStorageValue(zeJoinedCountGlobalStorage) + 1) Game.broadcastMessage(string.format('%s has joined the Zombie Event! [%s/'.. zeMaxPlayers ..'].', player:getName(), Game.getStorageValue(zeJoinedCountGlobalStorage)), MESSAGE_STATUS_WARNING) player:setStorageValue(zeJoinStorage, 1) return true end Obs: Se lhe ajudei, de um REP+ :D
Postado Julho 25, 2016 8 anos Autor Esse que você me passou é do TFS 1.0, testei aqui e da erro, não entra no teleport e da erros na distro... REP+ pela tentativa! @Mathwsz ajuda ai @Kemmlly por favor, tu que manja Editado Julho 25, 2016 8 anos por Leo Zanin (veja o histórico de edições)
Postado Julho 27, 2016 8 anos Em 24/07/2016 at 22:37, Leo Zanin disse: Esse que você me passou é do TFS 1.0, testei aqui e da erro, não entra no teleport e da erros na distro... REP+ pela tentativa! @Mathwsz ajuda ai @Kemmlly por favor, tu que manja Não manjo de TFS 1+, mas sei que esse erro do 0/100 é porque o storage inicialmente é -1, então quando ele soma 1, vai ficar zero. Antes dessa soma você tem que determinar 0 para esse storage, acredito que seja assim, tente substituir o final por essa parte: player:teleportTo(zombieespera) if Game.getStorageValue(ze_joinCountGlobalStorage) < 0 then Game.setStorageValue(ze_joinCountGlobalStorage, 0) end Game.setStorageValue(ze_joinCountGlobalStorage, Game.getStorageValue(ze_joinCountGlobalStorage) + 1) Game.broadcastMessage(string.format('%s has joined the Zombie Event! [%s/'.. ze_maxPlayers ..'].', player:getName(), Game.getStorageValue(ze_joinCountGlobalStorage)), MESSAGE_STATUS_WARNING) player:setStorageValue(ze_joinStorage, 1) return true end
Postado Julho 28, 2016 8 anos Autor Em 27/07/2016 at 09:37, Kemmlly disse: Não manjo de TFS 1+, mas sei que esse erro do 0/100 é porque o storage inicialmente é -1, então quando ele soma 1, vai ficar zero. Antes dessa soma você tem que determinar 0 para esse storage, acredito que seja assim, tente substituir o final por essa parte: player:teleportTo(zombieespera) if Game.getStorageValue(ze_joinCountGlobalStorage) < 0 then Game.setStorageValue(ze_joinCountGlobalStorage, 0) end Game.setStorageValue(ze_joinCountGlobalStorage, Game.getStorageValue(ze_joinCountGlobalStorage) + 1) Game.broadcastMessage(string.format('%s has joined the Zombie Event! [%s/'.. ze_maxPlayers ..'].', player:getName(), Game.getStorageValue(ze_joinCountGlobalStorage)), MESSAGE_STATUS_WARNING) player:setStorageValue(ze_joinStorage, 1) return true end Vou testar e te aviso, muito obrigado desde já! --EDIT Funcionou perfeitamenteeeee!!! Voce é o cara! @Kemmlly Editado Julho 29, 2016 8 anos por Leo Zanin (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.