plintu Posted June 25, 2009 Posted June 25, 2009 This mod adds effects (speed, pcp, steroids) for example when the user buys some speed and goes to inventory then uses it the get a 100% boost of agility for 15 minutes, pcp is 100% guard and steroids is 100% strength! here is part one: in itemuse.php just below $_GET['ID'] = abs((int) $_GET['ID']); put: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. here is the sql to run: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. then go create the three items just like you would any other item but make sure and name them just like this speed, pcp, steroids, no capitals!!! under the speeds effect1 give it 100% increase agility, under pcp's give it 100% guard, and under steroids give it 100% strength. I charge $5000 for each but of course you can charge whatever you want depending on your games economics. Quote
plintu Posted June 25, 2009 Author Posted June 25, 2009 Re: Effects mod with cron works with v2 Part two: in mainmenu.php just beneath $hc=$set['hospital_count']; $jc=$set['jail_count']; $ec=$ir['new_events']; $mc=$ir['new_mail']; add: $speed=$ir['new_mail']; $pcp=$ir['pcp']; $steroids=$ir['steroids']; then in my game (in main menu.php) I put this just after Logout You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. and here add this to your cron minute!!! You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. well of course this is a free mod but if you like and feel generous with a dollar or two :D my paypal is: [email protected] :D Quote
jds137 Posted June 25, 2009 Posted June 25, 2009 Re: Effects mod with cron works with v2 Great idea. I am sure people will cry, but who cares, good work. Quote
plintu Posted June 25, 2009 Author Posted June 25, 2009 Re: Effects mod with cron works with v2 thank you thank you and I got to give all respects to Haunted Dawg for helping me with the cron I was struggling with that one and he hooked it up :D Quote
eido Posted June 25, 2009 Posted June 25, 2009 Re: Effects mod with cron works with v2 Has anyone tested this mod yet to see if there are any bugs. Quote
Magictallguy Posted June 25, 2009 Posted June 25, 2009 Re: Effects mod with cron works with v2 Just one thing I would change to enable full functionality.. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. becomes You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. I can't be bothered recoding it to my standards, but meh.. xD Quote
RedZone Posted June 30, 2009 Posted June 30, 2009 Re: Effects mod with cron works with v2 This does not work ? :? :? Quote
RedZone Posted June 30, 2009 Posted June 30, 2009 Re: Effects mod with cron works with v2 I fixed it... You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
plintu Posted June 30, 2009 Author Posted June 30, 2009 Re: Effects mod with cron works with v2 you know what guys I forgot about this one I ran across a bug I had to change it to where the effects added a value number like 1 million strength instead of a percentage, then I had to use this cron: $db->query("UPDATE `users` SET speed=speed-1 WHERE `speed` > 0"); $db->query("UPDATE `users` SET steroids=steroids-1 WHERE `steroids` > 0"); $db->query("UPDATE `users` SET pcp=pcp-1 WHERE `pcp` > 0"); $pcp = mysql_query("SELECT `userid` FROM `users` WHERE `pcp` = 1"); while($pcps = mysql_fetch_assoc($pcp)) { $db->query("UPDATE `userstats` SET `guard` = guard-1000000 WHERE `userid` = {$pcps['userid']}"); $db->query("UPDATE `users` SET pcp=0 WHERE `userid` ={$pcps['userid']}"); } //Speed $speed = mysql_query("SELECT `userid` FROM `users` WHERE `speed` = 1"); while($speeds = mysql_fetch_assoc($speed)) { $db->query("UPDATE `userstats` SET `agility` = agility-1000000 WHERE `userid` = {$speeds['userid']}"); $db->query("UPDATE `users` SET speed=0 WHERE `userid` ={$speeds['userid']}"); } //Steroids $steroid = mysql_query("SELECT `userid` FROM `users` WHERE `steroids` = 1"); while($steroids = mysql_fetch_assoc($steroid)) { $db->query("UPDATE `userstats` SET `strength` = strength-1000000 WHERE `userid` = {$steroids['userid']}"); $db->query("UPDATE `users` SET steroids=0 WHERE `userid` ={$steroids['userid']}"); } Quote
RedZone Posted June 30, 2009 Posted June 30, 2009 Re: Effects mod with cron works with v2 you know what guys I forgot about this one I ran across a bug I had to change it to where the effects added a value number like 1 million strength instead of a percentage, then I had to use this cron: $db->query("UPDATE `users` SET speed=speed-1 WHERE `speed` > 0"); $db->query("UPDATE `users` SET steroids=steroids-1 WHERE `steroids` > 0"); $db->query("UPDATE `users` SET pcp=pcp-1 WHERE `pcp` > 0"); $pcp = mysql_query("SELECT `userid` FROM `users` WHERE `pcp` = 1"); while($pcps = mysql_fetch_assoc($pcp)) { $db->query("UPDATE `userstats` SET `guard` = guard-1000000 WHERE `userid` = {$pcps['userid']}"); $db->query("UPDATE `users` SET pcp=0 WHERE `userid` ={$pcps['userid']}"); } //Speed $speed = mysql_query("SELECT `userid` FROM `users` WHERE `speed` = 1"); while($speeds = mysql_fetch_assoc($speed)) { $db->query("UPDATE `userstats` SET `agility` = agility-1000000 WHERE `userid` = {$speeds['userid']}"); $db->query("UPDATE `users` SET speed=0 WHERE `userid` ={$speeds['userid']}"); } //Steroids $steroid = mysql_query("SELECT `userid` FROM `users` WHERE `steroids` = 1"); while($steroids = mysql_fetch_assoc($steroid)) { $db->query("UPDATE `userstats` SET `strength` = strength-1000000 WHERE `userid` = {$steroids['userid']}"); $db->query("UPDATE `users` SET steroids=0 WHERE `userid` ={$steroids['userid']}"); } This still won't work... You can't just put -1 mill. Cause what if the user as 1K strength? Then the cron runs.. Opps strength will be -999,999 Quote
Haunted Dawg Posted June 30, 2009 Posted June 30, 2009 Re: Effects mod with cron works with v2 If your doubling their things. You need to * 2 Quote
plintu Posted July 1, 2009 Author Posted July 1, 2009 Re: Effects mod with cron works with v2 that is why I said"I had to change it to where the effects added a value number like 1 million strength instead of a percentage, .." on the item itself I changed it add 1million then on the cron it would subtract 1million when the time was up ! 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.