Uptime: '.$config['status']['serverStatus_uptime'].'
setGlobalStorageValue(7832, getGlobalStorageValue(7832)+1)
w creaturescripts.xml dodaj linijkefunction onLogout(cid)
setGlobalStorageValue(7832, getGlobalStorageValue(7832)-1)
return true
end
<event type="logout" name="logout" event="script" value="logout.lua"/>
function onThink(interval, lastExecution)
local online = getGlobalStorageValue(7832) + 1
local name = getConfigValue('serverName')
if online > 1 then
doBroadcastMessage("Currently " .. online .. " players are online on " .. name .. "!" , 22)
end
if online == 1 then
doBroadcastMessage("Currently " .. online .. " player is online on " .. name .. "!" , 22)
end
if online < 1 then
doBroadcastMessage("Currently no one is online on " .. name .. "!" , 22)
end
return true
end
<globalevent name="online" interval="5000" event="script" value="online.lua"/>
local messages = {
}
local text = {
[1] = "Graczy online: [COLOR="Red"]xxx[/COLOR]. UpTime OTS: [COLOR="Cyan"]xxx[/COLOR]. ",
[2] = "Inne info.",
}
function onThink(interval, lastExecution)
doBroadcastMessage("Informacja: "..text[math.random(1,2)])
return TRUE
end
#getPlayersOnline()
local tmp = getWorldUpTime()
local hours = math.ceil(tmp / 3600) - 1
local minutes = math.ceil((tmp - (3600 * hours)) / 60)
if(minutes == 60) then
minutes = 0
hours = hours + 1
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Uptime: " .. hours .. " hours and " .. minutes .. " minutes.")
Notka moderatorska: |
+1 pkt OT Expert |