yaz123 Posted February 5, 2009 Posted February 5, 2009 Hi, I'm new to coding, I have made a mod/update really but it doesn't really work this is my 3rd mod i have made the first two have been successful but this one is a much bigger step seen as thought it is using $_GET['action']. I have tried my hardest to make this update, But iv given up. I would really appreciate if you would comment about the idea and try even fix the mod, Also i don't really know how to send a event to all the online users, I'm sure if someone can fix/add this therefore i can look at my mistakes and correct them for future coding. Well All i have to say, Here it is (Sorry if this mod has Already been made) Save as staff_rewards.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Open Smenu.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
John99 Posted February 5, 2009 Posted February 5, 2009 Re: Reward the active! Reward The Active! Should be Reward The Active! Quote
Karlos Posted February 5, 2009 Posted February 5, 2009 Re: Reward the active! File (Without Events) You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Link You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Dave Posted February 5, 2009 Posted February 5, 2009 Re: Reward the active! Nice mod yaz :mrgreen: Quote
Lithium Posted February 5, 2009 Posted February 5, 2009 Re: Reward the active! I would really appreciate if you would comment about the idea and try even fix the mod, Also i don't really know how to send a event to all the online users, I'm sure if someone can fix/add this therefore i can look at my mistakes and correct them for future coding. function reward_the_active_sub() { global $db,$ir,$c,$h; $money=$db->escape($_POST['money']); $crystals=$db->escape($_POST['crystals']); $x = $db->query("SELECT userid FROM users WHERE laston>unix_timestamp-900"); while($y = mysql_fetch_array($x)) { $db->query("UPDATE users SET money=money+$money WHERE userid = {$y['userid']}"); $db->query("UPDATE users SET crystals=crystals+$crystals WHERE userid = {$y['userid']}"); event_add($y['userid'],"message here",$c); } print "The online users have been credited!"; } This is just a quick draw but it might work giving the event to the user Quote
Hash-Op Posted February 5, 2009 Posted February 5, 2009 Re: Reward the active! Note: If your going to reward the active users, the game will just become boring / easy There'll be more cash / crystals / items in circulation..so yah..crap basically Nice addon, but think about things before you use it Quote
yaz123 Posted February 5, 2009 Author Posted February 5, 2009 Re: Reward the active! Note: If your going to reward the active users, the game will just become boring / easy There'll be more cash / crystals / items in circulation..so yah..crap basically Nice addon, but think about things before you use it I'd just like to say this mod is not crap basically because how would they be a lot of money / crystals into the game? There is no automatic time where it gives money/crystals your responsible of giving it out.. I would only use this add on one's in a while not like everyday - Also i wouldn't just raid the game with all the free money or crystals!! Quote
Miniman Posted February 5, 2009 Posted February 5, 2009 Re: Reward the active! Note: If your going to reward the active users, the game will just become boring / easy There'll be more cash / crystals / items in circulation..so yah..crap basically Nice addon, but think about things before you use it I'd just like to say this mod is not crap basically because how would they be a lot of money / crystals into the game? There is no automatic time where it gives money/crystals your responsible of giving it out.. I would only use this add on one's in a while not like everyday - Also i wouldn't just raid the game with all the free money or crystals!! New game: Raise your hand if your offended by a tiny bit of advise. Note: Yaz, If you don't raise your hand, Your going to lose. Quote
John99 Posted February 5, 2009 Posted February 5, 2009 Re: Reward the active! function reward_the_active_sub() { global $db,$ir,$c,$h; $money=$db->escape($_POST['money']); $crystals=$db->escape($_POST['crystals']); $x = $db->query("SELECT userid FROM users WHERE laston>unix_timestamp-900"); while($y = mysql_fetch_array($x)) { $db->query("UPDATE users SET money=money+$money WHERE userid = {$y['userid']}"); $db->query("UPDATE users SET crystals=crystals+$crystals WHERE userid = {$y['userid']}"); event_add($y['userid'],"message here",$c); } print "The online users have been credited!"; } This is just a quick draw but it might work giving the event to the user I don't think v2 query's end with ,$c if im right.. And how come $db->escape where posting crystals? and money.. Quote
Dave Posted February 5, 2009 Posted February 5, 2009 Re: Reward the active! If i recall correctly $c is the connection to the server. (Im proberly wrong ;)) 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.