
Godhand
Members-
Posts
448 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by Godhand
-
I was trying to brain storm and make it so users couldn't do tons of damage just because of strength. I wondered if another stat (such as levels) could be thrown into this part if($mydamage >3000) { $mydamage=3000; } else if($mydamage <100) { $mydamage=100; I tried doing $youdata['level'] but it was getting an unexpected "]" symbol. I don't want high strength to be the 'end factor' just the starting factor to require players to be more strategic with their stat build being I'll make a new stat up and post it here for everyone else to install once someone points me in the right direction to look for this.
-
Re: Money Gym Well you have a problem in your header.php then on line 136. Open up notepad and do edit- go to-plug in line 136 And the error within mgym.php is $h->userdata($ir,$lv,$fm); unless you customized it. To fix it just compare with other codes and see what the difference is. I'm just pointing to a general direction.
-
I was adding in features in the game adding in 2 extra donator crons in my five min cron to find that my cron day file decided to stop working. No output just isn't working. I haven't done anything in that file itself in a while. <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $db->query("UPDATE fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } $db->query("DELETE FROM fedjail WHERE fed_days=0"); $db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); $db->query("UPDATE users SET daysold=daysold+1, boxes_opened=0"); $db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0"); $db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); $db->query("UPDATE users SET cdays=1 WHERE course > 0 AND cdays<-1"); $db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney*(2/100)) WHERE bankmoney>0"); $db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney*(8/100)) WHERE cybermoney>0"); $db->query("UPDATE users SET donatorcrystalbank=donatorcrystalbank+(donatorcrystalbank*(1/10)) WHERE donatorcrystalbank>0"); $db->query("UPDATE users SET ultramoney=ultramoney+(ultramoney*(30/100)) WHERE ultramoney>0"); $db->query("UPDATE users SET dmoney=dmoney+(dmoney*(14/100)) WHERE dmoney>0"); $q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0"); while($r=$db->fetch_row($q)) { $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})"); $upd=""; $ev=""; if($coud['crSTR'] > 0) { $upd.=",us.strength=us.strength+{$coud['crSTR']}"; $ev.=", {$coud['crSTR']} strength"; } if($coud['crGUARD'] > 0) { $upd.=",us.guard=us.guard+{$coud['crGUARD']}"; $ev.=", {$coud['crGUARD']} guard"; } if($coud['crLABOUR'] > 0) { $upd.=",us.labour=us.labour+{$coud['crLABOUR']}"; $ev.=", {$coud['crLABOUR']} labour"; } if($coud['crAGIL'] > 0) { $upd.=",us.agility=us.agility+{$coud['crAGIL']}"; $ev.=", {$coud['crAGIL']} agility"; } if($coud['crIQ'] > 0) { $upd.=",us.IQ=us.IQ+{$coud['crIQ']}"; $ev.=", {$coud['crIQ']} IQ"; } $ev=substr($ev,1); if ($upd) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid"); } $db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')"); } $db->query("UPDATE users SET course=0 WHERE cdays=0"); $db->query("TRUNCATE TABLE votes;");
-
Re: Money Gym erm... I'd rather not add a money gym to my game I was just looking over. Also looks like it has another glitch though that I noticed (wouldn't output an error message) It will subtract 1 money not the number of times trained. Also note- if someone trains too much (say maybe 500 for good players) that could cause some major lag in your server. You might want to do the money/50 or something (scale) to keep it 'limited' and make the money update money-timestrained*scale (obviously its not in code so don't think its the exact function). I'm just using constructive criticism to help make it better. I'm not trying to be a jerk about it sorry if I am sounding like one.
-
Re: Money Gym wouldn't just changing money_formatter() to moneyy_formatter() work in this case? The reason I'm asking is because that is the same thought how the market glitch was removed.
-
Re: v2 Gym problem lol the reason it was posted like that was because I was trying to figure out other ways and I 'forgot' to check that. But thanks for the clarification. At least now I understand why I went wrong.(edit: there it doesn't restore the will) <?php $macropage="superdgym.php"; include "globals.php"; if ($ir['donatordays'] <= 400) die("Super donators only"); $statnames=array( 'Strength' => 'strength', 'Agility' => 'agility', 'Guard' => 'guard', 'Labour' => 'labour'); $_POST['amnt']=abs((int) $_POST['amnt']); if(!$ir['jail']) { print "<h3> Donator super Gym</h3><hr />"; } else { print "<h3>Donator Jail super Gym</h3><hr />"; } if($_POST['stat'] && $_POST['amnt']) { $stat=$statnames[$_POST['stat']]; if(!$stat) { die("This stat cannot be trained."); } if($_POST['amnt'] > $ir['energy']) { print("You do not have enough energy to train that much.<hr />"); } else { $gain=0; for($i=0; $i<$_POST['amnt']; $i++) { $gain+=rand(1,3)/rand(7550,14850)*rand(7949,8051)*(($ir['will']*1.7+15000)/300); $ir['will']-=rand(1,3); if($ir['will'] < 500) { $gain+=rand(1,3)/rand(7550,14850)*rand(7949,8051)*((500*1.7+15000)/300); ; } if($ir['will'] < 0) { $ir['will']=0; } } if($ir['jail']) { $gain/=2; } $db->query("UPDATE `userstats` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid"); $db->query("UPDATE `users` SET `exp` = (`exp`+$gain/20) WHERE `userid` = $userid"); $db->query("UPDATE `users` SET `will` = {$ir['will']}, energy = energy - {$_POST['amnt']} WHERE `userid` = $userid"); $inc=$ir[$stat]+$gain; $inc2=$ir['energy']-$_POST['amnt']; if($stat=="strength") { print "You begin lifting some weights. You have gained {$gain} strength by doing {$_POST['amnt']} sets of weights. You now have {$inc} strength and {$inc2} energy left."; } elseif($stat=="agility") { print "You begin running on a treadmill. You have gained {$gain} agility by doing {$_POST['amnt']} minutes of running. You now have {$inc} agility and {$inc2} energy left."; } elseif($stat=="guard") { print "You jump into the pool and begin swimming. You have gained {$gain} guard by doing {$_POST['amnt']} minutes of swimming. You now have {$inc} guard and {$inc2} energy left."; } elseif($stat=="labour") { print "You walk over to some boxes filled with gym equipment and start moving them. You have gained {$gain} labour by moving {$_POST['amnt']} boxes. You now have {$inc} labour and {$inc2} energy left."; } print "<hr />"; $ir['energy']-=$_POST['amnt']; $ir[$stat]+=$gain; } } $ir['strank']=get_rank($ir['strength'],'strength'); $ir['agirank']=get_rank($ir['agility'],'agility'); $ir['guarank']=get_rank($ir['guard'],'guard'); $ir['labrank']=get_rank($ir['labour'],'labour'); print "Choose the stat you want to train and the times you want to train it. You can train up to {$ir['energy']} times.<hr /> <form action='superdgym.php' method='post'> Stat: <select type='dropdown' name='stat'> <option style='color:red;' value='Strength'>Strength (Have {$ir['strength']}, Ranked {$ir['strank']}) <option style='color:blue;' value='Agility'>Agility (Have {$ir['agility']}, Ranked {$ir['agirank']}) <option style='color:green;' value='Guard'>Guard (Have {$ir['guard']}, Ranked {$ir['guarank']}) <option style='color:brown;' value='Labour'>Labour (Have {$ir['labour']}, Ranked {$ir['labrank']}) </select> Times to train: <input type='text' name='amnt' value='{$ir['energy']}' /> <input type='submit' value='Train' /></form>"; $h->endpage(); ?> if you name the file superdgym.php of course if you rename it make the changes that are according to the name. Thanks for the help. +1 to both of you for clarifying
-
I was trying to make a new gym for donators with more than 400 donator days I kept getting: Parse error: syntax error, unexpected '<' in /home/site/my_html/superdgym.php on line 4 <?php $macropage="superdgym.php"; include "globals.php"; if($ir['donatordays']=>400) die("Donators only"); $statnames=array( 'Strength' => 'strength', 'Agility' => 'agility', 'Guard' => 'guard', 'Labour' => 'labour'); $_POST['amnt']=abs((int) $_POST['amnt']); if(!$ir['jail']) { print " Donator Gym"; } else { print "Donator Jail Gym"; } if($_POST['stat'] && $_POST['amnt']) { $stat=$statnames[$_POST['stat']]; if(!$stat) { die("This stat cannot be trained."); } if($_POST['amnt'] > $ir['energy']) { print("You do not have enough energy to train that much."); } else { $gain=0; for($i=0; $i<$_POST['amnt']; $i++) { $gain+=rand(1,3)/rand(6550,(9850)*rand(5949,8051)*(($ir['will']*1.3+11000)/200); $ir['will']-=rand(1,3); if($ir['will'] < 1000) { $ir['will']=1000; } } if($ir['jail']) { $gain/=2; } $db->query("UPDATE `userstats` SET `{$stat}` = `{$stat}` + $gain WHERE `userid` = $userid"); $db->query("UPDATE `users` SET `will` = {$ir['will']}, energy = energy - {$_POST['amnt']} WHERE `userid` = $userid"); $inc=$ir[$stat]+$gain; $inc2=$ir['energy']-$_POST['amnt']; if($stat=="strength") { print "You begin lifting some weights. You have gained {$gain} strength by doing {$_POST['amnt']} sets of weights. You now have {$inc} strength and {$inc2} energy left."; } elseif($stat=="agility") { print "You begin running on a treadmill. You have gained {$gain} agility by doing {$_POST['amnt']} minutes of running. You now have {$inc} agility and {$inc2} energy left."; } elseif($stat=="guard") { print "You jump into the pool and begin swimming. You have gained {$gain} guard by doing {$_POST['amnt']} minutes of swimming. You now have {$inc} guard and {$inc2} energy left."; } elseif($stat=="labour") { print "You walk over to some boxes filled with gym equipment and start moving them. You have gained {$gain} labour by moving {$_POST['amnt']} boxes. You now have {$inc} labour and {$inc2} energy left."; } print ""; $ir['energy']-=$_POST['amnt']; $ir[$stat]+=$gain; } } $ir['strank']=get_rank($ir['strength'],'strength'); $ir['agirank']=get_rank($ir['agility'],'agility'); $ir['guarank']=get_rank($ir['guard'],'guard'); $ir['labrank']=get_rank($ir['labour'],'labour'); print "Choose the stat you want to train and the times you want to train it. You can train up to {$ir['energy']} times. Stat: Strength (Have {$ir['strength']}, Ranked {$ir['strank']}) Agility (Have {$ir['agility']}, Ranked {$ir['agirank']}) Guard (Have {$ir['guard']}, Ranked {$ir['guarank']}) Labour (Have {$ir['labour']}, Ranked {$ir['labrank']}) Times to train: "; $h->endpage(); ?>
-
Re: throw an object at the top poster *comes back as a ghost then gets redeyes afro bots to turn on redeye then has the bots rip out one of redeye's arm and have them give it to me after which I throw the arm at redeye.
-
Re: Site check (V 2 ) Thank you. I know some of the users want it to be like a black color. I also know that I don't like the contrast on the colors they chose.
-
Re: Site check (V 2 ) Erm... so would any of the *good* coders preferably check? I have my forums patched up. I deleted my installer file also.
-
There are some users in my game that can't get mail sent to them. They also are not listed in my userlist.php file. So I'm sure my user list is fine. Any ideas what could have went wrong?
-
Re: Need help.. Got hacked? You could try to make a banned iplist php page and add all the banned ips to it. And make requirement before logging in and install it in your database. but.... that is for other coders/ game owners to worry about as soon as some one comes up with that one =)
-
Re: Need help.. Got hacked? Well make the installer file again (obviously) print "What are you trying to do HACK the game?"; $db->query("UPDATE users SET fedjail=9000,bankmoney=0 WHERE userid=$userid"); $db->query("UPDATE fedjail SET fed_days='90000',fed_reason='Attempted to hack the game',fed_jailedby='Systemantihackingtools' WHERE userid=$userid"); This I *believe* will fed them and leave them a message =P. If not it will make installer.php not work which will be rather funny anyways.
-
Re: SPECIAL ATTACK abusive
-
Re: Need help.. Got hacked? What you could do (for laughs) is leave a message for them on the installer and change all the info to installer to negate it to be harmless.
-
Re: throw an object at the top poster *sends afroman at O.J to distract him. Then steals Jesse's wallet back and takes a few dollar bills out for a tip. Then walks up near Jesse and tosses Jesse the wallet back* lmao
-
Re: Need help.. Got hacked? Step one- fix your config.php to what it was before. If that don't save- delete config.php and then make a new config.php that is right. =) It has happened to me also and well thats what I did to fix it so I could log in. I'd recommend switching your database name/ password though in your cpanel. I'll help a little bit more too even. <?php $_CONFIG = array( 'hostname' => 'localhost', 'username' => 'yourdatabasename_youruser', 'password' => 'hopeyouknowyourownpassword', 'database' => 'yourdatabasename_Main', 'persistent' => 0, 'driver' => 'mysql', 'code' => 'your code here' ); ?>
-
Re: throw an object at the top poster *steals the book from O.J and throws it at Jesse to catch and read it*
-
Re: If you could be me for a day wonder why beans
-
Re: If you could be me for a day Say amen to that.
-
Re: (v2 attack.php question) Thank you there was just one snag I fixed it though its if(($odata['hp'] < ($odata['maxhp'] / 2)) && $_SESSION['attacking'] == 0) { print "You cannot attack a player until they have 1/2 their max health. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; I figured since you posted its probably a free mod but that will patch up the error message I got since } was already taken care of. Also it is what I wanted coded I just thought it would be a little different.
-
Re: THIS OR THAT? cough Rock or Country
-
I have installed a function that defines if hp is under a certain value that it cancels an attack. (the knocked out code) But my question is how would this be coded properly? $_GET['nextstep']=1 some statement here if($odata['hp'] <= ($odata['maxhp'])/3) { print "Wait till their hp is above one third of their max to bother to attack them [url='index.php']> Back[/url]"; What would that statement be so it could include this?
-
Re: THIS OR THAT? Google Nintendo 64 or Playstation 1
-
Re: SPECIAL ATTACK rude