p_T_s Posted January 8, 2009 Posted January 8, 2009 I have this setup in my weeklycron.php $db->query("UPDATE users set money=money+1000 WHERE user_level=5"); I need it to send an event to these staff members stating they have received their payment I also want to be able to insert into inventory for these staff members will potions ie (itemid 19) can someone help me as i have tried all night with no luck.. Quote
Dazza Posted January 8, 2009 Posted January 8, 2009 Re: 2 questions event add & insert item Try adding: event_add($_POST['user'],"You were given $1000 from the administration.",$c); Explain abit more your second question, I didnt understand Quote
Haunted Dawg Posted January 8, 2009 Posted January 8, 2009 Re: 2 questions event add & insert item $sel = mysql_query("SELECT userid,username,user_level FROM users WHERE user_level=5"); while($soc = mysql_fetch_assoc($sel)) { mysql_query("UPDATE users SET money=money+1000 WHERE userid=".$soc['userid']); event_add($soc['userid'],"Hello ".$soc['user_name'].", You have been given $1, 000 for being staff. Thank you."); item_add($soc['userid'],19,1); } Quote
p_T_s Posted January 8, 2009 Author Posted January 8, 2009 Re: 2 questions event add & insert item thx guys but they dont work... $sel = mysql_query("SELECT userid,username,user_level FROM users WHERE user_level=5"); while($soc = mysql_fetch_assoc($sel)) { mysql_query("UPDATE users SET money=money+1000 WHERE userid=".$soc['userid']); event_add($soc['userid'],"Hello ".$soc['user_name'].", You have been given $1, 000 for being staff. Thank you."); item_add($soc['userid'],19,1); } this one pays the $1000 but no event and not item 19 $db->query("UPDATE users set money=money+20000 WHERE user_level=5"); event_add($_POST['user'],"You were given $1000 from the administration.",$c); and this one dosn't do either (no money or event) Quote
Haunted Dawg Posted January 8, 2009 Posted January 8, 2009 Re: 2 questions event add & insert item Sorry. I now know why mine does not work. Use this: $sel = mysql_query("SELECT userid,username,user_level FROM users WHERE user_level=5"); while($soc = mysql_fetch_assoc($sel)) { include_once("global_func.php"); mysql_query("UPDATE users SET money=money+1000 WHERE userid=".$soc['userid']); event_add($soc['userid'],"Hello ".$soc['user_name'].", You have been given $1, 000 for being staff. Thank you."); item_add($soc['userid'],19,1); } Quote
p_T_s Posted January 8, 2009 Author Posted January 8, 2009 Re: 2 questions event add & insert item thx killah works great now :-D 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.