Jump to content
MakeWebGames

Nicholas

Members
  • Posts

    467
  • Joined

  • Last visited

Everything posted by Nicholas

  1. hi everyone, im wondering... does anyone know how to make it so no matter what your max energy is, every 5 minutes you only get 5% energy (if non-donator) 8% energy (if donator) mysql_query("UPDATE users SET energy=energy+(maxenergy/(12.5)) WHERE energy < maxenergy AND donatordays=0"); mysql_query("UPDATE users SET energy=energy+(maxenergy/(6)) WHERE energy < maxenergy AND donatordays>0"); i cant figure it out... im not good with maths lol, i was thinking say you had 12 max energy. (which is level 1 character) i could get 5% energy every 5 minutes like this for a non-donator mysql_query("UPDATE users SET energy=energy+(maxenergy/(100*42)) WHERE energy<maxenergy AND donatordays=0"); that make like 5.04% energy... if you can do it like that with the /(100*42) but... then say you level up and get +1 max energy which be 13 energy and it has that /(100*42), you get 5.46% energy... can someone help please? NOTE: ive not tested this yet, dont wanna mess something up lol, so im asking professionals first
  2. could you tell me what isnt secure on it please mate? as im trying to learn security lol.
  3. oh, ill try and do some research ok, incase some the good coders dont look at this page.
  4. not sure if this is correct, i dont use this but wouldnt it be something like this? (not sure where to add it tho sorry) but maybe pasting it over this line? $u=$ir['username']; if($ir['donatordays']) { $u = "<font color=red>{$ir['username']}</font>";$d=""; } if($r['user_level'] == 2) { $user="<font color=gold>{$r['username']}</font>"; } else if($r['user_level'] == 3) { $user="<font color=green>{$r['username']}</font>"; } else if($r['user_level'] == 4) { $user="<font color=blue>{$r['username']}</font>"; } else if($r['user_level'] == 5) { $user="<font color=yellow>{$r['username']}</font>"; } else if($r['user_level'] == 6) { $user="<font color=purple>{$r['username']}</font>"; } else if($r['donatordays'] > 0) { $user="<font color=red>{$r['username']}</font>"; } else { $user="{$r['username']}"; } then put this where you want the username to display? $user ($r, is for when other people see the username, if thats understandable lol) or $user ($ir, is for when the actual player see thats name, if thats understandable lol) REMEMBER, ITS NOT TESTED, SO BACK UP THE FILE FIRST!
  5. i think i know whats going on? Query was SELECT * FROM votes WHERE userid=2 AND list='2' shouldnt the query be sending the information in like this Query was SELECT * FROM votes WHERE userid=2 AND list='awg' (awg is Apex Web Gaming) to put it in the database like this... userid | list 2 | awg with the votes database like this   CREATE TABLE IF NOT EXISTS `votes` ( `userid` int(11) NOT NULL default '0', `list` varchar(255) collate latin1_general_ci NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;   this is my voting file...   <?php session_start(); if(get_magic_quotes_gpc() == 0) { foreach($_POST as $k => $v) { $_POST[$k]=addslashes($v); } foreach($_GET as $k => $v) { $_GET[$k]=addslashes($v); } } require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; include "config.php"; global $_CONFIG; 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; $is=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid"); $ir=$db->fetch_row($is); $q=$db->query("SELECT * FROM votes WHERE userid=$userid AND list='awg'"); if($db->num_rows($q)) { print "You have already voted at Apex Web Gaming today!"; } else { $db->query("INSERT INTO votes values ($userid,'awg')"); $db->query("UPDATE users SET crystals=crystals+10, money=money+250 WHERE userid=$userid"); header("Location:http://apexwebgaming.com/in/4352"); exit; } ?>   this is the voting file where the players get the information from for voting? as you can see there is 2 awg's, i think the first awg is line $q=$db->query("SELECT * FROM votes WHERE userid=$userid AND list='awg'"); and maybe yours is set up like... $q=$db->query("SELECT * FROM votes WHERE userid=$userid AND list='2"); and maybe line $db->query("INSERT INTO votes values ($userid,'awg')"); has the letters or number where the awg is and its typed in differently, both the awg's have to typed in the same on both lines? if you know what i mean lol hopefully ive not said it in a confusing way...
  6. Continued... acceptpro.php   <?php include(DIRNAME(__FILE__).'/globals.php'); if(!$_GET['pro'] || !ctype_digit($_GET['pro'])) { echo ('You\'ve clicked an invalid link, please report to an administrator.'); $h->endpage(); exit(); } $m=$db->query("SELECT * FROM proposals WHERE (`proID` = ".abs(intval($_GET['pro'])).") AND (`proPROPOSED` = $userid)"); if(!mysql_num_rows($m)) { echo ('You\'ve clicked an invalid link, please report to an administrator.'); $h->endpage(); exit(); } else { $m=$db->query("SELECT * FROM proposals WHERE proID=".abs(intval($_GET['pro']))." AND proPROPOSED=$userid"); $pro=$db->fetch_row($m); $db->query("UPDATE `users` SET `married` =".abs(intval($pro['proPROPOSER']))." WHERE (`userid` = $userid)"); $db->query("UPDATE `users` SET `married` =".abs(intval($pro['proPROPOSED']))." WHERE (`userid` = ".abs(intval($pro['proPROPOSER'])).")"); $db->query("DELETE FROM proposals WHERE (proID=".abs(intval($pro['proID'])).")"); $mr=$db->query("SELECT * FROM `users` WHERE (`userid` =".abs(intval($pro['proPROPOSER'])).")"); $par=$db->fetch_row($mr); event_add($par['userid'],"<font color=white>Your proposal for [url='viewuser.php?ID={$ir[']{$ir['username']}[/url] was accepted",$c); print"<span style = 'color:yellow'>You married {$par['username']}!</span> "; } $h->endpage(); ?>   declinepro.php <?php require "globals.php"; if(!$_GET['pro'] || !ctype_digit($_GET['pro'])) { die("Stop abusing our marriage system!"); } $m=$db->query("SELECT * FROM proposals WHERE proID=".abs(intval($_GET['pro']))." AND proPROPOSED=$userid"); if ($db->num_rows($m) == 0) { print "<font color=white>Invalid proposal or this is not your proposal"; } else { $pro=$db->fetch_row($m); $db->query("DELETE FROM proposals WHERE proID=".abs(intval($pro['proID'])).""); $mr=$db->query("SELECT * FROM users WHERE userid=".abs(intval($pro['proPROPOSER'])).""); $par=$db->fetch_row($mr); event_add($par['userid'],"{$ir['username']} [{$ir['userid']}] has declined your proposal",$c); print"<font color=white>You declined the proposal from</font> <font color=yellow>{$par['username']}</font>! "; } $h->endpage(); ?>   decision.php <?php include "globals.php"; $m=$db->query("SELECT * FROM proposals WHERE proPROPOSED={$ir['userid']}"); if ($db->num_rows($m)==0) { die("Nobody has proposed to you! <a href=index.php>> Back</a>"); } else { $pro=$db->fetch_row($m); $f=$db->query("SELECT * FROM users WHERE userid={$pro['proPROPOSER']}"); $r=$db->fetch_row($f); print"<h3>Decision Center</h3> <center><table width=80% cellspacing=1 class=table border=1 bordercolor=#636363></center><tr><td> Proposer: [url='viewuser.php?u={$r[']{$r['username']}[/url] </td> <td>Message: {$pro['proMESSAGE']} </td> <td>Decision: [url='acceptpro.php?pro={$pro[']<font color=green>Accept</font>[/url] or [url='declinepro.php?pro={$pro[']<font color=red>Decline</font>[/url]</td></tr></table>"; } $h->endpage(); ?>
  7. i think i secured my verison lol (also a better layout) partner.php <?php include "globals.php"; $m=$db->query("SELECT * FROM users WHERE userid={$ir['married']}"); $par=$db->fetch_row($m); if($ir['married'] == 0) { die("You are not married, come back when you have a partner"); } $_GET['action'] = (isset($_GET['action']) && is_string($_GET['action'])) ? stripslashes(trim($_GET['action'])) : FALSE; switch($_GET['action']) { case 'givemoney': give_money_form(); break; case 'givemoneysub': give_money_submit(); break; case 'givecrystals': give_crystals_form(); break; case 'givecrystalssub': give_crystals_submit(); break; case 'givebank': give_bank_form(); break; case 'givebanksub': give_bank_submit(); break; case 'givebankcrystals': give_bankcrystals_form(); break; case 'givebankcrystalssub': give_bankcrystals_submit(); break; case 'takemoney': take_money_form(); break; case 'takemoneysub': take_money_submit(); break; case 'takecrystals': take_crystals_form(); break; case 'takecrystalssub': take_crystals_submit(); break; case 'takebank': take_bank_form(); break; case 'takebanksub': take_bank_submit(); break; case 'takecbank': take_cbank_form(); break; case 'takecbanksub': take_cbank_submit(); break; case 'sleep': sleep_form(); break; case 'sleepsub': sleep_submit(); break; case 'divorce': divorce(); break; case 'allowence': allowence_form(); break; default: index(); break; } function give_money_form() { global $db,$ir,$c,$h,$userid,$par; print "<h3>Giving Money</h3> This action will give your money to your partner You currently have [b]\${$ir['money']}[/b] that you could send. <form action='partner.php?action=givemoneysub' method='post'> Money: <input type='text' name='money' value='0'> <input type='submit' value='Give Money' /></form>"; } function give_money_submit() { global $db,$ir,$c,$h,$userid,$par; if ($ir['money'] < $_POST['money']) { die("You are trying to give more money than you can [url='partner.php?action=givemoney']Back[/url]"); } else { $db->query("UPDATE users SET money=money+".abs(floatval($_POST['money']))." WHERE userid={$par['userid']}"); $db->query("UPDATE users SET money=money-".abs(floatval($_POST['money']))." WHERE userid=$userid"); event_add($par['userid'],"You partner has just given you \${$_POST['money']}",$c); print"You gave \${$_POST['money']} to your partner"; } } function give_crystals_form() { global $db,$ir,$c,$h,$userid,$par; print "<h3>Giving crystals</h3> This action will give your crystals to your partner You currently have [b]{$ir['crystals']}[/b] crystals that you could send. <form action='partner.php?action=givecrystalssub' method='post'> Crystals: <input type='text' name='crystals' value='0'> <input type='submit' value='Give crystals' /></form>"; } function give_crystals_submit() { global $db,$ir,$c,$h,$userid,$par; if ($ir['crystals'] < $_POST['crystals']) { die("You are trying to give more crystals than you can. [url='partner.php?action=givecrystals']Back[/url]"); } else { $db->query("UPDATE users SET crystals=crystals+".abs(floatval($_POST['crystals']))." WHERE userid={$par['userid']}"); $db->query("UPDATE users SET crystals=crystals-".abs(floatval($_POST['crystals']))." WHERE userid=$userid"); event_add($par['userid'],"You partner has just given you {$_POST['crystals']} crystals",$c); print"You gave {$_POST['crystals']} crystals to your partner"; } } function give_bank_form() { global $db,$ir,$c,$h,$userid,$par; if ($ir['bankmoney'] < 0) { die("You dont have a bank account"); } if ($par['bankmoney'] < 0) { die("Your partner doesnt have a bank account"); } else { print "<h3>Giving Bank Money</h3> This action will give bank money to your partner You currently have [b]\${$ir['bankmoney']}[/b] that you could send. <form action='partner.php?action=givebanksub' method='post'> Bank Money: <input type='text' name='bankmoney' value='0'> <input type='submit' value='Give Bank Money' /></form>"; } } function give_bank_submit() { global $db,$ir,$c,$h,$userid,$par; if ($ir['bankmoney'] < $_POST['bankmoney']) { die("You are trying to give more bank money than you can [url='partner.php?action=givecrystals']Back[/url]"); } else { $db->query("UPDATE users SET bankmoney=bankmoney+".abs(floatval($_POST['bankmoney']))." WHERE userid={$par['userid']}"); $db->query("UPDATE users SET bankmoney=bankmoney-".abs(floatval($_POST['bankmoney']))." WHERE userid=$userid"); event_add($par['userid'],"You partner has just wired you \${$_POST['bankmoney']} into your bank account",$c); print"You wired \${$_POST['bankmoney']} to your partner"; } } function give_bankcrystals_form() { global $db,$ir,$c,$h,$userid,$par; print "<h3>Giving Bank crystals</h3> This action will give your bank crystals to your partner You currently have [b]{$ir['bankcrystals']}[/b] bank crystals that you could send. <form action='partner.php?action=givebankcrystalssub' method='post'> Bank Crystals: <input type='text' name='bankcrystals' value='0'> <input type='submit' value='Give Bank Crystals' /></form>"; } function give_bankcrystals_submit() { global $db,$ir,$c,$h,$userid,$par; if ($ir['bankcrystals'] < $_POST['bankcrystals']) { die("You are trying to give more bank crystals than you can. [url='partner.php?action=givebankcrystals']Back[/url]"); } else { $db->query("UPDATE users SET bankcrystal=bankcrystal+".abs(floatval($_POST['bankcrystals']))." WHERE userid={$par['userid']}"); $db->query("UPDATE users SET bankcrystal=bankcrystal-".abs(floatval($_POST['bankcrystals']))." WHERE userid=$userid"); event_add($par['userid'],"You partner has just given you {$_POST['bankcrystals']} crystals",$c); print"You gave {$_POST['bankcrystals']} crystals to your partner"; } } function take_money_form() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their money."); } else { print "<h3>Take Money</h3> This action will take money from your partner Your partner has \${$par['money']}. <form action='partner.php?action=takemoneysub' method='post'> Money: <input type='text' name='money' value='{$par['money']}'> <input type='submit' value='Take Money' /></form>"; } } function take_money_submit() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their money."); } if ($par['money'] < $_POST['money']) { die("You are trying to take more money than you can. [url='partner.php?action=takemoney']Back[/url]"); } else { $db->query("UPDATE users SET money=money+".abs(floatval($_POST['money']))." WHERE userid=$userid"); $db->query("UPDATE users SET money=money-".abs(floatval($_POST['money']))." WHERE userid={$par['userid']}"); event_add($par['userid'],"Your partner has just taken \${$_POST['money']} from your hand money",$c); print"You took \${$_POST['money']} from your partner"; } } function take_crystals_form() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their crystals"); } else { print "<h3>Take Crystals</h3> This action will take crystals from your partner Your partner has {$par['crystals']} crystals. <form action='partner.php?action=takecrystalssub' method='post'> Crystals: <input type='text' name='crystals' value='{$par['crystals']}'> <input type='submit' value='Take Crystals' /></form>"; } } function take_crystals_submit() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their crystals."); } if ($par['crystals'] < $_POST['crystals']) { die("You are trying to take more crystals than you can. [url='partner.php?action=takecrystals']Back[/url]"); } else { $db->query("UPDATE users SET crystals=crystals+".abs(floatval($_POST['crystals']))." WHERE userid=$userid"); $db->query("UPDATE users SET crystals=crystals-".abs(floatval($_POST['crystals']))." WHERE userid={$par['userid']}"); event_add($par['userid'],"Your partner has just taken {$_POST['crystals']} crystals from you",$c); print"You took {$_POST['crystals']} crystals from your partner"; } } function take_bank_form() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their finacial bank money."); } if ($ir['bankmoney'] < 0) { die("You dont have a bank account"); } if ($par['bankmoney'] < 0) { die("Your partner dose not have a bank account"); } else { print "<h3>Take Bank Money</h3> This action will take bank money from your partner Your partner has \${$par['bankmoney']}. <form action='partner.php?action=takebanksub' method='post'> Bank Money: <input type='text' name='bank' value='{$par['bankmoney']}'> <input type='submit' value='Take Bank Money' /></form>"; } } function take_bank_submit() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their bank money."); } if ($par['bankmoney'] < $_POST['bankmoney']) { die("You are trying to take more bank money than you can [url='partner.php?action=takebank']Back[/url]"); } else { $db->query("UPDATE users SET bankmoney=bankmoney+".abs(floatval($_POST['bankmoney']))." WHERE userid=$userid"); $db->query("UPDATE users SET bankmoney=bankmoney-".abs(floatval($_POST['bankmoney']))." WHERE userid={$par['userid']}"); event_add($par['userid'],"Your partner has just taken \${$_POST['bank']} from your bank account",$c); print"You took \${$_POST['bank']} from your partner"; } } function take_cbank_form() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their bank crystals."); } if ($ir['bankcrystals'] < 0) { die("You dont have a crystal bank account"); } if ($par['bankcrystals'] < 0) { die("Your partner doesnt have a crystal bank account."); } else { print "<h3>Take Bank Crystals</h3> This action will take bank money from your partner Your partner has {$par['bankcrystals']} bank crystals. <form action='partner.php?action=takebanksub' method='post'> Bank Crystals: <input type='text' name='cbank' value='{$par['bankcrystals']}'> <input type='submit' value='Take Bank Money' /></form>"; } } function take_cbank_submit() { global $db,$ir,$c,$h,$userid,$par; if ($par['allowence'] == 0) { die("Your partner hasnt allowed your to access their bank crystals."); } if ($par['bankcrystals'] < $_POST['cbank']) { die("You are trying to take more bank money than you can [url='partner.php?action=takecbank']Back[/url]"); } else { $db->query("UPDATE users SET bankcrystals=bankcrystals+".abs(floatval($_POST['bankcrystals']))." WHERE userid=$userid"); $db->query("UPDATE users SET bankcrystals=bankcrystals-".abs(floatval($_POST['bankcrystals']))." WHERE userid={$par['userid']}"); event_add($par['userid'],"Your partner has just taken {$_POST['bankcrystals']} crystals from your bank account",$c); print"You took {$_POST['bankcrystals']} bank crystals from your partner"; } } function sleep_form() { global $db,$ir,$c,$h,$userid,$par; if($ir['tired'] == 1) { die("You are too tired to sleep with your partner again"); } print "<h3>Sleep with your Partner?</h3> <form action='partner.php?action=sleepsub' method='post'> <input type='submit' value='Sleep With {$par['username']}' /></form>"; } function sleep_submit() { global $db,$ir,$c,$h,$userid,$par; if($ir['tired'] == 1) { die("You are too tired to sleep with your partner again"); } if (!$_POST['msg']) { $db->query("UPDATE users SET happiness=happiness+1 WHERE userid=$userid"); $db->query("UPDATE users SET tired=1 WHERE userid=$userid"); event_add($par['userid'],"Your partner has just slept with you. Please take a pregnancy test.",$c); print"You slept with your partner and gained 1 happiness!"; } } function divorce() { global $ir, $mr, $c, $userid, $h; mysql_query("UPDATE users SET married=0 WHERE userid IN($userid, {$ir['married']})", $c); event_add($ir['married'],"{$ir['username']} divorced you... Your now single...",$c); print "You divorced your partner and went back to being single. > [url='index.php']Back[/url]"; } function allowence_form() { global $db,$ir,$c,$h,$userid,$par; print "<h3>C</h3> This action will decide wether you want to allow your partner to take money, crystals, bank money, bank crystals, etc or not... [[url='partner.php?action=allowence&allow=yes']Allow[/url]] [[url='partner.php?action=allowence&allow=no']Do Not Allow[/url]] "; if($_GET['allow'] == yes) { $db->query("UPDATE users SET allowence=1 WHERE userid=$userid"); print" Now your partner is allowed to access your finance"; } else if($_GET['allow'] == no) { $db->query("UPDATE users SET allowence=0 WHERE userid=$userid"); print" Now your partner isnt allowed to access your finance"; } } function index() { global $db,$ir,$c,$h,$userid,$par; print " <h3><center>Information</h3> <center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center> <tr> <th><font color=gold>Theirs</th> <th><font color=gold>Yours</th> </tr> <tr> <td><center>Money: \${$par['money']}</td> <td><center>Money: \${$ir['money']}</td> </tr> <td><center>Crystals: {$par['crystals']}</td> <td><center>Crystals: {$ir['crystals']}</td> </tr> <tr> <td><center>Banked Money: \${$par['bankmoney']}</td> <td><center>Banked Money: \${$ir['bankmoney']}</td> </tr> <tr> <td><center>Banked Crystals: {$par['bankcrystals']}</td> <td><center>Banked Crystals: {$ir['bankcrystals']}</td> </tr> </table> <h3><center>Partner Managment</h3> <center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center> <tr> <td>[url='partner.php?action=givemoney']<center>Send Money[/url]</td> <td>[url='partner.php?action=takemoney']<center>Take Money[/url]</td> </tr><tr> <td>[url='partner.php?action=givebank']<center>Send Bank Money[/url]</td> <td>[url='partner.php?action=takebank']<center>Take Bank Money[/url]</td> </tr><tr> <td>[url='partner.php?action=givecrystals']<center>Send Crystals[/url]</td> <td>[url='partner.php?action=takecrystals']<center>Take Crystals[/url]</td> </tr><tr> <td>[url='partner.php?action=givebankcrystals']<center>Send Bank Crystals[/url]</td> <td>[url='partner.php?action=takecbank']<center>Take Bank Crystals[/url]</td> </tr><tr> <td><a href='partner.php?action=sleep'><center>Sleep With {$par['username']}</td> <td>[url='partner.php?action=allowence']<center>Marriage Allowence![/url]</td> </tr><tr> <td colspan='2'>[url='partner.php?action=divorce']<center>Divorce[/url]</td></tr></table> <h3><center>Marriage Stats</h3> <center><table width=60% cellspacing=1 class='table' border='1' bordercolor='#636363'></center> <tr> <td><center>Your Happiness: {$ir['happiness']}</td> <td><center>Their Happiness: {$par['happiness']}</td></tr></table>"; } $h->endpage(); ?>   you might have to add bankcrystals to your database or remove the functions for it. (i dont have cyber bank (donator bank), so its not on there, you have to copy and moditfy the send/take banking function, if you want it.) ALTER TABLE `users` ADD `bankcrystals` INT(11) NOT NULL DEFAULT '-1'; continued...
  8. oh since its a paid mod. contact the person you brought it off.
  9. post up your voting.php file, maybe we can extract the sql for the database out of it?
  10. cheers that works. :)
  11. hi, im wondering... can anyone make me a shops mod where its not basiced on city location? (my new game isnt gonna have citys, depending on your level) it will have 3 different pages? (in 1 file) for example, shop.php?page=weapon (this one will only sell weapons that are on the game for sale) shop.php?page=armour (this one will only sell armour that are on the game for sale) shop.php?page=others (this one will only sell other items like hospital cards, jail cards, health packs, blah blah blah...) hopefully you know what i mean lol. if you need more information, please do contact me. :)
  12. couldnt get it to work :( but thanks for trying :)
  13. hi im wondering, i have tried but had no luck... couldnt get the item inventory id to show to confirm... but anyways... could someone please create a itemuse.php file where you have to confirm to use the item, with like a YES! use the item (if you want to use that item) or a NO! changed my mind (if you didnt want to you the item) hopefully you understand what i mean, and hopefully someone will make it for us all :) Thanks, Nicholas.
  14. lmao... also it dont work on my login/register some reason.
  15. i called this file "title.js"   //change title text to your own var titletext = " Criminals Nightmare " var thetext = "" var started = false var step = 0 var times = 1 function welcometext() { times-- if(times == 0) { if(started == false) { started = true; document.title = titletext; setTimeout("anim()",1); } thetext = titletext; } } function showstatustext(txt) { thetext = txt; setTimeout("welcometext()",4000) times++ } function anim() { step++ if (step == 7) {step = 1} if (step == 1) {document.title = '>---'+thetext+'---<'} if (step == 2) {document.title = '->--'+thetext+'--<-'} if (step == 3) {document.title = '>->-'+thetext+'-<-<'} if (step == 4) {document.title = '->->'+thetext+'<-<-'} if (step == 5) {document.title = '-->-'+thetext+'-<--'} if (step == 6) {document.title = '--->'+thetext+'<---'} setTimeout("anim()",200); } if (document.title) window.onload = onload = welcometext then open up "header.php" (doesnt work on "login.php" or "register.php") and find...   <title>{$set['game_name']}</title> under it put this...   <script type='text/javascript' src='/title.js'></script>   all it does is adds some arrows moving all the time on both ends of your game title if you wanna see what it does first, go to... http://criminals-nightmare.co.uk/
  16. i like this recode, had to remove formatter on each line it was on to get it to work. but its a great recode +1 mate. :)
  17. lmao... i was just about to make this. thanks for making it :) +1
  18. still in 2 files but i updated it little... this is "ayl.php"; <?php include "globals.php"; $atks=$db->query("SELECT a.*,u1.username as attackern, u2.username as attackedn,u2.gang as attacked_gang FROM attacklogs a LEFT JOIN users u1 ON a.attacker=u1.userid LEFT JOIN users u2 ON a.attacked=u2.userid WHERE (u2.userid=$userid) AND result='won' ORDER BY time DESC LIMIT 100"); print "[b]Attack Logs - The last 100 players that killed you.[/b] <center><table width=65% cellspacing=1 class='table' border='1' bordercolor='#636363'></center> <tr style='background:black'> <th>Time</th> <th>Attacker</th> <th>What Happened</th> </tr>"; while($r=$db->fetch_row($atks)) { $d=date('F j, Y, g:i:s a',$r['time']); print "<tr> <td><center>$d</td> <td>[url='viewuser.php?u={$r[']<center>{$r['attackern']}[/url] </td><td><center>"; if($r['stole'] == -1) { print "Hospitalized"; } else if ($r['stole'] == -2) { print "Left"; } else { print "Mugged"; } print "</td></tr>"; } print "</table>"; ?> this is "ayw.php";   <?php include "globals.php"; $atks=$db->query("SELECT a.*,u1.username as attackern, u2.username as attackedn FROM attacklogs a LEFT JOIN users u1 ON a.attacker=u1.userid LEFT JOIN users u2 ON a.attacked=u2.userid WHERE (u1.userid=$userid) AND result='won' ORDER BY time DESC LIMIT 100"); print "[b]Attack Logs - The last 100 players you have killed.[/b] <center><table width=65% cellspacing=1 class='table' border='1' bordercolor='#636363'></center> <tr style='background:black'> <th>Time</th> <th>Attacked</th> <th>What You Done</td> </tr>"; while($r=$db->fetch_row($atks)) { $d=date('F j, Y, g:i:s a',$r['time']); print "<tr> <td><center>$d</td> <td>[url='viewuser.php?u={$r[']<center>{$r['attackedn']}[/url]</td><td><center>"; if($r['stole'] == -1) { print "Hospitalized"; } else if ($r['stole'] == -2) { print "Left"; } else { print "Mugged"; } print "</td></tr>"; } print "</table>"; ?> unless you already had the joined together one... replace the information with this...   <?php require_once("globals.php"); $_GET['action'] = isset($_GET['action']) && is_string($_GET['action']) ? strtolower(trim($_GET['action'])) : false; switch($_GET['action']) { case 'attackwon': attackwon(); break; case 'attacklost': attacklost(); break; } function attackwon() { global $db,$userid; $atks=$db->query("SELECT a.*,u1.`username` AS `attackern`, u2.`username` AS `attackedn` FROM `attacklogs` a LEFT JOIN `users` u1 ON a.`attacker`=u1.`userid` LEFT JOIN `users` u2 ON a.`attacked`=u2.`userid` WHERE (u1.`userid`=$userid) AND `result`='won' ORDER BY time DESC LIMIT 100"); echo "[b]Attack Logs - The last 100 players you have killed.[/b] <center><table width=65% cellspacing=1 class='table' border='1' bordercolor='#636363'></center> <tr> <th>Time</th> <th>Attacked</th> <th>What You Done</th> </tr>"; while($r=$db->fetch_row($atks)) { $d=date('F j, Y, g:i:s a',$r['time']); echo "<tr> <td><center>$d</td> <td>[url='viewuser.php?u=".abs((int) $r[']<center>".stripslashes($r['attackedn'])."[/url]</td><td><center>"; if($r['stole'] == -1) { print "Hospitalized"; } else if ($r['stole'] == -2) { print "Left"; } else { print "Mugged"; } print "</td></tr>"; } echo "</table>"; } function attacklost { global $db,$userid; $atks=$db->query("SELECT a.*,u1.`username` AS `attackern`, u2.`username` AS `attackedn` FROM `attacklogs` a LEFT JOIN `users` u1 ON a.`attacker`=u1.`userid` LEFT JOIN `users` u2 ON a.`attacked`=u2.`userid` WHERE (u2.`userid`=$userid) AND `result`='won' ORDER BY time DESC LIMIT 100"); echo "[b]Attack Logs - The last 100 players that killed you.[/b] <center><table width=65% cellspacing=1 class='table' border='1' bordercolor='#636363'></center> <tr> <th>Time</th> <th>Attacker</th> <th>What Happened</th> </tr>"; while($r=$db->fetch_row($atks)) { $d=date('F j, Y, g:i:s a',$r['time']); print "<tr> <td><center>$d</td> <td>[url='viewuser.php?u=".abs((int) $r[']<center>".stripslashes($r['attackern'])."[/url] </td><td><center>"; if($r['stole'] == -1) { print "Hospitalized"; } else if ($r['stole'] == -2) { print "Left"; } else { print "Mugged"; } print "</td></tr>"; } echo "</table>"; } ?>
  19. lol your welcome...
  20. well its upto them if they want to add it lol. also on the mining mod i would put this to make it look better. lol.   <center><hr /> Your Current Mining Power is: [b]".number_format($s['power'])."/".number_format($s['max_power'])."[/b]. Your Mining Level is [b]".number_format($s['mine_level'])."[/b]. Your Mining Experience is [b]".number_format($s['mine_exp'])."[/b]. Your Mining Experience required is [b]".number_format($s['mine_needed'])."[/b] to level up. <hr /> </center>   makes it look better i think lol.
  21. you forgot to add the bars on here for the header.php   $power=(int) ($ir['power']/$ir['max_power']*100); $minexp=(int) ($ir['mine_exp']/$ir['mine_needed']*100); $pow=100-$power; $minex=100-$minexp;   [b]Mining Power:[/b] ({$ir['power']}/{$ir['max_power']}) <img src=bluebar.png width=$power height=10><img src=redbar.png width=$pow height=10> [b]Mining EXP:[/b] ({$ir['mine_exp']}/{$ir['mine_needed']}) <img src=bluebar.png width=$minexp height=10><img src=redbar.png width=$minex height=10>   not tested. lol.
  22. hi, i done some modifications on my attacking mod. its easy to make but oh well lol. find in attack.php... $_GET['ID'] == (int) $_GET['ID']; if(!$_GET['ID']) { print "WTF you doing, bro?"; $h->endpage(); exit; } else if($_GET['ID'] == $userid) { print "Only the crazy attack themselves."; $h->endpage(); exit; } else if ($ir['hp'] <= 1) { print "Only the crazy attack when their unconscious. [url='index.php']Back[/url]"; $h->endpage(); exit; } else if ($_SESSION['attacklost'] == 1) { print "Only the losers of all their EXP attack when they've already lost. [url='index.php']Back[/url]"; $_SESSION['attacklost']=0; $h->endpage(); exit; } //get player data $youdata=$ir; $q=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$_GET['ID']}"); $odata=$db->fetch_row($q); $myabbr=($ir['gender']=="Male") ? "his" : "her"; $oabbr=($ir['gender']=="Male") ? "his" : "her"; if($ir['attacking'] && $ir['attacking'] != $_GET['ID']) { print "Bad, bad, bad girl. [url='index.php']Back[/url]"; $_SESSION['attacklost']=0; $h->endpage(); exit; } if($odata['hp'] == 1) { print "This player is unconscious. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if($odata['hospital']) { print "This player is in hospital. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if($ir['hospital']) { print "While in hospital you can't attack. [url='hospital.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if($odata['jail']) { print "This player is in jail. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if($ir['jail']) { print "While in jail you can't attack. [url='jail.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if($odata['travelling']) { print "That player is travelling. [url='index.php']> Back[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } replace with this...   $_GET['ID'] = isset($_GET['ID']) && is_numeric($_GET['ID']) ? abs(@intval($_GET['ID'])) : false; if(!$_GET['ID']) { print "<font color=white>Invalid Command, Try Again Later. [url='index.php']> Go Back <[/url]"; $h->endpage(); exit; } else if($_GET['ID'] == $userid) { print "<center>Only the crazy attack themselves. [url='index.php']> Go Back <[/url]"; $h->endpage(); exit; } else if ($ir['hp'] <= 1) { print "<center>Only the crazy attack when their unconscious. [url='index.php']> Go Back <[/url]"; $h->endpage(); exit; } else if ($_SESSION['attacklost'] == 1) { print "<center>Only the losers of all their EXP attack when they've already lost. [url='index.php']> Go Back <[/url]"; $_SESSION['attacklost']=0; $h->endpage(); exit; } //get player data $youdata=$ir; $sql = sprintf("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=%s", $_GET['ID']); $q=$db->query($sql); $odata=$db->fetch_row($q); $myabbr=($ir['gender']=="Male") ? "his" : "her"; $oabbr=($ir['gender']=="Male") ? "his" : "her"; if($ir['attacking'] && $ir['attacking'] != $_GET['ID']) { print "<center>Your already in a fight, but some reason cant get back to it... Please wait 1 hour (game time) then you can attack players again. [url='index.php']> Go Back <[/url]"; $_SESSION['attacklost']=0; $h->endpage(); exit; } if($odata['hp'] == 1) { print "<center>This player is unconscious. [url='index.php']> Go Back <[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } if($_GET['nextstep'] > 50) { print"<center><h2><font color='red'>STALEMATE!</h2> [url='index.php']> Go Back <[/url]</center>"; $h->endpage(); $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); event_add($odata['userid'],"[url='viewuser.php?u=$userid']{$youdata['username']}[/url] Tried to beat you but stalemated.",$c); event_add($youdata['userid']," You Tried to beat [url='viewuser.php?u=$userid']{$odata['username']}[/url] but stalemated.",$c); exit; } else if($odata['hospital']) { print "<center>This player is in hospital. [url='index.php']> Go Back <[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if($ir['hospital']) { print "<center>While in hospital you can't attack. [url='index.php']> Go Back <[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if($odata['jail']) { print "<center>This player is in jail. [url='index.php']> Go Back <[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if($ir['jail']) { print "<center>While in jail you can't attack. [url='index.php']> Go Back <[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if($odata['travelling']) { print "<center>That player is travelling. [url='index.php']> Go Back <[/url]"; $h->endpage(); $_SESSION['attacking']=0; $ir['attacking']=0; $db->query("UPDATE users SET attacking=0 WHERE userid=$userid"); exit; } else if ($youdata['location'] != $odata['location']) { print "<center>You can only attack someone in the same location! [url='index.php']> Go Back <[/url]"; $h->endpage(); exit; } else if ($youdata['energy'] < $youdata['maxenergy']/2) { print "<center>You can only attack someone when you have 50% energy. [url='index.php']> Go Back <[/url]"; $h->endpage(); exit; } else if ($odata['hp'] < 99) { print "<center>You can only attack those who have at least 100 health or more. [url='index.php']> Go Back <[/url]"; $h->endpage(); exit; } else if ($ir['gang'] == $odata['gang'] && $ir['gang'] > 0) { print "<center>You are in the same gang as {$odata['username']}! Why would you attack someone in your gang?! [url='index.php']> Go Back <[/url]"; $h->endpage(); exit; } else if ($ir['equip_primary'] == 0) { print "<center>You need a Primary Weapon to attack... [url='index.php']> Go Back <[/url]"; $h->endpage(); exit; } else if ($ir['equip_armor'] == 0) { print "<center>You need some Armour for protection... Go buy some before attacking someone... [url='index.php']> Go Back <[/url]"; $h->endpage(); exit; } to match the text abit where it says: Please wait 1 hour (game time) then you can attack players again. put this in your Cron_Hour file...   $db->query("UPDATE users SET attacking=0"); on top of ?>   if you have already done some modifications, you can just take some of the modifications out of it.
  23. is there any way to make it so say you get "act=search&search=2" it will select a different $_GET['search'] slot on the mod. so it doesnt give out the same item or whatever if you get that act function? if you know what i mean... lol.
  24. small problem with this mod when i add illusions map coords... all of the sqaures have the same /act=search&search=? on them... shouldnt it be like mixed all over? so players cant find out which search gives best rewards and then type the "act=search&search=NUMBER" part in the address bar and get the same reward over and over?
  25. lol thanks for the updates.
×
×
  • Create New...