Jump to content
MakeWebGames

Recommended Posts

Posted

Eh you can do that via crons if you want it "simple"

$xx = $db->query("SELECT `userid` FROM `users`");

$x = $db->num_rows($xx);

$rand = rand(1,$x);

$db->query("UPDATE `users` SET `donatordays`=`donatordays`+ An integer here WHERE (`userid` = ".$rand.")");

Slap the above in the day cron and it would auto credit a random user with the donator days you decide.

Granted it's highly simple, but effective.

Posted

@ Joshua - what about the sites that have gaps in the id numbers? "ORDER BY RAND() LIMIT 1" in the query also means your not selecting every id when you only need 1. may also wish to check about fedjail days and laston (as rulerofzu said) don't want someone winning if not online.

item_add() and event_add() to give the user a pack (assuming you have donator packs?) and to tell them they have it and/or what item they won...

edit - http://jan.kneschke.de/projects/mysql/order-by-rand/

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...