Joshua Posted October 27, 2009 Posted October 27, 2009 Question Re-Vamp. I'm going to use the Ciggarrettes mod to do the following. When a user Starts Smoking, they will gain 1 or 2 points in a certain userstat. Ciggs will be a bit pricey but not real pricey. Every..Hour? The users stats will drop by 1 or 2. May even do the higher the addiction the more they drop....or raise.. My question would be on the Hour_cron $db->query("UPDATE users SET userstats=userstats-2 WHERE userstats > 0 AND smoking > 0") Would that cron work ? Quote
Danny696 Posted October 27, 2009 Posted October 27, 2009 That would not work, try if($ir['smoking'] >= 1) { $db->query("UPDATE userstats SET strenght=strenght-2 ..... WHERE userid=".$ir['userid'].""); exit; } replace .. with agility, guard, labour and iq Quote
fbiss Posted October 27, 2009 Posted October 27, 2009 That wont work in a cron danny This is untested, but in your hour cron try $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.agility=us.agility-2 WHERE us.agility > 1 AND u.smoking > 0"); of course u can change the agility to a different stat if you want Quote
Joshua Posted October 27, 2009 Author Posted October 27, 2009 I'll give them both a shot. I'm also going to change the cig mod to a Glass of Blood mod for my vampires. But they won't matter whether they start or not. Just going to have their stats drop by 1 or 2 points every hour, as that's what happens when they don't get their Blood. Thanks everyone, appreciate the help. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.