• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Powergamers TFS 1.0

Szmycu

Tibiaservers.net
Joined
Sep 2, 2008
Messages
65
Reaction score
6
Location
Poland
Whats wrong with that ? all columns like onlinetime1 are still null. no errors in console.

That how loooks my db

tabela.jpg



tabela.jpg



Globalevents.xml
PHP:
<globalevent name="powergamers" interval="60" script="others/powergamers.lua"/>

Powergamers.lua
PHP:
function onThink(interval, lastExecution)
    if (tonumber(os.date("%d")) ~= getGlobalStorageValue(23456)) then
        setGlobalStorageValue(23456, (tonumber(os.date("%d"))))
        db.query("UPDATE `players` SET `onlinetime7`=`onlinetime6`, `onlinetime6`=`onlinetime5`, `onlinetime5`=`onlinetime4`, `onlinetime4`=`onlinetime3`, `onlinetime3`=`onlinetime2`, `onlinetime2`=`onlinetime1`, `onlinetime1`=`onlinetimetoday`, `onlinetimetoday`=0;")
        db.query("UPDATE `players` SET `exphist7`=`exphist6`, `exphist6`=`exphist5`, `exphist5`=`exphist4`, `exphist4`=`exphist3`, `exphist3`=`exphist2`, `exphist2`=`exphist1`, `exphist1`=`experience`-`exphist_lastexp`, `exphist_lastexp`=`experience`;")
      
    end
    db.query("UPDATE `players`, `players_online` SET `onlinetimetoday`=`onlinetimetoday`+60, `onlinetimeall`=`onlinetimeall`+60 WHERE `players_online`.`player_id` LIKE  '%';")
    return TRUE
end
 
Last edited:
Back
Top