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

Frag cleaner

4Muki4

HOROHOROHORO
Joined
May 1, 2012
Messages
757
Reaction score
70
Hello,
im searching for a script that cleans all frags every 24h from players
tfs 0.4 ref 3777
 
Last edited:
Removed.. Nah wont work :D

Not Really Sure if it gonna work or not.. not expert with queries
--Edit.. dont forget to add in globalevent with time of 23:59:00
 
Code:
local players = db.getResult("SELECT `id` FROM `players`;")
local k = 0
if players:getID() ~= -1 then
    repeat
        k = k + 1
        db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. k .. ")")
    until not players:next()
    players:free()
end

To execute script on midnight 00:00, you can add specific time in globalevents.xml or use this LUA code (if you wont use globalevents):
Code:
local hour = os.date("%H")
local minute = os.date("%M")
if hour == "00" and minute == "00" then
 
Back
Top