- 0
Entre para seguir isso
Seguidores
0
Scripting [TFS 0.4 (8.6)] Zombie Event automático
Perguntado por
bitoca1995
2 respostass a esta questão
Recommended Posts
Este tópico está impedido de receber novos posts.
Entre para seguir isso
Seguidores
0
-
Quem Está Navegando 0 membros estão online
Nenhum usuário registrado visualizando esta página.
Boa noite,
Tenho o zombie event em meu servidor funcionando normal, porem ele funciona através da talkaction: /zombiestart, eu queria que esse evento fosse automatico, que começasse todo dia as 18:00 automaticamente, para isso eu sei que precisa de uma globalevent, tentei de tudo e não consegui configurar, será que precisa alterar o script do sistema inteiro para isso? segue o script da talkaction para iniciar o sistema:
function onSay(cid, words, param, channel) if(getStorage(ZE_STATUS) ~= 2) then local players_on_arena_count = #getZombiesEventPlayers() if(param == 'force') then if(players_on_arena_count > 0) then setZombiesEventPlayersLimit(players_on_arena_count ) addZombiesEventBlockEnterPosition() doSetStorage(ZE_STATUS, 2) doBroadcastMessage("Zombie Arena Event started.") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Zombies event started.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot start Zombies event. There is no players on arena.") end else if(param ~= '' and tonumber(param) > 0) then setZombiesEventPlayersLimit(tonumber(param)) end removeZombiesEventBlockEnterPosition() doSetStorage(ZE_STATUS, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Event started.") doPlayerBroadcastMessage(cid, "Zombie Arena Event teleport is opened. We are waiting for " .. getZombiesEventPlayersLimit() - players_on_arena_count .. " players to start.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Zombies event is already running.") end return true end
e o globalevent:
function onThink(interval, lastExecution, thinkInterval) if(getStorage(ZE_STATUS) == 2) then setZombiesToSpawnCount(getZombiesToSpawnCount()+1) local players = getZombiesEventPlayers() for i=1, getZombiesToSpawnCount() * 2 do if(getZombiesToSpawnCount() > 0 and spawnNewZombie()) then setZombiesToSpawnCount(getZombiesToSpawnCount()-1) end end end return true end
Alguém pode me ajudar por favor?
-Edit
modifiquei a talkaction do evento para globalevent com a função onTime no arquivo ontime.lua e tá funcionando, ele executa na hora certa o evento, porem eu gostaria se possivel que ele avisasse vamos supor as 19:00 que o evento vai começar e as 19:01 ele retirasse a barreira para o evento começar, onde adiciono isso no script:
function onTime() if(getStorage(ZE_STATUS) ~= 2) then local players_on_arena_count = #getZombiesEventPlayers() if (players_on_arena_count > 0) then if(players_on_arena_count > 0) then removeZombiesEventBlockEnterPosition() doSetStorage(ZE_STATUS, 1) doBroadcastMessage("Zombie Arena Event started.") else end else removeZombiesEventBlockEnterPosition() doSetStorage(ZE_STATUS, 1) doBroadcastMessage("Zombie Arena Event started.") end else end return true end
Obrigado.
Compartilhar este post
Link para o post
Compartilhar em outros sites