• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

As I change the save to blue.

Eduardo170

Well-Known Member
Joined
Jan 7, 2014
Messages
422
Solutions
3
Reaction score
66
Location
Caracas, Venezuela
Hello Comunity, As I change the save to blue.


Code:
local config = {
    broadcast = {120, 30},
    flags = 13,
    delay = 120,
    events = 30
}

local function executeSave(seconds)
    if(isInArray(config.broadcast, seconds)) then
        doBroadcastMessage("Server save within " .. seconds .. " seconds, please mind it may freeze!")
    end

    if(seconds > 0) then
        addEvent(executeSave, config.events * 1000, seconds - config.events)
    else
        doSaveServer(config.flags)
    end
end

function onThink(interval)
    if(table.maxn(config.broadcast) == 0) then
        doSaveServer(config.flags)
    else
        executeSave(config.delay)
    end

    return true
end



I have this and use this but not working

Code:
doBroadcastMessage("Server save within " .. seconds .. " seconds, please mind it may freeze!", 26)

Code:
MESSAGE_STATUS_CONSOLE_RED = 17
MESSAGE_STATUS_CONSOLE_ORANGE = 19
MESSAGE_STATUS_WARNING = 20
MESSAGE_EVENT_ADVANCE = 21
MESSAGE_EVENT_DEFAULT = 22
MESSAGE_STATUS_DEFAULT = 23
MESSAGE_INFO_DESCR = 24
MESSAGE_STATUS_SMALL = 25
MESSAGE_STATUS_CONSOLE_BLUE = 26


Code:
MESSAGE_STATUS_CONSOLE_RED -- Aparece solo en el LOG en Rojo.
MESSAGE_EVENT_ORANGE -- Aparece solo en el DEFAULT en Naranja.
MESSAGE_STATUS_CONSOLE_ORANGE -- Aparece solo en el DEFAULT en Naranja.
MESSAGE_STATUS_WARNING -- Aparece en la PARTE CENTRAL de la PANTALLA y en el SERVER LOG en Rojo.
MESSAGE_EVENT_ADVANCE -- Aparece en la PARTE CENTRAL de la PANTALLA y en el SERVER LOG en Blanco.
MESSAGE_EVENT_DEFAULT -- Aparece en la PARTE INFERIOR de la PANTALLA y en el SERVER LOG en Blanco.
MESSAGE_STATUS_DEFAULT -- Aparece en la PARTE INFERIOR de la PANTALLA y en el SERVER LOG en Blanco.
MESSAGE_INFO_DESCR -- Aparece en la PARTE CENTRAL de la PANTALLA y en el SERVER LOG en Verde.
MESSAGE_STATUS_SMALL -- Aparece solo en la PARTE INFERIOR de la PANTALLA en Blanco.
MESSAGE_STATUS_CONSOLE_BLUE -- Aparece solo en el DEFAULT en Azul.
 
Code:
local players = getOnlinePlayers()
if players ~= nil and #players > 0 then
    for k = 1, #players do
        doPlayerSendTextMessage(players[k], MESSAGE_STATUS_CONSOLE_BLUE, "message")
    end
end

doBroadcastMessage is always RED msg sent to all online players. For other msg colors you have to use doPlayerSendTextMessage and a short script to repeat this function for all online players.
 
Back
Top