• 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!

Lua Global event interface [error]

LUA:
db.query("UPDATE `players` SET `online` = 0 WHERE `world_id` = 0;")
or
LUA:
db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = 0;")
Change last 0 to world id of your server, if you've got 1 server it's probably 0 :)
 
i used the bottom one and now it says unexpected symbol near '

LUA:
function onStartup()
	db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = 0;") .. getConfigValue('worldId') .. ";")
	return true
end
 
oh i posted the wrong lua script

this is the one:

LUA:
function onRecord(current, old, cid)
	db.executeQuery("INSERT INTO `server_record` (`record`, `world_id`, `timestamp`) VALUES (" .. current .. ", " .. getConfigValue('worldId') .. ", " .. os.time() .. ");")
	addEvent(doBroadcastMessage, 150, "New record: " .. current .. " players are logged in.", MESSAGE_STATUS_DEFAULT)
end
 
LUA:
function onRecord(current, old, cid)
	db.Query("INSERT INTO `server_record` (`record`, `world_id`, `timestamp`) VALUES (" .. current .. ", " .. getConfigValue('worldId') .. ", " .. os.time() .. ");")
	addEvent(doBroadcastMessage, 150, "New record: " .. current .. " players are logged in.", MESSAGE_STATUS_DEFAULT)
end
 
Back
Top