Thanks for the mod, I am using this with the ibProArcade.
I added a scheduled task to run every hour but am getting more out of it than I'd like. My goal is to increase the jackpot for every arcade game by 5 every hour. Here's my code.
Code:
$Jackpot = $vbulletin->db->query("SELECT * FROM vBull_games_list");
while($row = $vbulletin->db->fetch_array($Jackpot)) {
$vbulletin->db->query_write("update vBull_games_list set jackpot = jackpot + '5'");
}
Rather than going up by 5, it is increasing by 40. Since I only have 8 games installed right now, it appears to by multiplying 5 x 8; is it running 8 times for each game?
What change should I make to have it only run once per game? Any idea?
Thank you for your time.
EDITED:
Well, this appears to have fixed my problem; I think there is an easier way. I remember doing an update similiar to this once upon a time, but I can't remember how.
Code:
$Game = 0;
$Jackpot = $vbulletin->db->query("SELECT * FROM vBull_games_list");
while($row = $vbulletin->db->fetch_array($Jackpot)) {
$Game = $Game + 1;
$vbulletin->db->query_write("UPDATE vBull_games_list SET jackpot = jackpot + '1' WHERE gid = '$Game' ");
}