Ir para conteúdo

Featured Replies

Postado

Queria modificar esse save para que o broadcaste seja apenas uma única vez a cada save, e apareça assim. :

Server saved!

save.lua

local config = {

broadcast = {120, 30},

shallow = "no",

delay = 120,

events = 30

}

config.shallow = getBooleanFromString(config.shallow)

local function executeSave(seconds)

if(isInArray(config.broadcast, seconds)) then

local text = ""

if(not config.shallow) then

text = "O s"

else

text = "S"

end

text = text .. "erver save in " .. seconds .. " seconds!"

doBroadcastMessage(text)

end

if(seconds > 0) then

addEvent(executeSave, config.events * 1000, seconds - config.events)

else

doSaveServer(config.shallow)

end

end

function onThink(interval, lastExecution, thinkInterval)

if(table.maxn(config.broadcast) == 0) then

doSaveServer(config.shallow)

else

executeSave(config.delay)

end

return true

end

  • Respostas 5
  • Visualizações 353
  • Created
  • Última resposta

Top Posters In This Topic

Postado

Pronto.


local config = {

    broadcast = {120, 30},

    shallow = "no",

    delay = 120,

    events = 30

}


config.shallow = getBooleanFromString(config.shallow)

local function executeSave(seconds)

    if(isInArray(config.broadcast, seconds)) then

	    local text = ""

	    if(not config.shallow) then

		    text = "O s"


	    end

	    text = text .. "Server Saved"

	    doBroadcastMessage(text)

    end

    if(seconds > 0) then

	    addEvent(executeSave, config.events * 1000, seconds - config.events)

    else

	    doSaveServer(config.shallow)

    end

end

function onThink(interval, lastExecution, thinkInterval)

    if(table.maxn(config.broadcast) == 0) then

	    doSaveServer(config.shallow)

    else

	    executeSave(config.delay)

    end

    return true

end

Att,

Skyligh

Entrada Como Membro 14 / 08 / 2012

Entrada Como Suporte 05 / 12 / 2012

Saída Como Suporte 06 / 01 / 2013

sem_ta28.png

Contato : [email protected] / [email protected]

Postado

tente assim .


local config = {

    broadcast = {120, 30},

    shallow = "no",

    delay = 120,

    events = 30

}

config.shallow = getBooleanFromString(config.shallow)

local function executeSave(seconds)

    if(isInArray(config.broadcast, seconds)) then

	    local text = ""

	    if(not config.shallow) then

		    text = "O s"

	    else

		    text = "S"

	    end

	    text = text .. "Server Saved"

	    doBroadcastMessage(text)

    end

    if(seconds > 0) then

	    addEvent(executeSave, config.events * 1000, seconds - config.events)

    else

	    doSaveServer(config.shallow)

    end

end

function onThink(interval, lastExecution, thinkInterval)

    if(table.maxn(config.broadcast) == 0) then

	    doSaveServer(config.shallow)

    else

	    executeSave(config.delay)

    end

    return true

end

Att,

Skyligh

Entrada Como Membro 14 / 08 / 2012

Entrada Como Suporte 05 / 12 / 2012

Saída Como Suporte 06 / 01 / 2013

sem_ta28.png

Contato : [email protected] / [email protected]

Postado
  • Autor

bom, não sei se o seu funcionou, mas eu fiz um aqui bem simples que funciona perfeitamente:

function executeSave()

doSaveServer()

return true

end

function onThink(interval, lastExecution, thinkInterval)

doBroadcastMessage("Server Saved.")

addEvent(executeSave, 1000)

return true

end

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 520.1k

Informação Importante

Confirmação de Termo