Jump to content
MakeWebGames

PsyChoTic

Members
  • Posts

    45
  • Joined

  • Last visited

    Never

PsyChoTic's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Re: Login Page's $10 Well that would be your choice wouldnt it
  2. Re: Login Page's $10   I'm sorry but i asked for you to comment on them not rate them so could you pls give me reasons for your rate's so i might be able to make them better and learn from it.   also i admit $20 might be a bit high so ill make it $15 for login and register thanks Psychotic.
  3. Hi everyone! I created a few game login page's over the last couple of days and am selling them for $10 I will be doing them in both V1 & V2 if needed Right what im offering is: login page=$10 And if you would like anything changing the price will be different depending on what you need doing Login & register=$20 Now $15 Same again if you need anything changing If you dont like what you see and would like me to try and make one for you PM me and we can see what we can do and agree and a price. Anyway the screenshot of the login page's is here: http://i111.piczo.com/view/2/j/d/j/9/4/o/d/f/b/g/1/img/i359047299_66596_6.png http://i111.piczo.com/view/2/j/d/j/9/4/o/d/f/b/g/1/img/i359047301_82195_6.png http://i111.piczo.com/view/2/j/d/j/9/4/o/d/f/b/g/1/img/i359047300_8395_6.png More will be added as i make them.   Anyway just hope someone buys them lol. For any more info please PM me (best chance!) or email me ([email protected])   Please comment on it. Thanks Psychotic!
  4. Re: [mccode] Gangs did anyone ever make this so you could have wars and things if so can you let me know or if not anyone fancy having a go at it :lol:
  5. Re: [mccode V2] Item Descryption. would someone pls be able to change this to v1 for me pls it would be a big help
  6. Re: [V2] Robbery well try and sort tht bit yourself then
  7. Re: [V2] Robbery Here you go this should work now   <?php include "globals.php"; $luck = ($ir['level']) / 5; $crew = ($ir['crewmembers']) / $luck; switch($_GET['action']) { case "buy": buy(); break; case "buycrew": buycrew(); break; case "commit"; commit(); break; default: index(); break; } print "<h3>Robbery</h3> [i]Hook up a robbery to earn some cash.[/i] [b]You currenltly have {$ir['crewmembers']} meaning there is a higher chance you succeed with more cash!"; function index() { global $db, $ir,$c,$userid,$h; print "[url='robbery.php?action=buycrew']Buy Crew Members[/url] [url='robbery.php?action=commit']Commit Robbery[/url] "; } function buy() { global $db, $ir,$c,$userid,$h; print "Buying an extra crew member for $1000 [url='robbery.php?action=buycrew']Buy a crew member ($1000)[/url] "; } function buycrew() { global $db, $ir,$c,$userid,$h; print "Buying A Crew Member "; if($ir['money'] < '1000') { print "<font color=red>Error!</font> You dont have enough for the crew member you need 1000 dollars [url='index.php']Back Home[/url] "; } if($ir['money'] > '999') { print "<font color=green>Success!</font> You buy a crew member for 1000 Dollars"; $db->query("UPDATE users SET money=money-1000 WHERE $userid=userid",$c); $db->query("UPDATE users SET crewmembers=crewmembers+1 WHERE $userid=userid",$c); } } function commit() { global $db, $ir,$c,$userid,$h; $cashearn= $ir['crewmembers']*150; print 'Commiting The Robbery '; if($ir['crewmembers'] == '0') { print "<font color=red>Error!</font> You dont have any crew members, This isnt a one man job! [url='index.php']Back Home[/url] "; } if($ir['crewmembers'] > '1') { $chance=rand(1,2); if ($chance == 1); { print "<font color=green>Success!</font> The robbery goes to plan and you earn {$cashearn}!, All your crew members leave you as well! "; $db->query("UPDATE users SET money=money+$cashearn WHERE $userid=userid",$c); $db->query("UPDATE users SET crewmembers=0 WHERE $userid=userid",$c); } } else { print "<font color=green>Fail!</font> The robbery doesnt go to plan all your crew members were shot down by S.W.A.T, only you managed to flee away!"; $db->query("UPDATE users SET crewmembers=0 WHERE $userid=userid",$c); } } $h->endpage(); ?>   And rememeber to thank Sniko' for the mod +1 if this helps :-D
  8. Re: [V2] Robbery Sorry give me 1 min and ill fix it :-D
  9. Re: [V2] Robbery Here you go guys this should work   <?php include "globals.php"; $luck = ($ir['level']) / 5; $crew = ($ir['crewmembers']) / $luck; $cashearn = $crew * 3; switch($_GET['action']) { case "buy": buy(); break; case "buycrew": buycrew(); break; case "commit"; commit(); break; default: index(); break; } print "<h3>Robbery</h3> [i]Hook up a robbery to earn some cash.[/i] [b]You currenltly have {$ir['crewmembers']} meaning there is a higher chance you succeed with more cash!"; function index() { global $db, $ir,$c,$userid,$h; print "[url='{$_SERVER[']Buy Crew Members[/url] [url='{$_SERVER[']Commit Robbery[/url] "; } function buy() { global $db, $ir,$c,$userid,$h; print "Buying an extra crew member for $1000 [url='{$_SERVER[']Buy a crew member ($1000)[/url] "; } function buycrew() { global $db, $ir,$c,$userid,$h; print "Buying A Crew Member "; if($ir['money'] < '1000') { print "<font color=red>Error!</font> You dont have enough for the crew member you need 1000 dollars [url='index.php']Back Home[/url] "; } if($ir['money'] > '999') { print "<font color=green>Success!</font> You buy a crew member for 1000 Dollars"; $db->query('UPDATE users SET money = money - 1000 WHERE userid = $userid'); $db->query('UPDATE users SET crewmembers = crewmembers + 1 WHERE userid = $userid'); } } function commit() { global $db, $ir,$c,$userid,$h; print 'Commiting The Robbery '; if($ir['crewmembers'] == '0') { print "<font color=red>Error!</font> You dont have any crew members, This isnt a one man job! [url='index.php']Back Home[/url] "; } if($ir['crewmembers'] > '1') { $chance=rand(1,2); if ($chance == 1); { print "<font color=green>Success!</font> The robbery goes to plan and you earn {$cashearn}!, All your crew members leave you as well!"; $db->query('UPDATE users SET money = money + {$cashearn}, crewmembers = 0 WHERE userid = $userid'); } } else { print "<font color=green>Fail!</font> The robbery doesnt go to plan all your crew members were shot down by S.W.A.T, only you managed to flee away!"; $db->query('UPDATE users SET crewmembers = 0 WHERE userid = $userid'); } } $h->endpage(); ?>   +1 Me if this works :-D
  10. Re: [Request][Any Version] No Display Picture Mod This Should Work   if($r['display_pic']) { print "[img={$r[]"; } else { print "[img=type images here]"; }   That goes in your viewuser page Hope this helps +1 if it does :-D
  11. Re: [mccode] Gangs no mine is in v2 i changed it the first time to keep with the mod tht everyone was using i just forgot last time
  12. Re: [mccode] Gangs no problem mate just hope plp like it
  13. Re: [mccode] Gangs I cant believe it took me 3 parts to do this add this to the end of the last one   function give_armory() { global $ir,$c,$userid,$h; $sql2 = sprintf("SELECT * FROM `factions` fa WHERE (faID = %u)", mysql_real_escape_string($ir['faction'])); $q2 = mysql_query($sql2); $r2 = mysql_fetch_array($q2); if ($r2['faLEADER'] != $userid) { print " You are not authorised to access this page. <hr width='90%'>> [url='factions.php']Back[/url]<hr width='90%'>"; } else if ($_POST['amount'] AND $_POST['item'] AND $_POST['user']) { $_POST['amount'] = abs((int) $_POST['amount']); $_POST['item'] = abs((int) $_POST['item']); $_POST['user'] = abs((int) $_POST['user']); $sql = sprintf("SELECT * FROM `faction_armoury` fi LEFT JOIN `items` i ON (i.itmid = fi.fiITEM) LEFT JOIN `users` u ON (u.userid = %d) WHERE fiFACTION = %d AND (fi.fiID = %u)", $_POST['user'], $ir['faction'], mysql_real_escape_string($_POST['item'])); $q = mysql_query($sql); $ir['itmHAVE'] = mysql_num_rows($q); $r = mysql_fetch_array($q); if(!$ir['itmHAVE']) { print " Your faction does not own that item. <hr width='90%'>> [url='manage_faction.php?step=armory']Back[/url]<hr width='90%'>"; } else if($r['fiAMOUNT'] < $_POST['amount']) { print " Your faction does not have enough of this item. <hr width='90%'>> [url='manage_faction.php?step=armory']Back[/url]<hr width='90%'>"; } else { $ins = sprintf("INSERT INTO `inventory` (`inv_id`, `inv_itemid`, `inv_userid`, `inv_qty`) VALUES ('NULL','%d', '%d', '%d')", $_POST['item'], $_POST['user'], $_POST['amount']); if ($r['fiAMOUNT'] > $_POST['amount']) { $use = sprintf("UPDATE `faction_armoury` SET fiAMOUNT = fiAMOUNT - %d WHERE fiFACTION = %d AND (fiID = %u)", mysql_real_escape_string($_POST['amount']), mysql_real_escape_string($ir['faction']), mysql_real_escape_string($_POST['item'])); } else { $use = sprintf("DELETE FROM `faction_armoury` WHERE (fiID = %u)", mysql_real_escape_string($_POST['item'])); } mysql_query($ins); mysql_query($use); print " You gave ".number_format($_POST['amount'])." {$r['itmname']}'s to {$r['username']}. <hr width='90%'>> [url='manage_faction.php?step=armory']Back[/url]<hr width='90%'>"; } } else { $sql = sprintf("SELECT * FROM `faction_armoury` fi LEFT JOIN `items` i ON (i.itmid = fi.fiITEM) LEFT JOIN `users` u ON (u.userid = fi.fiUSER) WHERE (fi.fiFACTION = %u)", $ir['faction']); $q = mysql_query($sql); print "<table width='90%' cellspacing='1'><tr bgcolor='#AAAAAA'> <th width='40%'>Item</th><th width='40%'>Donator</th><th width='20%'>Amount</th></tr>"; while ($r = mysql_fetch_array($q)) { print "<tr><td>{$r['itmname']}</td><td>[url='viewuser.php?u={$r[']{$r['username']}[/url]</td><td>{$r['fiAMOUNT']}</td></tr>"; } print "</table> [b]Give:[/b] <form action='manage_faction.php?step=agive' method='post'> <select name='item' type='dropdown'> <option value='0'>None</option>"; $itm = sprintf("SELECT * FROM `faction_armoury` fi LEFT JOIN `items` i ON (i.itmid = fi.fiITEM) WHERE (fi.fiFACTION = %u)", $ir['faction']); $itm = mysql_query($itm); while($it = mysql_fetch_array($itm)) { print "<option value='{$it['fiID']}'>{$it['itmname']}</option>"; } print "</select> <select name='user' type='dropdown'> <option value='0'>None</option>"; $usr = sprintf("SELECT * FROM `users` WHERE (faction = %u)", $ir['faction']); $usr = mysql_query($usr); while($us = mysql_fetch_array($usr)) { print "<option value='{$us['userid']}'>{$us['username']}</option>"; } print "</select> <input type='text' name='amount' size='5' maxlength='3'> <input type='submit' value='Submit'></form>"; print "<hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } print "<h3>Organised Crimes</h3> <form action='manage_faction.php?step=crimes2' method='post'>Choose a crime that your faction should commit. <select name='crime' type='dropdown'>"; $cnt=mysql_query("SELECT username FROM users WHERE faction={$h['faID']}",$c); $membs=mysql_num_rows($cnt); $q=mysql_query("SELECT * FROM orgcrimes WHERE ocUSERS <= $membs",$c); while($r=mysql_fetch_array($q)) { print "<option value='{$r['ocID']}'>{$r['ocNAME']} ({$r['ocUSERS']} members needed)</option>"; } print "</select> <input type='submit' value='Commit' /></form>"; } function faction_crimes() { global $ir,$c,$userid,$gangdata; if($h['facCRIME']) { print "This is the crime your faction is planning at the moment. [b]Crime:[/b] {$f['ocNAME']} [b]Hours Left:[/b] {$h['facCHOURS']}"; } else { print "Your faction is not currently planning a crime."; } } $h->endpage(); ?>   Hope you all enjoy this and don't forget the credit goes to the creator
  14. Re: [mccode] Gangs Second bit again just add at the end of the last one   function change_coleader() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa WHERE (faID = %u)", mysql_real_escape_string($ir['faction'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); if ($r['faLEADER'] != $userid) { print " You are not authorised to access this page. <hr width='90%'>> [url='factions.php']Back[/url]<hr width='90%'>"; } else if (!$_GET['act']) { print " Please select a new faction co-leader below: <form action='manage_faction.php?step=coleader&act=submit' method='post'> <select name='user' type='dropdown'>"; $users = sprintf("SELECT * FROM `users` WHERE (faction = %u)", mysql_real_escape_string($ir['faction'])); $use = mysql_query($users); while($us = mysql_fetch_array($use)) { print "<option value='{$us['userid']}'>{$us['username']}</option>"; } print "</select> <input type='submit' value='Change'></form> <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else if ($_GET['act'] == 'submit') { if ($_POST['user']) { $sql3 = sprintf("UPDATE `factions` SET `faCOLEADER` = '%s' WHERE (`faID` = %u)", mysql_escape_string($_POST['user']), $ir['faction']); mysql_query($sql3); print " Faction co-leader changed! <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else { print " You did not select a new faction co-leader! <hr width='90%'>> [url='manage_faction.php?step=coleader']Back[/url]<hr width='90%'>"; } } } function faction_vault() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa WHERE (faID = %u)", mysql_real_escape_string($ir['faction'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); print "<form action='manage_faction.php?step=donate' method='post'> <table cellspacing='1' border='0' cellpadding='1' class='table' width='60%'> <tr><td colspan='2' class='h'><font color=white><center>[b]Faction Vault[/b]</font></th></tr> <tr bgcolor='#DFDFDF' height='100'><td align='center' colspan='2'>Your faction vault currently contains ".money_formatter($r['faVAULT'])." and {$r['faPOINTS']} Points.</td></tr> <tr bgcolor='#AAAAAA'><th colspan='2'>Donate</th></tr> <tr bgcolor='#DFDFDF'><td align='center'> Money: <input type='text' name='money'> </td> <td align='center'> Points: <input type='text' name='points'> </td> </tr> <tr bgcolor='#AAAAAA'><th colspan='2'><input type='submit' value='Donate'></th></tr> </table><hr width='60%'>> [url='manage_faction.php']Back[/url]<hr width='60%'>"; } function donate_vault() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa WHERE (faID = %u)", mysql_real_escape_string($ir['faction'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); if ($_POST['money'] || $_POST['points']) { if($_POST['money'] > $ir['money']) { print " You are trying to donate more money than you have. <hr width='90%'>> [url='manage_faction.php?step=vault']Back[/url]<hr width='90%'>"; } else if($_POST['points'] > $ir['crystals']) { print " You are trying to donate more Points than you have. <hr width='90%'>> [url='manage_faction.php?step=vault']Back[/url]<hr width='90%'>"; } else { $fac = sprintf("UPDATE `users` SET crystals=crystals-%d, money=money-%d WHERE (userid = %u)", mysql_real_escape_string($_POST['points']), mysql_real_escape_string($_POST['money']), $userid); $use = sprintf("UPDATE `factions` SET faVAULT = faVAULT + %d, faPOINTS = faPOINTS + %d WHERE (faID = %u)", mysql_real_escape_string($_POST['money']), mysql_real_escape_string($_POST['points']), mysql_real_escape_string($ir['faction'])); mysql_query($fac); mysql_query($use); print " You donated ".money_formatter($_POST['money'])." and {$_POST['points']} Points to the faction. <hr width='90%'>> [url='manage_faction.php?step=vault']Back[/url]<hr width='90%'>"; } } else { print " You did not type an amount of money to donate to the faction. <hr width='90%'>> [url='manage_faction.php?step=vault']Back[/url]<hr width='90%'>"; } } function give_vault() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa WHERE (faID = %u)", mysql_real_escape_string($ir['faction'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); if ($r['faLEADER'] != $userid) { print " You are not authorised to access this page. <hr width='90%'>> [url='factions.php']Back[/url]<hr width='90%'>"; } else if (($_POST['money'] || $_POST['points']) AND $_POST['user']) { $sql2 = sprintf("SELECT * FROM `users` WHERE (userid = %u)", mysql_real_escape_string($_POST['user'])); $q2 = mysql_query($sql2); $r2 = mysql_fetch_array($q2); if($_POST['money'] > $r['faVAULT']) { print " You are trying to give more money than your faction has. <hr width='90%'>> [url='manage_faction.php?step=give']Back[/url]<hr width='90%'>"; } else if($_POST['points'] > $r['faPOINTS']) { print " You are trying to give more points than your faction has. <hr width='90%'>> [url='manage_faction.php?step=give']Back[/url]<hr width='90%'>"; } else { $fac = sprintf("UPDATE `users` SET crystals=crystals+%d, money=money+%d WHERE (userid = %u)", mysql_real_escape_string($_POST['points']), mysql_real_escape_string($_POST['money']), mysql_real_escape_string($_POST['user'])); $use = sprintf("UPDATE `factions` SET faVAULT = faVAULT - %d, faPOINTS = faPOINTS - %d WHERE (faID = %u)", mysql_real_escape_string($_POST['money']), mysql_real_escape_string($_POST['points']), mysql_real_escape_string($ir['faction'])); mysql_query($fac); mysql_query($use); print " You gave ".money_formatter($_POST['money'])." and {$_POST['points']} Points to [url='viewuser.php?u={$r2[']{$r2['username']}[/url]. <hr width='90%'>> [url='manage_faction.php?step=give']Back[/url]<hr width='90%'>"; } } else { print " <form action='manage_faction.php?step=give' method='post'> <table width='50%' cellspacing='1'> <tr bgcolor='#AAAAAA'><th colspan='2'>Faction Vault</th></tr> <tr bgcolor='#DFDFDF' height='100'><td align='center' colspan='2'>Your faction vault currently contains ".money_formatter($r['faVAULT'])." and {$r['faPOINTS']} Points.</td></tr> <tr bgcolor='#AAAAAA'><th colspan='2'>Give</th></tr> <tr bgcolor='#DFDFDF'><td align='center'> Money: <input type='text' name='money'> </td> <td align='center'> Points: <input type='text' name='points'> </td> </tr> <tr bgcolor='#DFDFDF'><td colspan='2' align='center' height='50'> <select name='user' type='dropdown'>"; $users = sprintf("SELECT * FROM `users` WHERE (faction = %u)", mysql_real_escape_string($ir['faction'])); $use = mysql_query($users); while($us = mysql_fetch_array($use)) { print "<option value='{$us['userid']}'>{$us['username']}</option>"; } print "</select></td></tr> <tr bgcolor='#AAAAAA'><th colspan='2'><input type='submit' value='Give'></th></tr> </table> <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } } function app_manage() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa WHERE (faID = %u)", mysql_real_escape_string($ir['faction'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); if ($r['faLEADER'] != $userid) { print " You are not authorised to access this page. <hr width='90%'>> [url='factions.php']Back[/url]<hr width='90%'>"; } else if (!$_GET['act']) { $sql2 = sprintf("SELECT * FROM `faction_apps` fp LEFT JOIN `users` u ON (u.userid = fp.fpUSER) LEFT JOIN `factions` fa ON (fa.faID = fp.fpFACTION) WHERE (fp.fpFACTION = %u)", mysql_real_escape_string($ir['faction'])); $q2 = mysql_query($sql2); print "This is a list of all applications to your faction. <table width='90%' cellspacing='1'><tr bgcolor='#AAAAAA'><th width='15%'>User</th><th width='50%'>Application</th><th width='15%'>Time</th><th width='20%'>Manage</th></tr>"; while($r2 = mysql_fetch_array($q2)) { print "<tr><td>[url='viewuser.php?u={$r2[']{$r2['username']}[/url]</td> <td>{$r2['fpAPP']}</td> <td>".date('F j Y, g:i:s a',$r2['fpTIME'])."</td> <td>[[url='manage_faction.php?step=apps&act=accept&ID={$r2[']Accept[/url] | [url='manage_faction.php?step=apps&act=decline&ID={$r2[']Decline[/url]]</td></tr>"; } print "</table> <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else if ($_GET['act'] == 'accept') { if ($_GET['ID']) { $sql2 = sprintf("SELECT * FROM `faction_apps` fp LEFT JOIN `users` u ON (u.userid = fp.fpUSER) LEFT JOIN `factions` fa ON (fa.faID = fp.fpFACTION) WHERE (fp.fpFACTION = %u)", mysql_real_escape_string($ir['faction'])); $q2 = mysql_query($sql2); $r2 = mysql_fetch_array($q2); $sql3 = sprintf("UPDATE `users` SET `faction` = '%s' WHERE (`userid` = %u)", mysql_escape_string($r2['fpFACTION']), $r2['fpUSER']); mysql_query($sql3); $sql4 = sprintf("DELETE FROM `faction_apps` WHERE (`fpID` = %u)", mysql_escape_string($_GET['ID'])); mysql_query($sql4); print " [url='viewuser.php?u={$r2[']{$r2['username']}[/url] was accepted into your faction! <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else { print " Invalid application ID! <hr width='90%'>> [url='manage_faction.php?step=pref']Back[/url]<hr width='90%'>"; } } else if ($_GET['act'] == 'decline') { if ($_GET['ID']) { $sql2 = sprintf("SELECT * FROM `faction_apps` fp LEFT JOIN `users` u ON (u.userid = fp.fpUSER) LEFT JOIN `factions` fa ON (fa.faID = fp.fpFACTION) WHERE (fp.fpFACTION = %u)", mysql_real_escape_string($ir['faction'])); $q2 = mysql_query($sql2); $r2 = mysql_fetch_array($q2); $sql4 = sprintf("DELETE FROM `faction_apps` WHERE (`fpID` = %u)", mysql_escape_string($_GET['ID'])); mysql_query($sql4); print " [url='viewuser.php?u={$r2[']{$r2['username']}[/url]'s application was denied! <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else { print " Invalid application ID! <hr width='90%'>> [url='manage_faction.php?step=pref']Back[/url]<hr width='90%'>"; } } } function faction_staff_orgcrimes() { global $ir,$c,$userid,$h; $_POST['crime'] = abs((int) $_POST['crime']); if($_POST['crime']) { if($h['facCRIME'] != 0) { print "Your Faction is already doing a crime!"; } else { mysql_query("UPDATE factions SET facCRIME={$_POST['crime']},facCHOURS=24 WHERE faID={$ir['faction']}",$c); print "You have started to plan this crime. It will take 24 hours."; } } else { print "<h3>Organised Crimes</h3> <form action='manage_faction.php?step=crimes2' method='post'>Choose a crime that your faction should commit. <select name='crime' type='dropdown'>"; $cnt=mysql_query("SELECT username FROM users WHERE faction={$h['faID']}",$c); $membs=mysql_num_rows($cnt); $q=mysql_query("SELECT * FROM orgcrimes WHERE ocUSERS <= $membs",$c); while($r=mysql_fetch_array($q)) { print "<option value='{$r['ocID']}'>{$r['ocNAME']} ({$r['ocUSERS']} members needed)</option>"; } print "</select> <input type='submit' value='Commit' /></form>"; } } function leave_faction() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa WHERE (faID = %u)", mysql_real_escape_string($ir['faction'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); if (!$_GET['act']) { print " Would you like to leave the {$r['faNAME']} faction: <form action='manage_faction.php?step=leave&act=conf' method='post'> <input type='submit' value='Leave'></form> <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else if ($_GET['act'] == 'conf') { if ($_POST['user'] AND ($r['faLEADER'] != $_POST['user']) AND ($r['faCOLEADER'] != $_POST['user'])) { $sql3 = sprintf("UPDATE `users` SET `faction` = '%d' WHERE (`userid` = %u)", 0, $userid); mysql_query($sql3); print " You left the faction! <hr width='90%'>> [url='explore.php']Back[/url]<hr width='90%'>"; } else { print " You cannot leave while you are still leader or co-leader! <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } } } function kick_member() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa WHERE (faID = %u)", mysql_real_escape_string($ir['faction'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); if ($r['faLEADER'] != $userid) { print " You are not authorised to access this page. <hr width='90%'>> [url='factions.php']Back[/url]<hr width='90%'>"; } else if (!$_GET['act']) { print " Please select a faction member to kick out: <form action='manage_faction.php?step=kick&act=submit' method='post'> <select name='user' type='dropdown'>"; $users = sprintf("SELECT * FROM `users` WHERE (faction = %u)", mysql_real_escape_string($ir['faction'])); $use = mysql_query($users); while($us = mysql_fetch_array($use)) { print "<option value='{$us['userid']}'>{$us['username']}</option>"; } print "</select> <input type='submit' value='Kick'></form> <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else if ($_GET['act'] == 'submit') { if ($_POST['user'] AND ($r['faLEADER'] != $_POST['user']) AND ($r['faCOLEADER'] != $_POST['user'])) { $sql3 = sprintf("UPDATE `users` SET `faction` = '%d' WHERE (`userid` = %u)", 0, $_POST['user']); mysql_query($sql3); print " This user was kicked out of the faction! <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else { print " You did not select a user to kick out! <hr width='90%'>> [url='manage_faction.php?step=kick']Back[/url]<hr width='90%'>"; } } } function donate_armory() { global $ir,$c,$userid,$h; if ($_POST['amount'] AND $_POST['item']) { $_POST['amount'] = abs((int) $_POST['amount']); $_POST['item'] = abs((int) $_POST['item']); $sql = sprintf("SELECT * FROM `inventory` inv LEFT JOIN `items` i ON (i.itmid = inv.inv_itemid) WHERE inv_userid = %d AND (inv.inv_id = %u)", $ir['userid'], mysql_real_escape_string($_POST['item'])); $q = mysql_query($sql); $ir['itmHAVE'] = mysql_num_rows($q); $r = mysql_fetch_array($q); if(!$ir['itmHAVE']) { print " You do not own that item. <hr width='90%'>> [url='manage_faction.php?step=armory']Back[/url]<hr width='90%'>"; } else if($r['inv_qty'] < $_POST['amount']) { print " You dont have enough of this item. <hr width='90%'>> [url='manage_faction.php?step=armory']Back[/url]<hr width='90%'>"; } else { $ins = sprintf("INSERT INTO `faction_armoury` (`fiID`, `fiFACTION`, `fiUSER`, `fiITEM`, `fiAMOUNT`) VALUES ('NULL','%d', '%d', '%d', '%d')", $ir['faction'], $ir['userid'], $r['itmid'], $_POST['amount']); if ($r['inv_qty'] > $_POST['amount']) { $use = sprintf("UPDATE `inventory` SET inv_qty = inv_qty - %d WHERE inv_userid = %d AND (inv_id = %u)", mysql_real_escape_string($_POST['amount']), mysql_real_escape_string($ir['userid']), mysql_real_escape_string($_POST['item'])); } else { $use = sprintf("DELETE FROM `inventory` WHERE (inv_id = %u)", mysql_real_escape_string($_POST['item'])); } mysql_query($ins); mysql_query($use); print " You donated ".number_format($_POST['amount'])." {$r['itmname']}'s to the faction. <hr width='90%'>> [url='manage_faction.php?step=armory']Back[/url]<hr width='90%'>"; } } else { $sql = sprintf("SELECT * FROM `faction_armoury` fi LEFT JOIN `items` i ON (i.itmid = fi.fiITEM) LEFT JOIN `users` u ON (u.userid = fi.fiUSER) WHERE (fi.fiFACTION = %u)", $ir['faction']); $q = mysql_query($sql); print "<table width='90%' cellspacing='1'><tr bgcolor='#AAAAAA'> <th width='40%'>Item</th><th width='40%'>Donator</th><th width='20%'>Amount</th></tr>"; while ($r = mysql_fetch_array($q)) { print "<tr><td>{$r['itmname']}</td><td>[url='viewuser.php?u={$r[']{$r['username']}[/url]</td><td>{$r['fiAMOUNT']}</td></tr>"; } print "</table> [b]Donate:[/b] <form action='manage_faction.php?step=armory' method='post'> <select name='item' type='dropdown'> <option value='0'>None</option>"; $itm = sprintf("SELECT * FROM `inventory` inv LEFT JOIN `items` i ON (i.itmid = inv.inv_itemid) WHERE (inv.inv_userid = %u)", $ir['userid']); $itm = mysql_query($itm); while($it = mysql_fetch_array($itm)) { print "<option value='{$it['inv_id']}'>{$it['itmname']}</option>"; } print "</select> <input type='text' name='amount' size='5' maxlength='3'> <input type='submit' value='Submit'></form>"; print "<hr width='90%'>> [url='manage_faction.php?step=armory']Back[/url]<hr width='90%'>"; } }
  15. Re: [mccode] Gangs but for now here is just a liitle bit of an improvement to it ive just cleaned it up a bit and added a few other things to it   <?php include (DIRNAME(__FILE__) . "/globals.php"); print ""; if (!$ir['faction']) { die (" You are not in a faction at this time. <hr width='90%'>> [url='explore.php']Back[/url]<hr width='90%'>"); } switch ($_GET['step']) { case 'profile': faction_profile(); break; case 'users': faction_members(); break; case 'index': staff_panel(); break; case 'name': change_name(); break; case 'desc': change_desc(); break; case 'vault': faction_vault(); break; case 'donate': donate_vault(); break; case 'status': change_status(); break; case 'give': give_vault(); break; case 'leave': leave_faction(); break; case 'members': faction_members(); break; case 'image': change_image(); break; case 'pref': change_pref(); break; case 'coleader': change_coleader(); break; case 'apps': app_manage(); break; case 'kick': kick_member(); break; case 'armory': donate_armory(); break; case 'agive': give_armory(); break; case "crimes": faction_crimes(); break; case "crimes2": faction_staff_orgcrimes(); break; default: faction_index(); break; } function faction_index() { global $ir,$c,$userid,$h; print "<table cellspacing='1' border='0' cellpadding='1' class='table' width='60%'> <tr><td colspan='2' class='h'><font color=white><center>[b]Faction[/b]</font></center></td></tr> <tr><td>[url='manage_faction.php?step=profile']Summary[/url]</td> <td>[url='manage_faction.php?step=vault']Faction Vault[/url]</td></tr> <tr><td>[url='manage_faction.php?step=users']Members[/url]</td> <td>[url='manage_faction.php?step=crimes']Crimes[/url]</td></tr> </td> <td>[url='manage_faction.php?step=armory']Faction Armory[/url]</td> <td>[url='manage_faction.php?step=index']Staff Room[/url]</td></tr> </td> <td>[url='manage_faction.php?step=leave']Leave Faction[/url]</td> <td></td></tr> "; print "</td></tr></table> "; } function faction_profile() { 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']) $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 cellspacing='1' border='0' cellpadding='1' class='table' width='75%'> <tr><font color=white><center> <table width='400' bgcolor='grey'><tr> <td valign='center' align='center'><font size='5'>[b]{$r['faNAME']}[/b]</font></td></tr></table>[img={$r[] <table width='400' bgcolor='grey'><tr><td width='200' valign='center'> <center>[b]Leader: [/b][url='viewuser.php?u={$r[']{$r['username']}[/url] "; $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][url='viewuser.php?u={$r[']{$co['username']}[/url] "; $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></tr></table> <table width='400' bgcolor='grey'><tr> <td width='50%' height='100%'> <table width='100%' height='100%'><tr> <td align='center'> {$r['faDESC']} </td> </tr></table></td></tr></table> <table cellspacing='1' border='0' cellpadding='1' class='table' width='100%'> <tr></table>"; } 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 cellspacing='1' border='0' cellpadding='1' class='table' width='75%'><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>[url='viewuser.php?u={$r[']{$r['username']}[/url]</td><td>{$r['level']}</td><td>{$r['faction_days']}</td></tr>"; } print "</table> <hr width='90%'>> [url='factions.php?step=profile&ID={$_GET[']Back[/url]<hr width='90%'>"; } function staff_panel() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa WHERE (faID = %u)", mysql_real_escape_string($ir['faction'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); if ($r['faLEADER'] != $userid) { print " You are not authorised to access this page. <hr width='90%'>> [url='factions.php']Back[/url]<hr width='90%'>"; } else if (!$_GET['act']) { print " <table cellspacing='1' border='0' cellpadding='1' class='table' width='60%'> <tr><td colspan='2' class='h'><font color=white><center>[b]Staff Room[/b]</font></center></td></tr> <tr><td>[url='manage_faction.php?step=name']Change Name[/url]</td> <td>[url='manage_faction.php?step=desc']Change Description[/url]</td></tr> <tr><td>[url='manage_faction.php?step=status']Change Status[/url]</td> <td>[url='manage_faction.php?step=image']Change Image[/url]</td></tr> <tr><td>[url='manage_faction.php?step=pref']Change Prefix[/url]</td> <td>[url='manage_faction.php?step=coleader']Change Co-Leader[/url]</td></tr> <tr><td>[url='manage_faction.php?step=give']Give Money / Points[/url]</td> <td>[url='manage_faction.php?step=apps']Manage Apps[/url]</td></tr> <tr><td>[url='manage_faction.php?step=crimes2']Organised Crimes[/url]</td> <td>[url='manage_faction.php?step=kick']Kick Member[/url]</td></tr> </td></tr> </table> [url='factions.php']Back[/url]"; } } function change_name() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa WHERE (faID = %u)", mysql_real_escape_string($ir['faction'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); if ($r['faLEADER'] != $userid) { print " You are not authorised to access this page. <hr width='90%'>> [url='factions.php']Back[/url]<hr width='90%'>"; } else if (!$_GET['act']) { print " Please type a new faction name below: <form action='manage_faction.php?step=name&act=submit' method='post'> <input type='text' name='name'> <input type='submit' value='Change'></form> <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else if ($_GET['act'] == 'submit') { $sql2 = sprintf("SELECT * FROM `factions` WHERE (`faNAME` LIKE '%%%s%%')", mysql_real_escape_string($_POST['name'])); $cn = mysql_query($sql2); $rows = mysql_num_rows($cn); if ($_POST['name'] AND !$rows) { $sql3 = sprintf("UPDATE `factions` SET `faNAME` = '%s' WHERE (`faID` = %u)", mysql_escape_string($_POST['name']), $ir['faction']); mysql_query($sql3); print " Faction name changed to {$_POST['name']}! <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else { print " You did not type a new name or the faction name is already taken! <hr width='90%'>> [url='manage_faction.php?step=name']Back[/url]<hr width='90%'>"; } } } function change_desc() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa WHERE (faID = %u)", mysql_real_escape_string($ir['faction'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); if ($r['faLEADER'] != $userid) { print " You are not authorised to access this page. <hr width='90%'>> [url='factions.php']Back[/url]<hr width='90%'>"; } else if (!$_GET['act']) { print " Please type a new faction description below: <form action='manage_faction.php?step=desc&act=submit' method='post'> <textarea type='text' name='desc' cols='50' rows='8'>{$r['faDESC']}</textarea> <input type='submit' value='Change'></form> <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else if ($_GET['act'] == 'submit') { if ($_POST['desc']) { $sql3 = sprintf("UPDATE `factions` SET `faDESC` = '%s' WHERE (`faID` = %u)", mysql_escape_string($_POST['desc']), $ir['faction']); mysql_query($sql3); print " Faction description changed! <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else { print " You did not type a new faction description! <hr width='90%'>> [url='manage_faction.php?step=desc']Back[/url]<hr width='90%'>"; } } } function change_status() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa WHERE (faID = %u)", mysql_real_escape_string($ir['faction'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); if ($r['faLEADER'] != $userid) { print " You are not authorised to access this page. <hr width='90%'>> [url='factions.php']Back[/url]<hr width='90%'>"; } else if (!$_GET['act']) { print " Please select a new faction status below: <form action='manage_faction.php?step=status&act=submit' method='post'> <select name='status' type='dropdown'> <option value='Peaceful'>Peaceful</option> <option value='Aggressive'>Aggressive</option> </select> <input type='submit' value='Change'></form> <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else if ($_GET['act'] == 'submit') { if ($_POST['status']) { $sql3 = sprintf("UPDATE `factions` SET `faSTATUS` = '%s' WHERE (`faID` = %u)", mysql_escape_string($_POST['status']), $ir['faction']); mysql_query($sql3); print " Faction status changed! <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else { print " You did not select a new faction status! <hr width='90%'>> [url='manage_faction.php?step=status']Back[/url]<hr width='90%'>"; } } } function change_image() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa WHERE (faID = %u)", mysql_real_escape_string($ir['faction'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); if ($r['faLEADER'] != $userid) { print " You are not authorised to access this page. <hr width='90%'>> [url='factions.php']Back[/url]<hr width='90%'>"; } else if (!$_GET['act']) { print " Please type a new faction image location below: <form action='manage_faction.php?step=image&act=submit' method='post'> <input type='text' name='image'> <input type='submit' value='Change'></form> <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else if ($_GET['act'] == 'submit') { if ($_POST['image']) { $sql3 = sprintf("UPDATE `factions` SET `faIMAGE` = '%s' WHERE (`faID` = %u)", mysql_escape_string($_POST['image']), $ir['faction']); mysql_query($sql3); print " Faction image changed! <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else { print " You did not type a new faction image location! <hr width='90%'>> [url='manage_faction.php?step=image']Back[/url]<hr width='90%'>"; } } } function change_pref() { global $ir,$c,$userid,$h; $sql = sprintf("SELECT * FROM `factions` fa WHERE (faID = %u)", mysql_real_escape_string($ir['faction'])); $q = mysql_query($sql); $r = mysql_fetch_array($q); if ($r['faLEADER'] != $userid) { print " You are not authorised to access this page. <hr width='90%'>> [url='factions.php']Back[/url]<hr width='90%'>"; } else if (!$_GET['act']) { print " Please type a new faction prefix below: <form action='manage_faction.php?step=pref&act=submit' method='post'> <input type='text' name='pref'> <input type='submit' value='Change'></form> <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else if ($_GET['act'] == 'submit') { if ($_POST['pref']) { $sql3 = sprintf("UPDATE `factions` SET `faPREF` = '%s' WHERE (`faID` = %u)", mysql_escape_string($_POST['pref']), $ir['faction']); mysql_query($sql3); print " Faction prefix changed! <hr width='90%'>> [url='manage_faction.php']Back[/url]<hr width='90%'>"; } else { print " You did not type a new faction prefix! <hr width='90%'>> [url='manage_faction.php?step=pref']Back[/url]<hr width='90%'>"; } } }
×
×
  • Create New...