• 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 Script in GlobalEvent

Engradiel

Member
Joined
May 3, 2009
Messages
175
Solutions
1
Reaction score
20
Location
Brazil
I use in my globalevents every times that my ot reopen:

function onStartup()
db.executeQuery("DELETE FROM `server_record` WHERE 'record' > 1;")


I need a script that get before this the last timestamp of the record bigger.

Ex: record of players: 37 in db: of this timestamp 19293293 << get this and put in record = 1 and after clean record...

Ex:

local timestamp_last_record = db.getResult("SELECT `timestamp` FROM `server_record` WHERE `record` ORDER BY `record` DESC LIMIT 1;
db.executeQuery("UPDATE `server_record` SET `timestamp` = " .. last_record .. "' WHERE `record` = 1;")

But dont work. I am noob and dont know the programations organitazion and logic.

Can someone help me I am very idiot and begginer in programation... thanks.
 
Back
Top