Postado Julho 4, 2015 10 anos alguem poderia me ajudar, script movements do meu zombie esta bugado, quando atinge 15 players (maximo) no evento ainda esta dando para mais gente entrar nele, bugando o evento. local config = { playerCount = 2001, -- Global storage for counting the players in the event maxPlayers = 15, -- Max players who can participate } function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if getGlobalStorageValue(config.playerCount) < config.maxPlayers then setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)+1) if getGlobalStorageValue(config.playerCount) == config.maxPlayers then doBroadcastMessage("O evento 'Zumbi' foi lotado! E começerá em alguns instantes.", MESSAGE_STATUS_CONSOLE_BLUE) else doBroadcastMessage("O jogador (" .. getPlayerName(cid) .. ") entrou no evento 'Zumbi'! Atualmente " .. getGlobalStorageValue(config.playerCount) .. " jogadores entraram!", MESSAGE_STATUS_CONSOLE_BLUE) doBroadcastMessage("Restando "..config.maxPlayers - getGlobalStorageValue(config.playerCount).." jogadores para entrar!", MESSAGE_STATUS_CONSOLE_BLUE) end else addEvent(tpBack, 1000, cid, fromposition) doPlayerSendCancel(cid, "") doBroadcastMessage("[EVENTO ZUMBI MENSAGEM] está cheio. Já existe " .. config.maxPlayers .. " jogadores participando.", MESSAGE_STATUS_CONSOLE_ORANGE) return false end print(getStorage(config.playerCount) .. " Players in the zombie event.") return true end function tpBack(cid, fromPosition) doTeleportThing(cid, fromPosition, true) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) end
Postado Julho 6, 2015 9 anos Será que essa Storage não está sendo utilizada para nenhum outro comando? Baiak Thunder New TFS Downgrade [TFS 1.5 - 8.60] Gesior Ferobra Downgrade Evento Monster Hunt [TFS 1.X] Evento SafeZone [TFS 1.X] Online Bonus System [TFS 1.X] Dodge & Critical [TFS 1.X] Nova moeda, funcionando com NPCs [TFS 1.X] Square System [TFS 1.X] Loot Channel [TFS 1.X] Gerenciador de Quests [All TFS] NPCs comprando vial/flasks por storage [TFS 1.X] AntiBot [TFS 1.X] Como compilar TFS 0.X
Postado Julho 6, 2015 9 anos Autor não somente no evento mesmo. Editado Julho 6, 2015 9 anos por gabrielbuff (veja o histórico de edições)
Postado Julho 7, 2015 9 anos tenta assim local config = { playerCount = 5991, -- Global storage for counting the players in the event maxPlayers = 15 -- Max players who can participate } function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if getGlobalStorageValue(config.playerCount) < config.maxPlayers then setGlobalStorageValue(config.playerCount, getGlobalStorageValue(config.playerCount)+1) if getGlobalStorageValue(config.playerCount) == config.maxPlayers then doBroadcastMessage("O evento 'Zumbi' foi lotado! E começerá em alguns instantes.", MESSAGE_STATUS_CONSOLE_BLUE) else doBroadcastMessage("O jogador (" .. getPlayerName(cid) .. ") entrou no evento 'Zumbi'! Atualmente " .. getGlobalStorageValue(config.playerCount) .. " jogadores entraram!", MESSAGE_STATUS_CONSOLE_BLUE) doBroadcastMessage("Restando "..config.maxPlayers - getGlobalStorageValue(config.playerCount).." jogadores para entrar!", MESSAGE_STATUS_CONSOLE_BLUE) end else addEvent(tpBack, 1000, cid, fromposition) doPlayerSendCancel(cid, "") doBroadcastMessage("[EVENTO ZUMBI MENSAGEM] está cheio. Já existe " .. config.maxPlayers .. " jogadores participando.", MESSAGE_STATUS_CONSOLE_ORANGE) return false end print(getStorage(config.playerCount) .. " Players in the zombie event.") return true end function tpBack(cid, fromPosition) doTeleportThing(cid, fromPosition, true) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT) return true end I like
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.