Postado Dezembro 16, 2014 10 anos Em 15/12/2014 em 15:32, danihcv disse: shutdownEvent = 0 function onSay(cid, words, param, channel) if(param == '') then doSetGameState(GAMESTATE_SHUTDOWN) return true end params = string.explode(param, ",") local action, reason, mins = "", "", 0 if(not tonumber(params[1])) then action = string.trim(params[1]:lower()) else mins = string.trim(params[1]) if(table.maxn(params) > 1) then reason = params[2] end end if(action) then if(action == "cancel" or action == "stop") then if(shutdownEvent ~= 0) then stopEvent(shutdownEvent) shutdownEvent = 0 doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Shutdown cancelled.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Server is not in the shutdown phase.") end return true elseif(action == "kill") then os.exit() return true end end mins = tonumber(mins) if(not mins or mins < 0) then doPlayerSendCancel(cid, "Numeric param may not be lower than 0.") return true end if(shutdownEvent ~= 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Server is already in a shutdown state. To cancel shutdown use the \"/shutdown stop\" command.") return true end return prepareShutdown(math.abs(math.ceil(mins)), reason) end function prepareShutdown(minutes, reason) if(minutes <= 0) then doSetGameState(GAMESTATE_SHUTDOWN) return false end local change, r = 5, (reason ~= "" and " Reason: "..reason or "") if(minutes == 1) then doBroadcastMessage("Server is going down in " .. minutes .. " minute, please log out now!" .. r) elseif(minutes <= 5) then doBroadcastMessage("Server is going down in " .. minutes .. " minutes, please log out." .. r) change = 1 else doBroadcastMessage("Server is going down in " .. minutes .. " minutes." .. r) end shutdownEvent = addEvent(prepareShutdown, (change * 60 * 1000), minutes - change, reason) return true end Obrg e REP+ Meus Contatos! Minhas Funções: Mostrar conteúdo oculto Skype: TsplayerT Facebook: TakaFukushii YouTube: ADoseDupla Twitter: @_Splayer_ Mapper:▓▓▓▓▓▓▓▓▓▓ 97% Programmer:▓▓▓▓▓▒▒▒▒▒ 45% Scripter:▓▓▓▓▓▓▓▓▓▒ 83% Spriter:▓▓▓▓▓▓▒▒▒▒ 57% Gamemaster:▓▓▓▓▓▓▓▓▓▓ 99% Ot Creator:▓▓▓▓▓▓▓▒▒▒71% Ot Client Maker:▓▓▓▓▓▓▓▒▒▒74%
Postado Dezembro 17, 2014 10 anos Autor o do /bc não pego, o to shutdown vou testar quando não tiver quase player on. preciso a de tutor com urgencia.
Postado Dezembro 17, 2014 10 anos O do /bc não funcionou? Apareceu algum erro? Se sim, pf poste uma print. Te ajudei?? REP + e ficamos quites... http://www.tibiaking.com/forum/uploads/emoticons/default_happyy.png' alt=';D'> Atenciosamente, Daniel. Abraços! Meus tutoriais: Programação: Resolvendo QUALQUER erro na data base. Scripts (system's, creaturescripts, mod's, NPC's, etc): (Sistema) GOD Ambient Light Full. Adicionando novas mounts ao servidor [NPC] Papai Noel que dá presente todo ano. Web-site: Resolvendo problema de caracteres especiais em PHP Formatando textos em PHP! Mudando a cor, tamanho, fonte, etc. Criando e configurando tabelas para paginas PHP
Postado Dezembro 17, 2014 10 anos No TFS 1.0, a função doBroadcastMessage não existe. Tente: function onSay(cid, words, param, channel) if(param == '') then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") end local t = string.explode(param, " ", 1) if(not t[2]) then broadcastMessage(t[1], MESSAGE_STATUS_WARNING) elseif(not broadcastMessage(t[2], MESSAGE_TYPES[t[1]])) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Bad message color type.") end return true end The corrupt fear us. The honest support us. The heroic join us.
Postado Dezembro 17, 2014 10 anos Em 17/12/2014 em 03:12, Suicide disse: pode me ajudar via PM? N ignore pf Meus Contatos! Minhas Funções: Mostrar conteúdo oculto Skype: TsplayerT Facebook: TakaFukushii YouTube: ADoseDupla Twitter: @_Splayer_ Mapper:▓▓▓▓▓▓▓▓▓▓ 97% Programmer:▓▓▓▓▓▒▒▒▒▒ 45% Scripter:▓▓▓▓▓▓▓▓▓▒ 83% Spriter:▓▓▓▓▓▓▒▒▒▒ 57% Gamemaster:▓▓▓▓▓▓▓▓▓▓ 99% Ot Creator:▓▓▓▓▓▓▓▒▒▒71% Ot Client Maker:▓▓▓▓▓▓▓▒▒▒74%
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.