Ir para conteúdo

Featured Replies

Postado

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

  • Respostas 6
  • Visualizações 368
  • Created
  • Última resposta

Top Posters In This Topic

Postado

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo