Jump to content
MakeWebGames

Daron

Members
  • Posts

    151
  • Joined

  • Last visited

Everything posted by Daron

  1. ah ok that makes sense lol. & why your here could you point me too a link on how to make a map with east,west,south,north navigation? i made some image maps yesturday but im not satisified so i want a non-clickable map with navigtion at the bottom, i think it loooks better, but google didnt help, i think i did wrong terms.
  2. how can i change my courses table so that instead of days its minutes??
  3. here is the orignal artice http://makewebgames.io/showthread.php/31705-mccode-v2-Faction-with-Armoury
  4. this is the faction.php file made by <a href="http://makewebgames.io/showthread.php/31705-mccode-v2-Faction-with-Armoury">Dazza</a> that I FIXED thanx to help of RulerofZu <?php include "globals.php"; print "<font face='Arial' size='4'>Factions</font><hr width='90%'>"; switch ($_GET['step']) { case 'create': create_faction(); break; case 'profile': faction_profile(); break; case 'users': faction_members(); break; case 'search': search_factions(); break; case 'apply': faction_apply(); break; default: factions_index(); break; } function factions_index() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa LEFT JOIN `users` u ON (u.userid = fa.faLEADER) ORDER BY faID DESC"); $q = mysql_query($sql); print "This is a list of all factions by ID <table width='90%' cellspacing='1'><tr bgcolor='#AAAAAA'><th width='25%'>Name</th><th width='13%'>Members</th><th width='12%'>Reputation</th><th width='50%'>Image</th></tr>"; while($r = mysql_fetch_array($q)) { print "<tr><td><a href='http://factions.php?step=profile&ID={$r['userid']}'><h3>{$r['faNAME']}</h3></a></td><td>"; $membs = sprintf("SELECT * FROM `users` WHERE faction = %u", mysql_real_escape_string($r['faID'])); $mems = mysql_query($membs); print mysql_num_rows($mems)."</td> <td>{$r['faREPUTATION']}</td> <td><img src={$r['userid']}/></td></tr>"; } print "</table> <hr width='90%'>> <a href='explore.php'>Back</a><hr width='90%'>"; } function create_faction() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` WHERE faID > 0"); $q = mysql_query($sql); $fcs = mysql_num_rows($q); $r['faCOST'] = ($fcs*10000); if($ir['money'] < $r['faCOST']) { print " You don't have enough money. It costs ".money_formatter($r['faCOST'])." to create a new Faction. <hr width='90%'>> <a href='explore.php'>Back</a><hr width='90%'>"; } else if($ir['faction'] > 0) { print " You are already part of a Faction. Leave before creating a new one. <hr width='90%'>> <a href='explore.php'>Back</a><hr width='90%'>"; } else if($_POST['name'] AND $_POST['description'] AND $_POST['status']) { $ins = sprintf("INSERT INTO `factions` (`faID`, `faNAME`, `faDESC`, `faSTATUS`, `faLEADER`, `faCOLEADER`, `faCAPACITY`, `faREPUTATION`) VALUES ('NULL','%s', '%s', '%s', '%d', '%d', '%d', '%d')", mysql_real_escape_string($_POST['name']), mysql_real_escape_string($_POST['description']), mysql_real_escape_string($_POST['status']), $userid, $userid, 10, 100); mysql_query($ins); $r['insID'] = mysql_insert_id($c); $fac = sprintf("UPDATE `users` SET faction = %d, money=money-%d WHERE (userid = %u)", $r['insID'], $r['faCOST'], $userid); mysql_query($fac); print " The {$_POST['name']} faction was successfully created. <hr width='90%'>> <a href='factions.php?step=manage'>Back</a><hr width='90%'>"; } else { print " <form action='factions.php?step=create' method='post'> A new faction will cost $10,000 times the amount of factions in existence. The current price is <b>".money_formatter($r['faCOST'])."</b>. Name your Faction <input type='text' name='name' /> Choose a Status <select type='dropdown' name='status'> <option value='Peaceful'>Peaceful</option> <option value='Aggressive'>Aggressive</option> </select> Description <textarea name='description' cols='40' rows='7'></textarea> <input type='submit' value='Create' /></form> <hr width='90%'>> <a href='factions.php'>Back</a><hr width='90%'>"; } } function faction_profile() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa LEFT JOIN `users` u ON (u.userid = fa.faLEADER) WHERE (fa.faID = %u)", mysql_real_escape_string($_GET['ID'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); print " <table width='400' bgcolor='#DFDFDF'><tr><td align='center'><b><font size='5'>{$r['faNAME']}</font></b></td></tr></table> [img={$r['userid']}[] <table width='400' bgcolor='#DFDFDF'><tr><td valign='middle' align='center'><font size='5'><b>{$r['faREPUTATION']}</b></font></td></tr></table> <table width='400' bgcolor='#DFDFDF'><tr><td width='200' valign='middle'> <b>Leader: </b><a href='viewuser.php?u={$r['userid']}'>{$r['username']}</a> "; $col = sprintf("SELECT * FROM `users` WHERE (userid = %u)", mysql_real_escape_string($r['faCOLEADER'])); $q2 = mysql_query($col); $co = mysql_fetch_array($q2); print "<b>Co-Leader: </b><a href='viewuser.php?u={$r['userid']}'>{$co['username']}</a> "; $membs = sprintf("SELECT * FROM `users` WHERE faction = %u", mysql_real_escape_string($r['faID'])); $mems = mysql_query($membs); print "<b>Members: </b>".mysql_num_rows($mems)." <b>Reputation: </b>{$r['faREPUTATION']} <b>Current chain: </b>{$r['faCHAIN']} attacks <b>Best chain: </b>{$r['faBCHAIN']} attacks <b>Status: </b>"; if ($r['faSTATUS'] == 'Peaceful') { print "<font color='green'><b>Peaceful</b></font>"; } else { print "<font color='red'><b>Aggressive</b></font>"; } print " </td> <td valign='top' align='right' width='200'><a href='http://factions.php?step=users&ID={$r['userid']}'>User list</a> < <a href='factions.php?step=apply&ID={$r['userid']}'>Apply</a> < </td></tr></table> <table width='400' bgcolor='#DFDFDF'><tr> <td width='50%' height='100%'> <table width='100%' height='100%'><tr> <td align='center'> {$r['faDESC']} </td> </tr></table></td></tr></table> <hr width='90%'>> <a href='factions.php'>Back</a><hr width='90%'>"; } function faction_members() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa LEFT JOIN `users` u ON (u.faction = fa.faID) WHERE (fa.faID = %u)", mysql_real_escape_string($_GET['ID'])); $q = mysql_query($sql); print "<table width='90%' cellspacing='1'><tr bgcolor='#AAAAAA'><th width='25%'>Num</th><th width='25%'>Name</th><th width='25%'>Level</th><th width='25%'>Days in Faction</th></tr>"; while ($r = mysql_fetch_array($q)) { $cn++; print "<tr><td>$cn.</td><td><a href='viewuser.php?u={$r['userid']}'>{$r['username']}</a></td><td>{$r['level']}</td><td>{$r['faction_days']}</td></tr>"; } print "</table> <hr width='90%'>> <a href='factions.php?step=profile&ID={$_GET[$r['userid']]}'>Back</a><hr width='90%'>"; } function search_factions() { global $ir,$c,$userid,$h; if (!$_POST['name']) { print "<form action='factions.php?step=search' method='post'> <b>Search by Keyword</b> Insert the keyword that you'd like to search for Factions: <input type='text' name='name'> <input type='submit' value='Search'></form> <hr width='90%'>> <a href='factions.php'>Back</a><hr width='90%'>"; } else { $sql = sprintf("SELECT * FROM `factions` fa LEFT JOIN `users` u ON (u.userid = fa.faLEADER) WHERE (`faNAME` LIKE '%%%s%%')", mysql_real_escape_string($_POST['name'])); $q = mysql_query($sql); print "<b>Search by Keyword</b> Keyword: {$_POST['name']} <table width='90%' cellspacing='1'><tr bgcolor='#AAAAAA'><th width='25%'>Name</th><th width='13%'>Members</th><th width='12%'>Reputation</th><th width='50%'>Image</th></tr>"; while($r = mysql_fetch_array($q)) { print "<tr><td><a href='factions.php?step=profile&ID={$r['userid']}'><h3>{$r['faNAME']}</h3></a></td><td>"; $membs = sprintf("SELECT * FROM `users` WHERE faction = %u", mysql_real_escape_string($r['faID'])); $mems = mysql_query($membs); print mysql_num_rows($mems)."</td> <td>{$r['faREPUTATION']}</td> <td>[img={$r['userid']}[]</td></tr>"; } print "</table> <hr width='90%'>> <a href='factions.php?step=search'>Back</a><hr width='90%'>"; } } function faction_apply() { global $ir,$c,$userid,$h; if ($ir['faction']) { print " You are already in a faction at this time. <hr width='90%'>> <a href='factions.php'>Back</a><hr width='90%'>"; } else if (!$_GET['act']) { print " Please type an application to this faction below: <form action='factions.php?step=apply&act=submit&ID={$_GET['ID']}' method='post'> <textarea type='text' name='app' cols='50' rows='8'>Type your application here</textarea> <input type='submit' value='Submit'></form> <hr width='90%'>> <a href='http://factions.php?step=profile&ID={$_GET[$r['userid']]}'>Back</a><hr width='90%'>"; } else if ($_GET['act'] == 'submit') { if ($_POST['app']) { $ins = sprintf("INSERT INTO `faction_apps` (`fpID`, `fpUSER`, `fpFACTION`, `fpAPP`, `fpTIME`) VALUES ('NULL','%d', '%d', '%s', '%d')", mysql_real_escape_string($ir['userid']), mysql_real_escape_string($_GET['ID']), mysql_real_escape_string($_POST['app']), time()); mysql_query($ins); print " Your application was submitted! <hr width='90%'>> <a href='factions.php?step=profile&ID={$_GET[$r['userid']]}'>Back</a><hr width='90%'>"; } else { print " You did not type an application to send! <hr width='90%'>> <a href='factions.php?step=apply&ID={$_GET[$r['userid']]}'>Back</a><hr width='90%'>"; } } } $h->endpage(); ?>
  5. i fixed it! i put profile&ID={$_GET[$r['userid']]}'> alright i fixed the whole thing! =) thanx rulerofzu
  6. i tried {$_GET[{$r['userid']}]' but that didnt work
  7. O & what u said did fix that one error, but theres alot more, but i can handle these other ones because they are problems i already dealt with before with the help of u, djkanna, sniko, & analog :) when im done & its working i'll post my version on here. EDIT: except line 197 i cannot figure that one out.
  8. yea i been remembering the quote thing you taught me, it actually been helping fix alot of things lately.
  9. <?php $macropage="gym.php"; include "globals.php"; if($ir['hospital']) { die("This page cannot be accessed while in hospital."); } $statnames=array( 'Pressure' => 'pressure', 'Control' => 'control', 'Technique' => 'technique', 'Manipulation' => 'manipulation'); $_POST['amnt']=abs((int) $_POST['amnt']); if(!$ir['jail']) { print "<h3>Bloodline Cave</h3><hr />"; } else { if($ir['jail']) { die("This page cannot be accessed while in jail."); } } 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(800,1000)*rand(800,1000)*(($ir['will']+20)/150); $ir['will']-=rand(1,3); 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 `will` = {$ir['will']}, will = will - {$_POST['amnt']} WHERE `userid` = $userid"); $inc=$ir[$stat]+$gain; $inc2=$ir['energy']-$_POST['amnt']; if($stat=="pressure") { print "You begin training your chakra pressure.<br /> You have gained {$gain} pressure force by doing {$_POST['amnt']} sets of pressure exercises.<br /> You now have {$inc} pressure and {$inc2} will left."; } elseif($stat=="control") { print "You begin focusing on controlling your chakra.<br /> You have gained {$gain} control by doing {$_POST['amnt']} minutes of control training.<br /> You now have {$inc} control and {$inc2} will left."; } elseif($stat=="technique") { print "You head to the training field to begin executing your technique.<br /> You have gained {$gain} technique by doing {$_POST['amnt']} minutes of technique usage.<br /> You now have {$inc} technique and {$inc2} will left."; } elseif($stat=="manipulation") { print "You walk over to the dojo to practice your manipulation.<br /> You have gained {$gain} manipulation by training {$_POST['amnt']} minutes.<br /> You now have {$inc} manipulation and {$inc2} will left."; } print "<hr />"; $ir['will']-=$_POST['amnt']; $ir[$stat]+=$gain; } } $ir['presrank']=get_rank($ir['pressure'],'pressure'); $ir['conrank']=get_rank($ir['control'],'control'); $ir['techrank']=get_rank($ir['technique'],'technique'); $ir['manrank']=get_rank($ir['manipulation'],'manipulation'); print "Choose the stat you want to train and the times you want to train it.<br /> You can train up to {$ir['energy']} times.<hr /> <form action='gym.php' method='post'> Stat: <select type='dropdown' name='stat'> <option style='color:red;' value='Pressure'>Pressure (Have {$ir['pressure']}, Ranked {$ir['presrank']}) <option style='color:blue;' value='Control'>Control (Have {$ir['control']}, Ranked {$ir['conrank']}) <option style='color:green;' value='Technique'>Technique (Have {$ir['technique']}, Ranked {$ir['techrank']}) <option style='color:brown;' value='Manipulation'>Manipulation (Have {$ir['manipulation']}, Ranked {$ir['manrank']}) </select><br /> Times to train: <input type='text' name='amnt' value='{$ir['energy']}' /><br /> <input type='submit' value='Train' /></form>"; $h->endpage(); ?>
  10. hey i created 4 new stats for my game. i made a special gym for them so u only can train them in that one gym & i already added them userstats in db but when i try train them it says this stat cannot be trained?? anybody know why?
  11. well can somebody take a glance at line 39 on factions.php because i been trying correct it but no luck.
  12. theres a problem with line 39 in factions.php it says iys expecting a ']'
  13. it still returns a N/A as the result hmmmmmm.
  14. how would i fix it???? i thought that had sounded right.
  15. i think i know away to get things right but i need to be able to stop the whole accept or decline feature. so it needs to be able to automatically make u the persons student once u type in their id #. so anybody know how to remove it so it automatically makes you student without having having to accept????
  16. It says N/A even tho i have 1 student. hmmmm, im thinking it involves the line with mysql_query("SELECT userid, username FROM users WHERE sensei = {$r['userid']}"); or it could be cuz in db for the student it has the sensei's userid but for the sensei it just has the # of students. it could be cuz i dont have student in sensei associated on the sensei side.
  17. Hey would any of you gifted artist feel generous enough to do me either 2 options 1.) make a layout for me & parnters game that we want a new cool layout for or 2.) give me a good website to learn how to make layouts from. If you choose option 1 just know it's a naruto game(ninjas) if that helps. Thanx in advance
  18. alright i examined but i have no idea as in WHERE to to start adding the code to make students appear. //Star Of Marriage Script: $v = mysql_query("SELECT * FROM users WHERE userid='{$r['married']}'") or die(mysql_error()); $vc = mysql_fetch_assoc($v); if($r['married'] == 0) { $married = "<b>Married:</b> [<font color=red>No One</font>]<br>"; } else if($r['married'] > 0) { $married = "<b>Married:</b> [<a href=?u={$vc['userid']}>{$vc['username']}</a>]<br>"; } //End Of Marriage Script $_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['married'] ) { $marital="<font color='red'>No</font>"; } else { $k=mysql_query("SELECT username FROM users WHERE userid={$r['married']}", $c); $marital="<a href='http://bigbro.x10.mx/viewuser.php?u={$r['married']}' style='color:green;'>".mysql_result($k,0,0)."</a> "; }
  19. ok i will, ima try on my own first tho.
  20. YES its right! thank u so much Analog for watching me through this, now all i gotta do is make it so it appears on the viewuser.php page & then i gotta add to your reputation ;)
  21. so would it be mysql_query("UPDATE users SET sensei='{$f['proposer']}' WHERE userid='{$userid}'") or die(mysql_error()); mysql_query("UPDATE users SET students=students + 1 WHERE userid='{$f['proposer']}'") or die(mysql_error() i just suppose to remove that line right???
  22. yea i just realized that in db both players are each others sensei lol.
  23. im still working but this is what i have so far, basically i finally got rid of the limit on proposing to only 1 person. now i gotta see if u can have a multi relationship & will everyone appear on profile. <?php include("globals.php"); echo '<h1>Sensei Dojo</h1>'; function check() { global $ir, $h; if($ir['student']== 3) { echo 'You already have 3 students!'; $h->endpage(); exit; } } check(); if(isset($_GET['propose'])) { $_POST['ID'] = abs(@intval($_POST['ID'])); if($_POST['ID']) { mysql_query("INSERT INTO proposals VALUES('','{$ir['userid']}','{$_POST['ID']}')") or die(mysql_error()); $i=mysql_insert_id($c); event_add($_POST['ID'],"{$ir['username']} Just asked you to be their student. <br><br><a href=proposal.php?donow=accept&id={$i}>Accept</a> | <a href=proposal.php?donow=decline&id={$i}>Decline</a>"); echo 'request has been sent to id '.$_POST['ID'].'.'; $h->endpage(); exit; } $a = mysql_query("SELECT * FROM proposals WHERE proposer='{$ir['userid']}'") or die(mysql_query()); if(mysql_num_rows($a) == 3) { echo 'You already have a request sent!<br><br>If you can not find this request to cancel please go look at the proposals you have sent.'; $h->endpage(); exit; } $c = mysql_query("SELECT * FROM proposals WHERE proposed='{$ir['userid']}'") or die(mysql_query()); if(mysql_num_rows($c) > 0) { echo 'You already have a request you have not declined or accepted.<br><br>If you can not find this requested please look at your requested that has been sent to you with out accepting or decline.'; $h->endpage(); exit; } echo ' <form action="?propose" method="post"> User id to propose to: <input type="text" name="ID"> <br><input type="submit" value="Submit"> </form>'; $h->endpage(); exit; } if(isset($_GET['viewproposalrecieved'])) { if($_GET['id']) { $db->query("DELETE FROM proposals WHERE id='{$_GET['id']}'") or die(mysql_error()); echo 'request declined'; exit; } echo ' <table border=1 width=100%> <tr> <th>User Requested For</th> <th>Actions</th> </tr>'; $t = mysql_query("SELECT * FROM proposals WHERE proposed='{$ir['userid']}'") or die(mysql_error()); if(mysql_num_rows($t) == 0) { echo '<td colspan=2>No Request For You!</td></table>'; $h->endpage(); exit; } while($d = mysql_fetch_assoc($t)) { $b = mysql_query("SELECT * FROM users WHERE userid='{$d['proposed']}'") or die(mysql_error()); $h = mysql_fetch_assoc($b); echo ' <tr> <td>'.$h['username'].'</td> <td><a href="?viewproposalrecieved&id='.$d['id'].'">Delete</a></td>'; } echo '</td></table>'; exit; } if(isset($_GET['viewproposalsent'])) { if($_GET['id']) { $db->query("DELETE FROM proposals WHERE id='{$_GET['id']}'") or die(mysql_error()); echo 'Proposal canceld'; $h->endpage(); exit; } echo ' <table border=1 width=100%> <tr> <th>User Requested For</th> <th>Actions</th> </tr>'; $t = mysql_query("SELECT * FROM proposals WHERE proposer='{$ir['userid']}'") or die(mysql_error()); if(mysql_num_rows($t) == 0) { echo '<td colspan=2>No Proposals Made by you!</td></table>'; $h->endpage(); exit; } while($d = mysql_fetch_assoc($t)) { $b = mysql_query("SELECT * FROM users WHERE userid='{$d['proposed']}'") or die(mysql_error()); $h = mysql_fetch_assoc($b); echo ' <tr> <td>'.$h['username'].'</td> <td><a href="?viewproposalrecieved&id='.$d['id'].'">Delete</a></td>'; } echo '</td></table>'; $h->endpage(); exit; } if($_GET['donow'] == accept) { $id = $_GET['id']; $a = mysql_query("SELECT * FROM proposals WHERE id='{$id}'") or die(mysql_error()); $f = mysql_fetch_assoc($a); if($f['proposed'] != $ir['userid']) { echo 'This request does not belong to you!'; $h->endpage(); exit; } mysql_query("UPDATE users SET sensei='{$f['proposer']}' WHERE userid='{$userid}'") or die(mysql_error()); mysql_query("UPDATE users SET sensei='{$ir['userid']}' WHERE userid='{$f['proposer']}'") or die(mysql_error()); mysql_query("UPDATE users SET student='student + 1' WHERE userid='{$f['proposer']}'") or die(mysql_error()); event_add($f['proposer'], "{$ir['username']} Accepeted your proposal."); mysql_query("DELETE FROM proposals WHERE id='{$f['id']}'") or die(mysql_error()); echo 'You accepted the request!'; $h->endpage(); exit; } if($_GET['donow'] == decline) { $id = $_GET['id']; $a = mysql_query("SELECT * FROM proposals WHERE id='{$id}'") or die(mysql_error()); $f = mysql_fetch_assoc($a); if($f['proposed'] != $ir['userid']) { echo 'This request does not belong to you!'; $h->endpage(); exit; } mysql_query("DELETE FROM proposals WHERE id='{$f['id']}'") or die(mysql_error()); event_add($f['proposer'], "{$ir['username']} Declined your proposal."); echo 'You declined the request!'; $h->endpage(); exit; } echo '<a href="?propose">Request for a student</a><br> <a href="?viewproposalsent">View Your Sent request That Has Not Been Accepted/Declined</a><br> <a href="?viewproposalrecieved">View Your Recieved request That Has Not Been Aceppted/Declined</a>'; $h->endpage(); ?>
  24. ok i will & i just fixed, i looked through my old post on here & realized that in db comments are "gcomments" but in code i had "gComments" had to lower case the "c" lol. but im about to examine the code u shared earlier now.
  25. ah! u always come through sniko thanx! ima fully examine it once i fix my comments again. while trying thing on my own, i messed up my comments on the viewuser page again. & i keep forgetting how i fixed it 1st 2 times lol.
×
×
  • Create New...