Whats wrong with that ? all columns like onlinetime1 are still null. no errors in console.
That how loooks my db
Globalevents.xml
Powergamers.lua
That how loooks my db
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: