Jump to content
MakeWebGames

Recommended Posts

Posted

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.

Posted

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

Posted

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

Posted

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

Posted

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']}");

}

Posted

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

Posted

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 !

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...