Jump to content
MakeWebGames

Strats

Members
  • Posts

    649
  • Joined

  • Last visited

    Never

Everything posted by Strats

  1. Re: [mccodes V2] Add any type of video media to your game Looking good can't wait to try it out
  2. Re: [mccode v2] Enhanced Hall of fame COMPLETED! This is nice. But why do some people show up twice on strength and total stats? Is it just cause I don't have many players at the moment?
  3. Re: [mccode v2] Estate Recode Extra Bump Lol
  4. Re: Will Refills To Quickly/ Job Cron I think we tried that last time and the crons stopped running lol My 5 Min Crons :   <?php include_once (DIRNAME(__FILE__) . '/config.php'); global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { echo 'No Access'; exit; } define("MONO_ON", 1); include_once (DIRNAME(__FILE__) . '/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; $Set = array(); $SelectSettings = $db->query("SELECT `conf_name`, `conf_value` FROM `settings`"); while($r = $db->fetch_row($SelectSettings)) { $Set[$r['conf_name']] = $r['conf_value']; } $db->query("UPDATE `users` SET `brave`=LEAST(`brave`+((`maxbrave`/'10')+'0.5'), `maxbrave`), `hp`=LEAST(`hp`+(`maxhp`/'3'), `maxhp`), `will`=LEAST((`will`+'10'), `maxwill`), `energy`=IF(`donatordays`<>'0', LEAST(`energy`+(`maxenergy`/'6'), `maxenergy`), LEAST(`energy`+(`maxenergy`/'12.5'), `maxenergy`))"); if($Set['validate_period'] == '5' && $Set['validate_on']) { $db->query("UPDATE `users` SET `verified`='0'"); } if($Set['validate_period'] == '15' && $Set['validate_on'] && in_array(date('i'), array('00', '15', '30', '45'))) { $db->query("UPDATE `users` SET `verified`='0'"); } ?>   Will I use UPDATE users SET will = will + (maxwill/10) WHERE will < maxwill Instead of `will`=LEAST((`will`+'10'), `maxwill`)
  5. Re: Help with auto ipn I brought this too, Your order has been verified and your download link is as follows: *************** Here is your support link, do not lose it or you will no longer be able to receive support: ************   I had no trouble with this mod :) And I buy lots of things from Cronus, I have only had one problem with one of his mods and It was a problem with my own crons. After a while he explained things to me better about the mod and the crons so I could work it.
  6. For some reason when people buy or sell a house it refills in mins can some show me an example of hot to change so maybe it refills 10% every 5 mins Also for some reason I do not have a job cron lol, It seems to have gone :? Can some tell me the basic job cron? For daycron.php
  7. Re: [mccode v2] View User Sorry to bring an old topic up. I really like this user profile idea, as some can get cluttered. I am re doing this slightly to make it so you can travel straight to someone's location and make it so it shows if you are married. But there's a couple things I am un sure of, Like I am not sure about how I change how the money shows. On this profile it shows money as : $/93954 Also I cannot remove the top of the profile where it says Level, I moved level down a bit instead. But when I try to remove the bit at the top it wont work. Here's my updated version :   <?php include "globals.php"; //Sniko Made This //Free Mod $_GET['u'] = abs((int) $_GET['u']); if(!$_GET['u']) { print "Invalid use of file"; } else { $q=$db->query("SELECT u.*,us.*,c.*,h.*,g.*,f.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN cities c ON u.location=c.cityid LEFT JOIN houses h ON u.maxwill=h.hWILL LEFT JOIN gangs g ON g.gangID=u.gang LEFT JOIN fedjail f ON f.fed_userid=u.userid WHERE u.userid={$_GET['u']}"); if($db->num_rows($q) == 0) { print "Sorry, we could not find a user with that ID, check your source."; } else { $r=$db->fetch_row($q); if($r['user_level'] == 1) { $userl="Member"; } else if($r['user_level'] == 2) { $userl="Admin"; } else if ($r['user_level'] == 3) { $userl="Secretary"; } else if($r['user_level'] == 0) { $userl="NPC"; } else {$userl="Assistant"; } $lon=($r['laston'] > 0) ?date('F j, Y g:i:s a',$r['laston']) : "Never"; $sup=date('F j, Y g:i:s a',$r['signedup']); $ts=$r['strength']+$r['agility']+$r['guard']+$r['labour']+$r['IQ']; $d=""; if($r['laston'] > 0) { $la=time()-$r['laston']; $unit="seconds"; if($la >= 60) { $la=(int) ($la/60); $unit="minutes"; } if($la >= 60) { $la=(int) ($la/60); $unit="hours"; if($la >= 24) { $la=(int) ($la/24); $unit="days"; } } $str="$la $unit ago"; } else { $str="--"; } if($r['last_login'] > 0) { $ll=time()-$r['last_login']; $unit2="seconds"; if($ll >= 60) { $ll=(int) ($ll/60); $unit2="minutes"; } if($ll >= 60) { $ll=(int) ($ll/60); $unit2="hours"; if($ll >= 24) { $ll=(int) ($ll/24); $unit2="days"; } } $str2="$ll $unit2 ago"; } else { $str2="--"; } if($r['donatordays']) { $r['username'] = "<font color=red>{$r['username']}</font>";$d="[img=donator.gif]"; } if ($r['married']) { $query = "SELECT `username`, `userid` FROM `users` WHERE `userid` = '{$r['married']}'"; $par = mysql_fetch_array(mysql_query($query)); $partner = "[url='viewuser.php?u={$par[']<font color='green'>{$par['username']}</font>[/url]"; } if($r['laston'] >= time()-15*60) { $on="<font color=green>[b]Online[/b]</font>"; } else { $on="<font color=red>[b]Offline[/b]</font>"; } print "<h3>Profile for {$r['username']}</h3> <TABLE STYLE='width:476px;height:280px;border:0px 0px 0px 1px;border-style:solid;border-color:#DBDBDB;' BORDER='0' CELLPADDING='0' CELLSPACING='0'> <TR STYLE='background-color:#000000'> <TD STYLE='width:50px;padding:0px 2px;text-align:right;'> </TD> </TR> <TR> <TD COLSPAN='2' STYLE='background-color:#088A4B;padding:4px 5px 4px 5px;'> <TABLE STYLE='width:100%;height:247px;' BORDER='0'> <TR VALIGN='TOP'> <TD BGCOLOR='#EBE9EA'>Level : </TD> <TD BGCOLOR='#EBE9EA' COLSPAN='2'>[b]{$r['level']}[/b]</TD> </TR> <TR VALIGN='TOP'> <TD ROWSPAN='6' STYLE='width:80px;align:right;'> [img={$r[]</A> <CENTER>{$r['username']}</CENTER> </TD> </TR> <TR VALIGN='TOP'> <TR VALIGN='TOP'> <TD>Name : </TD> <TD>[b]{$r['username']} [{$r['userid']}] $d[/b]</TD> </TR> <TR VALIGN='TOP'> <TD>Userlevel : </TD> <TD>[b]$userl[/b]</TD> </TR> <TR VALIGN='TOP'> <TD>Level : </TD> <TD>[b]{$r['level']}[/b]</TD> </TR> <TR VALIGN='TOP'> <TD>Online : </TD> <TD>[b]$on[/b]</TD> </TR> <TR VALIGN='TOP'> <TD>Crystals : </TD> <TD>[b]{$r['crystals']}[/b]</TD> </TR> <TR VALIGN='TOP'> <TD>Property : </TD> <TD>[b]{$r['hNAME']}[/b]</TD> </TR> <TR VALIGN='TOP'> <TD>Gang : </TD>"; if($r['gang']) { print "<TD>[b][url='gangs.php?action=view&ID={$r[']{$r['gangNAME']}[/url][/b]</TD>"; } else { print "<TD>[b]N/A[/b]</TD>"; } PRINT " </TR> <TR VALIGN='TOP'> <TD>Location : </TD> <TD>[b]{$r['cityname']} [[url='monorail.php?to={$r[']Travel[/url]][/b]</TD> </TR> <TR VALIGN='TOP'> <TD>Days Old : </TD> <TD>[b]{$r['daysold']}[/b]</TD> </TR> <TR VALIGN='TOP'> <TD>Gender : </TD> <TD>[b]{$r['gender']}[/b]</TD> </TR> <TR VALIGN='TOP'> <TD>Money : </TD> <TD>[b]$/{$r['money']}[/b]</TD> </TR> <TR VALIGN='TOP'> <TD>Married : </TD> <TD>[b]$partner[/b]</TD> </TR> <TR VALIGN='TOP'> <TD>Health : </TD> <TD>[b]{$r['hp']} / {$r['maxhp']}[/b]</TD> </TR> <TR VALIGN='TOP'> <TD>Hospital Time : </TD> <TD>[b]{$r['hospital']}[/b]</TD> </TR> <TR VALIGN='TOP'> <TD>Jail Time : </TD> <TD>[b]{$r['jail']}[/b]</TD> </TR> <TR><TD COLSPAN='3' STYLE='background-color:#DBDBDB;height:2px;'></TD></TR> <TR VALIGN='TOP'> <TD>Violent Actions : </TD> <TD>[b] [url='vactions.php?userid={$r[']View Actions[/url] [/b]</TD> </TR> <TR VALIGN='TOP'> <TD>Contact Actions : </TD> <TD>[b][url='cactions.php']View Actions[/url]</TD> </TR> </TABLE>"; if($ir['user_level'] == 2 || $ir['user_level'] == 3 || $ir['user_level'] == 5) { $r['lastiph']=@gethostbyaddr($r['lastip']); $r['lastiph']=checkblank($r['lastiph']); $r['lastip_loginh']=@gethostbyaddr($r['lastip_login']); $r['lastip_loginh']=checkblank($r['lastip_loginh']); $r['lastip_signuph']=@gethostbyaddr($r['lastip_signup']); $r['lastip_signuph']=checkblank($r['lastip_signuph']); print "<h3>Internet Info</h3><table width='100%' border='0' cellspacing='1' class='table'> <tr><td></td><td class='h'>IP</td><td class='h'>Hostname</td></tr> <tr><td class='h'>Last Hit</td><td>$r[lastip]</td><td>$r[lastiph]</td></tr> <tr><td class='h'>Last Login</td><td>$r[lastip_login]</td><td>$r[lastip_loginh]</td></tr> <tr><td class='h'>Signup</td><td>$r[lastip_signup]</td><td>$r[lastip_signuph]</td></tr></table>"; print "<form action='staffnotes.php' method='post'> Staff Notes: <textarea rows=7 cols=40 name='staffnotes'>{$r['staffnotes']}</textarea> <input type='hidden' name='ID' value='{$_GET['u']}' /> <input type='submit' value='Change' /></form>"; } else { print " "; } print "</tr></table>"; } } function checkblank($in) { if(!$in) { return "N/A"; } return $in; } $h->endpage(); ?>   I would be very thank full if someone takes a look to see if it can be fixed.   One more thing lol On the action files none of them actually work. You cannot send mail to the user from the links, you cannot even attack. Anyone have a fix for it?
  8. Re: [mccodes V2] Add any type of video media to your game This looks nice, Will it slow a game down when loading the pages? Or be normal?
  9. Re: [mccode v2] Estate Recode Thanks for that :)
  10. Re: [V2] My home 1+ For you Then
  11. Re: [mccode v2] Fishing Mod     You have just ripped off Deadly States tag line Tut tut. Bawt will not be happy http://deadlystate.com/login.php http://www.chavsterv1.co.cc/login.php
  12. Re: [mccode v2] Estate Recode Perfect :)   Thank You Bd!
  13. Re: [mccode v2] Estate Recode Nice nearly done lol But when I buy the house it stills says brought for $10 lol
  14. Re: mccodes v2 newspaper Your game wont load for me? How about some screenies?
  15. Re: Allows you to create items that make you go up a level V2 Not a good idea. Sorry
  16. Re: [V2] My home Nice little mod :lol:
  17. Re: [McCodes v2] 100 Club! Lmao :lol:
  18. Re: [mccode v2] Estate Recode Just added It Looks very nice :) But I am having a little trouble. If I add this should I re add my houses? When I buy a house it says : Congrats, you bought the ****** for $0! And when you go to estate the prices do not show up right. They show like this: Stratusphere Cost: $5 Will Bar: 1000 When it actually costs $5000000 When I buy it, it still takes the correct money from me.   Also If someone makes a mistake and refreshes the page it takes the money twice lol
  19. Re: [ANY] Army(ish) Banner FREE Nice work as always :-)
  20. Re: [MC-Codes][V2]Thugs (core system) Here this is it with Lithium's fix :   <?php /* * Thug script V1.0.0 * This script was made by: DAYO * THIS IS FULLY SUPPORTED * IF YOU EDIT THIS AND NEED ANY HELP MAIL DAYO ON THE CE FORUMS / MSN: [email][email protected][/email] * YOU CAN USE THE INSTALLER TO INSTALL THE SQL NOT THE GAME VALUES */ include 'globals.php'; include 'thug-globals.php'; $action = $_GET[action]; if ($action == 'buyhideout') { if ($hideoutcost > $ir['money']) { echo 'you cant buy a hideout, you dont have enough cash!'; $h->endpage(); EXIT; } else { echo "you have brought a hideout for $"; echo $hideoutcost; $db->query("UPDATE users SET `money` = `money` - {$hideoutcost}, `hideout` = 1 WHERE userid = {$ir['userid']}"); $h->endpage(); EXIT; } } if ($ir['hideout'] == -1) { echo 'At the moment you do not have a hideout for your thugs! <a href = "mythugs.php?action=buyhideout">BUY A HIDEOUT</a> ($'; echo $hideoutcost; echo ')'; $h->endpage(); EXIT; } // this is the default page if ($action == '') { echo 'Welcome to your thug hangout! [b]<div allign = "right">Actions:</div>[/b] <a href = "mythugs.php?action=hire">Hire Thugs</a> || <a href = "mythugs.php?action=upgrade">Upgrade Thugs</a> || <a href = "mythugs.php?action=train">Train Thugs</a>'; echo ' <table width="800" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="center">Name</div></td> <td><div align="center">Level</div></td> <td><div align="center">Attack</div></td> <td><div align="center">Defence</div></td> <td><div align="center">Attack Item</div></td> <td><div align="center">Defence Item</div> <div align="center"></div> <div align="center"></div></td> </tr>'; $query = "SELECT * FROM thugs WHERE userid={$ir['userid']}"; $rt=mysql_query($query); // query executed echo mysql_error(); // if any error is there that will be printed to the screen if ($rt) { while ($VT = mysql_fetch_array($rt)){ echo " <tr> <td>$VT[name]</td> <td>$VT[level] ($VT[exp] exp)</td> <td>$VT[attack]</td> <td>$VT[defend]</td> <td>$VT[aitme]</td> <td>$VT[ditem]</td> </tr>" ; } } else { echo " <tr> <td>N/A</td> <td>N/A</td> <td>N/A</td> <td>N/A</td> <td>N/A</td> <td>N/A</td> </tr>" ; } echo '</table>'; } else if ($action == hire) { echo '<form id="form1" name="form1" method="post" action="mythugs.php?action=hire2"> <label> [b]Name: [/b]<input type="text" name="name" id="name" /> </label> <label> <input type="submit" name="button" id="button" value=" Hire Thug ($'; echo $thugcost; echo ')" /> </label> </form>'; } else if ($action == hire2) { if ($ir['thugs'] >= $maxthugs) { echo 'you already have the max amount of thugs you cant have any more!'; $h->endpage(); EXIT; } if ($thugcost > $ir['money']) { echo 'you dont have enough money'; $h->endpage(); EXIT; } else { $name = htmlspecialchars($_POST[name]); $name = mysql_real_escape_string ($name); $db->query("UPDATE `users` SET `money`= `money` - {$thugcost}, `thugs` = `thugs` + 1 WHERE `userid` = '{$ir['userid']}'"); $db->query("INSERT INTO thugs (name, userid) VALUES ('{$name}', '{$ir['userid']}')"); echo 'You brought a Thug for $'; echo $thugcost; echo' <a href = "mythugs.php"> BACK</a>'; $h->endpage(); EXIT; } } else if ($action == train) { echo 'Here you can train your thugs attack and defence stats'; echo '<form id="form1" name="form1" method="post" action="mythugs.php?action=train2"> <label> <select name="id" id="id">'; $trainingquery = "SELECT * FROM thugs WHERE userid = {$ir['userid']}"; $qw=mysql_query($trainingquery); // query executed while($TT=mysql_fetch_array($qw)){ echo '<option value="'; echo $TT[id]; echo '">'; echo $TT[name]; echo ' ('; echo $TT[level]; echo') </option>'; } echo ' </select> </label> <label> <select name="type" id="type"> <option value="attack">Train Attack</option> <option value="defend">Train Defence </option> </select> </label> <label> <input type="submit" name="button" id="button" value=" Train thug " /> </label> </form> '; } else if ($action == train2) { //checks if the user can train the thug if ($ir['thugtime'] > 0) { echo "You cannot train your thug, you can in {$ir['thugtime']} mins"; $h->endpage(); EXIT; } $thugid = mysql_real_escape_string($_POST[id]); $training = $db->query("SELECT level FROM thugs WHERE id = {$thugid}"); $mintrain = $training * 3; $maxtrain = $training * 10; $type = mysql_real_escape_string($_POST[type]); $trainamount = mt_rand ($mintrain, $maxtrain); $db->query("UPDATE thugs SET {$type} = {$type} + {$trainamount} WHERE id = {$thugid}"); echo 'Your thug trained his ability to '; echo $type; echo ' He gained'; echo $trainamount; echo ' points'; $db->query("UPDATE users SET `thugtime` = `thugtime` + {$thugtraintime} WHERE `userid` = '{$ir['userid']}'"); } else if ($action == upgrade) { echo' here you can upgrade your thugs equipment'; echo '<form id="form1" name="form1" method="post" action="mythugs.php?action=upgrade2"> <label> <select name="id" id="id">'; $upgradequery = "SELECT * FROM thugs WHERE userid = {$ir['userid']}"; $rt=mysql_query($upgradequery); // query executed while($UT=mysql_fetch_array($rt)){ echo '<option value="'; echo $UT[id]; echo '">'; echo $UT[name]; echo' ('; echo $UT[level]; echo ') </option>'; } echo ' </select> </label> <label> <input type="submit" name="button" id="button" value=" Upgrade Thug " /> </label> </form> '; } else if ($action == upgrade2) { //they have selected a thug now lets select there new item $id = $_POST[id]; $upgrade2query = "SELECT * FROM thugitems"; $rt=mysql_query($upgrade2query); // query executed while($U2T=mysql_fetch_array($rt)){ echo $U2T[name]; echo' - $'; echo $U2T[price] ; echo' ('; echo $U2T[type]; echo ' Item) <a href="mythugs.php?action=upgrade3&thugid='; echo $id; echo '&price='; echo $U2T[price]; echo '&id='; echo $U2T[id];echo '&name='; echo $U2T[name]; echo '&type='; echo $U2T[type]; echo '">BUY</a> '; } } else if ($action == upgrade3) { $item = mysql_real_escape_string($_GET[id]); $price = mysql_real_escape_string($_GET[price]); $type = mysql_real_escape_string($_GET[type]); $name = mysql_real_escape_string($_GET[name]); $thugid = mysql_real_escape_string($_GET[thugid]); $name = $db->query("SELECT name FROM thugitems WHERE id={$item}"); $price = $db->query("SELECT price FROM thugitems WHERE id={$item}"); if ($price > $ir['money']) { echo 'you dont have enough money to do this!!!'; $h->endpage(); EXIT; } $db->query("UPDATE `users` SET `money` = `money` - ". mysql_real_escape_string($_GET['price']) ." WHERE (`userid` = ". $ir['userid'] .")") or die($db->error()); if ($type == attack) { $db->query("UPDATE thugs SET `aitem` = '". mysql_real_escape_string($_GET['name']) ."' WHERE id={$thugid}"); } else if ($type == defend) { $db->query("UPDATE thugs SET `ditem` = '". mysql_real_escape_string($_GET['name']) ."' WHERE id={$thugid}"); } echo 'You have brought the item for your thug!'; } else { echo 'WTF this is an invalid action!!'; $h->endpage(); EXIT; } $h->endpage(); ?>
  21. Re: Donator Gym V2 He changed someone else mod and tried to get money. From what I see it looks nice tho. Think it's better he has posted it for free
  22. Re: Donator Gym V2 This is a better place to post it :-)
  23. Re: Donators Gym $2 I have very little experience but I'm sure even I could do this...
  24. Re: [MC-Codes][V2]Thugs (core system)     Glad I'm not the only one with a problem lol Every one on my game got negative money.
  25. Re: [MC-Codes][V2]Thugs (core system) I like this alot, I went through it and just fixed your spelling mistakes and made it a bit more tidy. Just trying to be nice! I finally can add a useful comment to a post lol Here :   <?php /* * Thug script V1.0.0 * This script was made by: DAYO * THIS IS FULLY SUPPORTED * IF YOU EDIT THIS AND NEED ANY HELP MAIL DAYO ON THE CE FORUMS / MSN: [email][email protected][/email] * YOU CAN USE THE INSTALLER TO INSTALL THE SQL NOT THE GAME VALUES */ include 'globals.php'; include 'thug-globals.php'; $action = $_GET[action]; if ($action == 'buyhideout') { if ($hideoutcost > $ir['money']) { echo 'you cant buy a hideout, you dont have enough cash!'; $h->endpage(); EXIT; } else { echo "you have brought a hideout for $"; echo $hideoutcost; $db->query("UPDATE users SET `money` = `money` - {$hideoutcost}, `hideout` = 1 WHERE userid = {$ir['userid']}"); $h->endpage(); EXIT; } } if ($ir['hideout'] == -1) { echo 'At the moment you do not have a hideout for your thugs! <a href = "mythugs.php?action=buyhideout">BUY A HIDEOUT</a> ($'; echo $hideoutcost; echo ')'; $h->endpage(); EXIT; } // this is the default page if ($action == '') { echo 'Welcome to your thug hangout! [b]<div allign = "right">Actions:</div>[/b] <a href = "mythugs.php?action=hire">Hire Thugs</a> || <a href = "mythugs.php?action=upgrade">Upgrade Thugs</a> || <a href = "mythugs.php?action=train">Train Thugs</a>'; echo ' <table width="835" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="center">Name</div></td> <td><div align="center">Level</div></td> <td><div align="center">Attack</div></td> <td><div align="center">Defence</div></td> <td><div align="center">Attack Item</div></td> <td><div align="center">Defence Item</div> <div align="center"></div> <div align="center"></div></td> </tr>'; $query = "SELECT * FROM thugs WHERE userid={$ir['userid']}"; $rt=mysql_query($query); // query executed echo mysql_error(); // if any error is there that will be printed to the screen if ($rt) { while ($VT = mysql_fetch_array($rt)){ echo " <tr> <td>$VT[name]</td> <td>$VT[level] ($VT[exp] exp)</td> <td>$VT[attack]</td> <td>$VT[defend]</td> <td>$VT[aitme]</td> <td>$VT[ditem]</td> </tr>" ; } } else { echo " <tr> <td>N/A</td> <td>N/A</td> <td>N/A</td> <td>N/A</td> <td>N/A</td> <td>N/A</td> </tr>" ; } echo '</table>'; } else if ($action == hire) { echo '<form id="form1" name="form1" method="post" action="mythugs.php?action=hire2"> <label> [b]Name: [/b]<input type="text" name="name" id="name" /> </label> <label> <input type="submit" name="button" id="button" value=" Hire Thug ($'; echo $thugcost; echo ')" /> </label> </form>'; } else if ($action == hire2) { if ($ir['thugs'] >= $maxthugs) { echo 'you already have the max amount of thugs you cant have any more!'; $h->endpage(); EXIT; } if ($thugcost > $ir['money']) { echo 'you dont have enough money'; $h->endpage(); EXIT; } else { $name = htmlspecialchars($_POST[name]); $name = mysql_real_escape_string ($name); $db->query("UPDATE `users` SET `money`= `money` - {$thugcost}, `thugs` = `thugs` + 1"); $db->query("INSERT INTO thugs (name, userid) VALUES ('{$name}', '{$ir['userid']}')"); echo 'You brought a Thug for $'; echo $thugcost; echo' <a href = "mythugs.php"> BACK</a>'; $h->endpage(); EXIT; } } else if ($action == train) { echo 'Here you can train your thugs attack and defence stats'; echo '<form id="form1" name="form1" method="post" action="mythugs.php?action=train2"> <label> <select name="id" id="id">'; $trainingquery = "SELECT * FROM thugs WHERE userid = {$ir['userid']}"; $qw=mysql_query($trainingquery); // query executed while($TT=mysql_fetch_array($qw)){ echo '<option value="'; echo $TT[id]; echo '">'; echo $TT[name]; echo ' ('; echo $TT[level]; echo') </option>'; } echo ' </select> </label> <label> <select name="type" id="type"> <option value="attack">Train Attack</option> <option value="defend">Train Defence </option> </select> </label> <label> <input type="submit" name="button" id="button" value=" Train thug " /> </label> </form> '; } else if ($action == train2) { //checks if the user can train the thug if ($ir['thugtime'] > 0) { echo "You cannot train your thug, you can in {$ir['thugtime']} mins"; $h->endpage(); EXIT; } $thugid = mysql_real_escape_string($_POST[id]); $training = $db->query("SELECT level FROM thugs WHERE id = {$thugid}"); $mintrain = $training * 3; $maxtrain = $training * 10; $type = mysql_real_escape_string($_POST[type]); $trainamount = mt_rand ($mintrain, $maxtrain); $db->query("UPDATE thugs SET {$type} = {$type} + {$trainamount} WHERE id = {$thugid}"); echo 'Your thug trained his ability to '; echo $type; echo ' He gained'; echo $trainamount; echo ' points'; $db->query("UPDATE users SET `thugtime` = `thugtime` + {$thugtraintime}"); } else if ($action == upgrade) { echo' here you can upgrade your thugs equipment'; echo '<form id="form1" name="form1" method="post" action="mythugs.php?action=upgrade2"> <label> <select name="id" id="id">'; $upgradequery = "SELECT * FROM thugs WHERE userid = {$ir['userid']}"; $rt=mysql_query($upgradequery); // query executed while($UT=mysql_fetch_array($rt)){ echo '<option value="'; echo $UT[id]; echo '">'; echo $UT[name]; echo' ('; echo $UT[level]; echo ') </option>'; } echo ' </select> </label> <label> <input type="submit" name="button" id="button" value=" Upgrade Thug " /> </label> </form> '; } else if ($action == upgrade2) { //they have selected a thug now lets select there new item $id = $_POST[id]; $upgrade2query = "SELECT * FROM thugitems"; $rt=mysql_query($upgrade2query); // query executed while($U2T=mysql_fetch_array($rt)){ echo $U2T[name]; echo' - $'; echo $U2T[price] ; echo' ('; echo $U2T[type]; echo ' Item) <a href="mythugs.php?action=upgrade3&thugid='; echo $id; echo '&price='; echo $U2T[price]; echo '&id='; echo $U2T[id];echo '&name='; echo $U2T[name]; echo '&type='; echo $U2T[type]; echo '">BUY</a> '; } } else if ($action == upgrade3) { $item = mysql_real_escape_string($_GET[id]); $price = mysql_real_escape_string($_GET[price]); $type = mysql_real_escape_string($_GET[type]); $name = mysql_real_escape_string($_GET[name]); $thugid = mysql_real_escape_string($_GET[thugid]); $name = $db->query("SELECT name FROM thugitems WHERE id={$item}"); $price = $db->query("SELECT price FROM thugitems WHERE id={$item}"); if ($price > $ir['money']) { echo 'you dont have enough money to do this!!!'; $h->endpage(); EXIT; } $db->query("UPDATE `users` SET `money` = `money` - ". mysql_real_escape_string($_GET['price']) ." WHERE (`userid` = ". $ir['userid'] .")") or die($db->error()); if ($type == attack) { $db->query("UPDATE thugs SET `aitem` = '". mysql_real_escape_string($_GET['name']) ."' WHERE id={$thugid}"); } else if ($type == defend) { $db->query("UPDATE thugs SET `ditem` = '". mysql_real_escape_string($_GET['name']) ."' WHERE id={$thugid}"); } echo 'You have brought the item for your thug!'; } else { echo 'WTF this is an invalid action!!'; $h->endpage(); EXIT; } $h->endpage(); ?>
×
×
  • Create New...