peonso

Untitled

Oct 10th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. function onThink(interval, lastExecution, thinkInterval)
  2. if getGlobalStorageValue(STORAGE_POWERGAMERS) <= 0 or tonumber(os.date("%d")) ~= getGlobalStorageValue(STORAGE_POWERGAMERS) then
  3. setGlobalStorageValue(STORAGE_POWERGAMERS, (tonumber(os.date("%d"))))
  4. db.executeQuery("UPDATE `znote_players` SET `onlinetime7`=`onlinetime6`, `onlinetime6`=`onlinetime5`, `onlinetime5`=`onlinetime4`, `onlinetime4`=`onlinetime3`, `onlinetime3`=`onlinetime2`, `onlinetime2`=`onlinetime1`, `onlinetime1`=`onlinetimetoday`, `onlinetimetoday`=0;")
  5. db.executeQuery("UPDATE `znote_players` `z` INNER JOIN `players` `p` ON `p`.`id`=`z`.`player_id` SET `z`.`exphist7`=`z`.`exphist6`, `z`.`exphist6`=`z`.`exphist5`, `z`.`exphist5`=`z`.`exphist4`, `z`.`exphist4`=`z`.`exphist3`, `z`.`exphist3`=`z`.`exphist2`, `z`.`exphist2`=`z`.`exphist1`, `z`.`exphist1`=CAST(`p`.`experience` AS SIGNED)-CAST(`z`.`exphist_lastexp` AS SIGNED), `z`.`exphist_lastexp`=`p`.`experience`;")
  6. end
  7. db.executeQuery("UPDATE `znote_players` SET `onlinetimetoday` = `onlinetimetoday` + 60, `onlinetimeall` = `onlinetimeall` + 60 WHERE `player_id` IN (SELECT `id` FROM `players` WHERE `online` = 1)")
  8. return true
  9. end
Advertisement
Add Comment
Please, Sign In to add comment