Jump to content
MakeWebGames

Saberman

Members
  • Posts

    50
  • Joined

  • Last visited

    Never

Everything posted by Saberman

  1. Re: menu help here is my header its the normal mcodes header with afew edits <?php class headers { function startheaders() { global $ir, $set; echo <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>{$set['game_name']}</title> <style type="text/css"> <!-- body { background-color: #DEDEDE; margin-top: 0px; margin-bottom: 0px; font-family:calibri, helvetica, arial, geneva, sans-serif;font-size:12px;color: black; scrollbar-base-color: #005B70; scrollbar-arrow-color: #F3960B; scrollbar-DarkShadow-Color: #000000; } a:visited,a:active,a:hover,a:link { color: black;text-decoration: none; } table,tr,td { font-family:helvetica, arial, geneva, sans-serif;font-size: 12px; } img { border:none; } textarea { font-family:helvetica, arial, geneva, sans-serif;font-size:12px;color: black; } .table2 { } .lgrad { background-image:url(lgrad.jpg); background-repeat:repeat-y; width:19px; } .linegrad { background-image:url(linegrad.PNG); background-repeat:repeat-y; background-align: center; width:2px; } .rgrad { background-image:url(rgrad.jpg); background-repeat:repeat-y; width:19px; } .dgrad { background-image:url(dgrad.jpg); background-repeat:repeat-x; height:38px; } .dgradl { background-image:url(dgradl.jpg); background-repeat:no-repeat; height:38px; width:38px; } .dgradr { background-image:url(dgradr.jpg); background-repeat:no-repeat; height:38px; width:38px; } .center { width:932px; background-color:#cccccc; vertical-align:top; text-align:center; } .table { background-color:#000000; } .table3 { background-color:#000000; } .table td { background-color:#DEDEDE; height:22px; } .table3 td { background-color:#CCCCCC; } td .alt { background-color:#EEEEEE; height:22px; } td .h { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } .table th { background-image:url(tablehgrad.png); background-repeat:repeat-x; font-weight: bold; background-color: #D6D6D6; } --> </style></head> <body> <center> <table width="970" border="0" cellpadding="1" cellspacing="0" class="table2"> <tr> <td class="lgrad"></td> <td class="center"> EOF; } function userdata($ir, $dosessh=1) { global $db, $c, $userid, $set; $db->query(sprintf("UPDATE `users` SET `laston`=unix_timestamp(), `lastip`='%s' WHERE `userid`='%u'", getip(), intval($userid))); if (trim($ir['email']) == '') { header('Location: NoEmail.php'); session_unset(); session_destroy(); } $EnergyPerc = abs(@intval($ir['energy'] / $ir['maxenergy'] * '100')); $MoralePerc = abs(@intval($ir['will'] / $ir['maxwill'] * '100')); $BravePerc = abs(@intval($ir['brave'] / $ir['maxbrave'] * '100')); $HealthPerc = abs(@intval($ir['hp'] / $ir['maxhp'] * '100')); $ExpPerc = abs(@intval($ir['exp'] / $ir['exp_needed'] * '100')); $EnergyGone = '100' - $EnergyPerc; $MoraleGone = '100' - $MoralePerc; $BraveGone = '100' - $BravePerc; $HealthGone = '100' - $HealthPerc; $ExpGone = '100' - $ExpPerc; global $staffpage; $bgcolor = 'cccccc'; echo ' <a name="Top"><div id="container"></a> <div id="h-wrapper"> <div id="h-left"> <div class="leftmenutitle"></div> <div id="panel1">'; echo sprintf("[b]Name:[/b] [url='viewuser.php?u=%d']%s[/url] [%s] %s ", $ir['userid'], ($ir['donatordays']) ? '<span style="color: #0D961F;">'.stripslashes($ir['username']).'</span>' : stripslashes($ir['username']), number_format($ir['userid']), ($ir['donatordays']) ? '[img=donator.gif]' : ''); echo sprintf("[b]Money:[/b] %s ", number_format($ir['money'])); echo sprintf("[b]Level:[/b] %s ", number_format($ir['level'])); echo sprintf("[b]Crystals:[/b] %s ", number_format($ir['crystals'])); echo ' </div> </div> <div id="header"></div> <div id="h-right"> <div class="leftmenutitle"></div> <div id="panel">'; echo sprintf("[b]Energy:[/b] %s%% [url='crystaltemple.php?spend=refill'][R][/url] ", $EnergyPerc); echo sprintf("[img=Bars/BarGreen.gif][img=Bars/BarRed.gif] ", $EnergyPerc, $EnergyGone); echo sprintf("[b]Will:[/b] %s / %s ", $ir['will'], $ir['maxwill']); echo sprintf("[img=Bars/BarOrange.gif][img=Bars/BarRed.gif] ", $MoralePerc, $MoraleGone); echo sprintf("[b]Brave:[/b] %d/%d ", number_format($ir['brave']), number_format($ir['maxbrave'])); echo sprintf("[img=Bars/BarBrown.gif][img=Bars/BarRed.gif] ", $BravePerc, $BraveGone); if ($userid == '1') { echo sprintf("[b]EXP:[/b] %s%% ", $ExpPerc); echo sprintf("[img=Bars/BarBrown.gif][img=Bars/BarRed.gif] ", $ExpPerc, $ExpGone); } echo " "; if($ir['fedjail']) { $q=$db->query("SELECT * FROM fedjail WHERE fed_userid=$userid"); $r=$db->fetch_row($q); die("[b]<font color=red size=+1>You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s). Reason: {$r['fed_reason']}</font>[/b]</body></html>"); } if(file_exists('ipbans/'.$IP)) { die("[b]<font color=red size=+1>Your IP has been banned from {$set['game_name']}, there is no way around this.</font>[/b]</body></html>"); } } function menuarea() { include "mainmenu.php"; global $ir,$c; $bgcolor = 'cccccc'; print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"> </td><td width="80%" bgcolor="#'.$bgcolor.'" valign="top"> <center>'; if($ir['hospital']) { print "[b]NB:[/b] You are currently in hospital for {$ir['hospital']} minutes. "; } if($ir['jail']) { print "[b]NB:[/b] You are currently in jail for {$ir['jail']} minutes. "; } print "[url='donator.php'][b]Donate to {$set['game_name']} now for game benefits![/b][/url] "; } function smenuarea() { include "smenu.php"; global $ir,$c; $bgcolor = 'cccccc'; print '</td><td width="1" class="linegrad" bgcolor="#cccccc'.$bgcolor.'"> </td><td width="80%" bgcolor="#cccccc'.$bgcolor.'" valign="top"><center>'; } function endpage() { global $db; echo ' > [url="index.php"]Home[/url] </div> <div class="rightcontent3"></div> </div> </div> </div> </div> <div id="wrapper3"></div> </div> </div></body> </html>'; } } ?>
  2. can anyone tell me how i would make all the main menu link to appear like this Home Inventory Events (0) Mailbox (0) Explore Gym Crimes Your Job Local School Hospital (0) Jail (0) Forums Announcements (0) Newspaper Search instead of like this Home Inventory Events (0) Mailbox (0) Explore Gym Crimes Your Job Local School Hospital (0) Jail (0) Forums Announcements (0) Newspaper Search   this is my main menu <?php global $db,$c,$ir, $set; $hc=$set['hospital_count']; $jc=$set['jail_count']; $ec=$ir['new_events']; $mc=$ir['new_mail']; if($ir['hospital']) { print "[url='hospital.php']Hospital ($hc)[/url] [url='inventory.php']Inventory[/url] "; } elseif($ir['jail']) { print "[url='jail.php']Jail ($jc)[/url] "; } else { print "[url='index.php']Home[/url] [url='inventory.php']Inventory[/url] "; } if($ec > 0) { print "[url='events.php']Events ($ec)[/url] "; } else { print "[url='events.php']Events (0)[/url] "; } if($mc > 0) { print "[url='mailbox.php']Mailbox ($mc)[/url] "; } else { print "[url='mailbox.php']Mailbox (0)[/url] "; } if($ir['jail'] and !$ir['hospital']) { print "[url='gym.php']Jail Gym[/url] [url='hospital.php']Hospital ($hc)[/url] "; } else if (!$ir['hospital']) { print "[url='explore.php']Explore[/url] [url='gym.php']Gym[/url] [url='criminal.php']Crimes[/url] [url='job.php']Your Job[/url] [url='education.php']Local School[/url] [url='hospital.php']Hospital ($hc)[/url] [url='jail.php']Jail ($jc)[/url] "; } else { print "[url='jail.php']Jail ($jc)[/url] "; } print "[url='forums.php']Forums[/url] "; if($ir['new_announcements']) { print "[url='ann.php']Announcements ({$ir['new_announcements']})[/url] "; } else { print "[url='ann.php']Announcements (0)[/url] "; } print " [url='newspaper.php']Newspaper[/url] [url='search.php']Search[/url] "; if(!$ir['jail'] && $ir['gang']) { print "[url='yourgang.php']Your Gang[/url] "; } if($ir['user_level'] > 1) { print "<hr /> [url='staff.php']Staff Panel[/url] \n"; print "<hr />[b]Staff Online:[/b] "; $q=$db->query("SELECT * FROM users WHERE laston>(unix_timestamp()-15*60) AND user_level>1 ORDER BY userid ASC"); while($r=$db->fetch_row($q)) { $la=time()-$r['laston']; $unit="secs"; if($la >= 60) { $la=(int) ($la/60); $unit="mins"; } if($la >= 60) { $la=(int) ($la/60); $unit="hours"; if($la >= 24) { $la=(int) ($la/24); $unit="days"; } } print "[url='viewuser.php?u={$r[']{$r['username']}[/url] ($la $unit) "; } } if($ir['donatordays']) { print "<hr /> [b]Donators Only[/b] [url='friendslist.php']Friends List[/url] [url='blacklist.php']Black List[/url]"; } print "<hr /> [url='preferences.php']Preferences[/url] [url='preport.php']Player Report[/url] [url='helptutorial.php']Help Tutorial[/url] [url='gamerules.php']Game Rules[/url] [url='viewuser.php?u={$ir[']My Profile[/url] [url='logout.php']Logout[/url] Time is now "; echo date ('F j, Y')." ".date('g:i:s a'); ?>
  3. can anyone help me here plaease i am making a modification for travel for my game and also i made it so you will need a laptop to mail someone but i get this error when i select the inventry item QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Query was SELECT inv_itemid FROM inventory where inv_itemid=27 AND inv_userid=   $hdd=$db->query("SELECT inv_itemid FROM inventory where inv_itemid=27 AND inv_userid=$userid"); $jkk=$db->fetch_row($hdd);
  4. Re: gang-staff-function work perfect thank you so much richard +3 mate and it gave me a head ache from all the thinking i was doing to fix it and now i know how it works thank to you
  5. can anyone please help me with this function i tryed playing around with it but its no use i cant get it to stop user having same names and also users can get invisible name by using space bar   function gang_staff_name() { global $db, $ir, $userid, $gangdata, $h, $leaders; if(in_array($userid, $leaders)) { if(isset($_POST['subm'])) { $_POST['subm'] = trim($_POST['subm']); $check=$db->query(sprintf("SELECT `gangNAME` FROM `gangs` WHERE `gangNAME` = '%s'", clean($_POST['subm']))); $checking=$db->query($check) if($db->num_rows == 1)) { print "ERROR. [url='yourgang.php?action=staff']> Back[/url]"; $h->endpage(); exit; } $sql = sprintf("UPDATE gangs SET gangNAME = '%s' WHERE (gangID = %u)", clean($_POST['vp']), $gangdata['gangID']); $db->query($sql); echo "Gang name changed! [url='yourgang.php?action=staff']> Back[/url]"; } else { echo "Current Name: "; echo sprintf("%s ", format($gangdata['gangNAME'])); echo " <form action='yourgang.php?action=staff&act2=name' method='post'>"; echo "<input type='hidden' name='subm' value='submit' />"; echo "<table class='table' width='75%'>"; echo "<tr>"; echo "<th>New name</th>"; echo sprintf("<td style='text-align:center;'><input type='text' name='vp' value='%s' size='40%%' /></td>", format($gangdata['gangNAME'])); echo "</tr>"; echo "<tr>"; echo "<td colspan='2' style='text-align:center;'><input type='submit' value='Change' /></td>"; echo "</tr>"; echo "</table>"; echo "</form>"; } } }
  6. Re: Murdercountry what so great about it it just like the other 10000 mccodes games and this one is not much different from the original mccodes script
  7. Re: [mccode v2] House Rentals the move function has a few bugs when a user rents a house then moves in and out again the house becomes theirs ,can anyone fix this and other then that the mod works alright   function move_house() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $q=$db->query("SELECT pr.*,h.* FROM properties pr LEFT JOIN houses h ON pr.prHOUSE=h.hID WHERE pr.prID={$_GET['ID']} AND pr.prOWNER=$userid LIMIT 1",$c); $r=$db->fetch_row($q); if ($r['prOWNER'] != $ir['userid']) { print " This house does not belong to you. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $mpq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}",$c); $mp=$db->fetch_row($mpq); print " You moved into your {$r['hNAME']}! <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; $db->query("INSERT INTO `properties` (`prID`, `prOWNER`, `prHOUSE`) VALUES ('', '$userid', '{$mp['hID']}');",$c); $db->query("UPDATE users SET maxwill={$r['hWILL']},will=0 WHERE userid=$userid",$c); $db->query("DELETE FROM properties WHERE prID={$_GET['ID']}",$c); } } $h->endpage(); ?>
  8. i am using the rental mod by richard and i have a little bug if anyone could fix it i would be greatful. the bug here is that if a user rents a house he has his name where the original owners name supposed to be and once he rented the house he becomes the owner and if the user trys to return the house to the owner it send the house back to him with an event and the original owner gets striped of the house rentals.php <?php include "globals.php"; print "<center><font size='4' face='Arial, Helvetica, sans-serif'>Rental Market</font> "; switch($_GET['action']) { case "buy": buy_house(); break; case "remove": remove_house(); break; default: market_index(); break; } function market_index() { global $db,$ir,$c,$userid; print "<table width=90% cellspacing=1 class='table'> <tr> <th>Owner</th> <th>House</th> <th>Days</th> <th>Daily Price</th> <th>Links</th> </tr>"; $q=$db->query("SELECT rent.*, h.*, u.* FROM rentalmarket rent LEFT JOIN houses h ON rentHOUSE=h.hID LEFT JOIN users u ON u.userid=rent.rentOWNER ORDER BY rent.rentCOST, rent.rentDAYS ASC",$c); $lt=""; while($r=$db->fetch_row($q)) { if($r['rentOWNER'] == $userid) { $link = "[[url='rentals.php?action=remove&ID={$r[']Remove[/url]]"; } else { $link = "[[url='rentals.php?action=buy&ID={$r[']Rent[/url]]"; } $cost=money_formatter($r['rentCOST']); print "<tr> <td>[url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td> <td>{$r['hNAME']}</td> <td>{$r['rentDAYS']}</td> <td>$cost</td> <td>$link</td> </tr>"; } print "</table>"; } function remove_house() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT rent.*, h.*, u.* FROM rentalmarket rent LEFT JOIN houses h ON rentHOUSE=h.hID LEFT JOIN users u ON u.userid=rent.rentOWNER ORDER BY rent.rentCOST, rent.rentDAYS ASC",$c); if(!$db->num_rows($q)) { print "Error, either this house does not exist, or you are not the owner. [url='rentals.php']> Back[/url]"; $h->endpage(); exit; } $r=$db->fetch_row($q); $db->query("INSERT INTO `properties` (`prID`, `prOWNER`, `prHOUSE`) VALUES ('NULL', '$userid', '{$r['hID']}');",$c); $db->query("DELETE FROM rentalmarket WHERE rentID={$_GET['ID']}",$c); print "House removed from market! [url='rentals.php']> Back[/url]"; } function buy_house() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT rent.*, h.*, u.* FROM rentalmarket rent LEFT JOIN houses h ON rentHOUSE=h.hID LEFT JOIN users u ON u.userid=rent.rentOWNER ORDER BY rent.rentCOST, rent.rentDAYS ASC",$c); if(!$db->num_rows($q)) { print "This house is already occupied. [url='rentals.php']> Back[/url]"; $h->endpage(); exit; } $r=$db->fetch_row($q); if($r['reCOST'] > $ir['money']) { print "Error, you do not have the funds to start renting this house. [url='rentals.php']> Back[/url]"; $h->endpage(); exit; } event_add($r['rentOWNER'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] is now renting your {$r['hNAME']} for {$r['rentCOST']} per day.",$c); $db->query("INSERT INTO `properties` (`prID`, `prOWNER`, `prHOUSE`) VALUES ('{$r['rentPROP']}', '$userid', '{$r['hID']}');",$c); $db->query("INSERT INTO `rentals` (`reID`, `reOWNER`, `rePID`, `reRENTER`, `reDAYS`, `reCOST`) VALUES ('NULL', '$userid', '{$r['rentPROP']}', '$userid', '{$r['rentDAYS']}', '{$r['rentCOST']}');",$c); $db->query("DELETE FROM rentalmarket WHERE rentID={$_GET['ID']}",$c); $db->query("UPDATE users SET rent={$r['rentCOST']} WHERE userid=$userid",$c); print "You are now renting the {$r['hNAME']} for \$".number_format($r['rentCOST'])." per day."; } $h->endpage(); ?>   properties.php <?php include "globals.php"; print "<center><font size='4' face='Arial, Helvetica, sans-serif'>Your Properties</font><hr width=75%>"; switch($_GET['action']) { case 'sell': sell_house(); break; case 'market': market_house(); break; case 'rent': rent_house(); break; case 'give': send_house(); break; case 'move': move_house(); break; case 'return': return_house(); break; default: your_houses(); break; } function your_houses() { global $db,$ir,$c,$userid,$h; $q=$db->query("SELECT pr.*,h.* FROM properties pr LEFT JOIN houses h ON pr.prHOUSE=h.hID WHERE pr.prOWNER={$userid} ORDER BY h.hPRICE ASC",$c); if ($db->num_rows($q) == 0) { print "You have no houses."; } else { print "<table width=60% cellspacing=1>"; while($r=$db->fetch_row($q)) { print "<tr>"; $dfi=$db->query("SELECT * FROM users WHERE userid={$r['prOWNER']}",$c); $tb=$db->fetch_row($dfi); print "<td valign='left'> {$r['hsepics']}"; print "<td valign='center'> [b]Property: [/b]{$r['hNAME']} [b]Owner: [/b][url='viewuser.php?u={$tb[']{$tb['username']}[/url] [b]Upkeep: [/b]\${$r['hTAX']} [b]Will: [/b]{$r['hWILL']}</td> <td align='center'> [[url='properties.php?action=move&ID={$r[']Move In[/url]] "; $yd=$db->query("SELECT * FROM rentals WHERE reRENTER=$userid AND rePID={$r['prID']}",$c); $zf=$db->fetch_row($yd); $tr=$db->num_rows($yd); if ($r['hWILL'] != '100' && $tr == '0') { print " [[url='properties.php?action=sell&ID={$r[']Sell[/url]] [[url='properties.php?action=market&ID={$r[']Market[/url]] [[url='properties.php?action=rent&ID={$r[']Rent[/url]] [[url='properties.php?action=give&ID={$r[']Give[/url]] "; } $yd=$db->query("SELECT * FROM rentals WHERE reRENTER=$userid AND rePID={$r['prID']}",$c); $zf=$db->fetch_row($yd); $tr=$db->num_rows($yd); if ($tr) { print "[[url='properties.php?action=return&ID={$r[']Return[/url]] "; } $hprice=money_formatter($r['hPRICE']); print "</tr><tr><td height='10'></td></tr>"; } print "</table> "; } } function sell_house() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $yd=$db->query("SELECT * FROM rentals WHERE reRENTER=$userid AND rePID={$_GET['ID']}",$c); $zf=$db->fetch_row($yd); $tr=$db->num_rows($yd); if ($tr) { die (" This house has been rented! <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%> "); } $q=$db->query("SELECT pr.*,h.* FROM properties pr LEFT JOIN houses h ON pr.prHOUSE=h.hID WHERE pr.prID={$_GET['ID']} AND pr.prOWNER=$userid LIMIT 1",$c); $r=$db->fetch_row($q); if ($r['prOWNER'] != $ir['userid']) { print " This house does not belong to you. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $db->query("UPDATE users SET money=money+{$r['hPRICE']} WHERE userid=$userid",$c); print " You sold your {$r['hNAME']} for \${$r['hPRICE']}! <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; $db->query("DELETE FROM properties WHERE prID={$_GET['ID']}",$c); } } function send_house() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $yd=$db->query("SELECT * FROM rentals WHERE reRENTER=$userid AND rePID={$_GET['ID']}",$c); $zf=$db->fetch_row($yd); $tr=$db->num_rows($yd); if ($tr) { die (" This house has been rented! <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%> "); } if($_POST['user']) { $q=$db->query("SELECT pr.*,h.* FROM properties pr LEFT JOIN houses h ON pr.prHOUSE=h.hID WHERE pr.prID={$_GET['ID']} AND pr.prOWNER=$userid LIMIT 1",$c); if($db->num_rows($q)==0) { print " Invalid house ID <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $r=$db->fetch_row($q); $m=$db->query("SELECT * FROM users WHERE userid={$_POST['user']} LIMIT 1",$c); if($db->num_rows($m) == 0) { print " You are trying to send to an invalid user! <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else if (!$_GET['ID']) { print " This user does not exist. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $rm=$db->fetch_row($m); $db->query("UPDATE properties SET prOWNER={$_POST['user']} WHERE prID={$_GET['ID']}",$c); } print " You sent the {$r['hNAME']} to {$rm['username']}. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; event_add($_POST['user'],"You received the {$r['hNAME']} from [url='viewuser.php?u=$userid']{$ir['username']}[/url]",$c,'transfer'); } } else if($_GET['ID']) { $id=$db->query("SELECT pr.*,h.* FROM properties pr LEFT JOIN houses h ON pr.prHOUSE=h.hID WHERE pr.prID={$_GET['ID']} AND pr.prOWNER=$userid LIMIT 1",$c); if($db->num_rows($id)==0) { print " Invalid house ID. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else if ($_GET['ID']==0) { print " This user does not exist. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $r=$db->fetch_row($id); print " [b]Enter the ID of the user you want to give the {$r['hNAME']} to.[/b] <form action='properties.php?action=give&ID={$_GET['ID']}' method='post'> <input type='hidden' name='ID' value='{$_GET['ID']}' />User ID: <input type='text' name='user' value='' /> <input type='submit' value='Give House' /></form> <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } } else { print " Invalid use of file. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } } function market_house() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $yd=$db->query("SELECT * FROM rentals WHERE reRENTER=$userid AND rePID={$_GET['ID']}",$c); $zf=$db->fetch_row($yd); $tr=$db->num_rows($yd); if ($tr) { die (" This house has been rented! <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%> "); } $_POST['price'] = abs((int) $_POST['price']); if($_POST['price']) { $q=$db->query("SELECT pr.*,h.* FROM properties pr LEFT JOIN houses h ON pr.prHOUSE=h.hID WHERE prID={$_GET['ID']} and prOWNER=$userid",$c); if($db->num_rows($q)==0) { print " Invalid House ID <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $r=$db->fetch_row($q); $db->query("INSERT INTO propertymarket VALUES ('','$userid',{$_POST['price']},'{$r['hID']}')", $c); $db->query("DELETE FROM properties WHERE prID={$_GET['ID']}",$c); print " House added to market. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } } else { $q=$db->query("SELECT * FROM properties WHERE prID={$_GET['ID']} and prOWNER=$userid",$c); if($db->num_rows($q)==0) { print " Invalid House ID <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $r=$db->fetch_row($q); print " Adding a house to the property market... <form action='properties.php?action=market&ID={$_GET['ID']}' method='post'> <input type='hidden' name='ID' value='{$_GET['ID']}' /> Price: <input type='text' name='price' value='0' /> <input type='submit' value='Add' /></form> <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } } } function return_house() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $q=$db->query("SELECT pr.*,h.* FROM properties pr LEFT JOIN houses h ON pr.prHOUSE=h.hID WHERE pr.prID={$_GET['ID']} AND pr.prOWNER=$userid LIMIT 1",$c); $r=$db->fetch_row($q); if ($r['prOWNER'] != $ir['userid']) { print " This house does not belong to you. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $yd=$db->query("SELECT * FROM rentals WHERE reRENTER=$userid AND rePID={$_GET['ID']}",$c); $zf=$db->fetch_row($yd); event_add($zf['reOWNER'],"You received the {$r['hNAME']} back from [url='viewuser.php?u=$userid']{$ir['username']}[/url]",$c,'transfer'); print " You returned the {$r['hNAME']}! <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; $db->query("DELETE FROM properties WHERE prID={$_GET['ID']}",$c); $db->query("INSERT INTO `properties` (`prID`, `prOWNER`, `prHOUSE`) VALUES ('{$zf['rePID']}', '{$zf['reOWNER']}', '{$r['hID']}');",$c); $db->query("DELETE FROM rentals WHERE rePID={$_GET['ID']}",$c); } } function rent_house() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $yd=$db->query("SELECT * FROM rentals WHERE reRENTER=$userid AND rePID={$_GET['ID']}",$c); $zf=$db->fetch_row($yd); $tr=$db->num_rows($yd); if ($tr) { die (" This house has been rented! <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%> "); } $_POST['price'] = abs((int) $_POST['price']); $_POST['days'] = abs((int) $_POST['days']); if($_POST['price'] || $_POST['days']) { $q=$db->query("SELECT pr.*,h.* FROM properties pr LEFT JOIN houses h ON pr.prHOUSE=h.hID WHERE prID={$_GET['ID']} and prOWNER=$userid",$c); if($db->num_rows($q)==0) { print " Invalid House ID <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $r=$db->fetch_row($q); $db->query("INSERT INTO rentalmarket VALUES ('','{$_GET['ID']}',{$_POST['price']},'{$_POST['days']}','$userid','{$r['hID']}')", $c); $db->query("DELETE FROM properties WHERE prID={$_GET['ID']}",$c); print " House added to market. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } } else { $q=$db->query("SELECT * FROM properties WHERE prID={$_GET['ID']} and prOWNER=$userid",$c); if($db->num_rows($q)==0) { print " Invalid House ID <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $r=$db->fetch_row($q); print " Adding a house to the rental market... <form action='properties.php?action=rent&ID={$_GET['ID']}' method='post'> <input type='hidden' name='ID' value='{$_GET['ID']}' /> Price (Daily): <input type='text' name='price' value='0' /> Days: <input type='text' name='days' value='0' /> <input type='submit' value='Add' /></form> <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } } } function move_house() { global $db,$ir,$c,$userid,$h; $_GET['ID'] = abs((int) $_GET['ID']); $q=$db->query("SELECT pr.*,h.* FROM properties pr LEFT JOIN houses h ON pr.prHOUSE=h.hID WHERE pr.prID={$_GET['ID']} AND pr.prOWNER=$userid LIMIT 1",$c); $r=$db->fetch_row($q); if ($r['prOWNER'] != $ir['userid']) { print " This house does not belong to you. <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; } else { $mpq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}",$c); $mp=$db->fetch_row($mpq); print " You moved into your {$r['hNAME']}! <hr width=75%>> [url='properties.php']Back[/url]<hr width=75%>"; $db->query("INSERT INTO `properties` (`prID`, `prOWNER`, `prHOUSE`) VALUES ('', '$userid', '{$mp['hID']}');",$c); $db->query("UPDATE users SET maxwill={$r['hWILL']},will=0 WHERE userid=$userid",$c); $db->query("DELETE FROM properties WHERE prID={$_GET['ID']}",$c); } } $h->endpage(); ?>
  9. Saberman

    Cron

    Re: Cron Parse error: syntax error, unexpected $end in /home/shafiq/public_html/ImPoRtAnT/cron_day.php on line 103
  10. Saberman

    Cron

    Does anyone know what is the problem with this cron this is the error i get when i run it. QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Query was SELECT * FROM rentals WHERE reRENTER=   <?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $db->query("UPDATE fedjail set fed_days=fed_days-1"); $q=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r=$db->fetch_row($q)) { $ids[]=$r['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid LEFT JOIN jobs j ON j.jID=u.job LEFT JOIN jobranks jr ON u.jobrank=jr.jrID SET u.money=u.money+jr.jrPAY, u.jobpoints=u.jobpoints+jr.jrPOINTS, u.exp=u.exp+(jr.jrPAY/20) WHERE u.job > 0 AND u.jobrank > 0"); $db->query("UPDATE userstats us LEFT JOIN users u ON u.userid=us.userid LEFT JOIN jobs j ON j.jID=u.job LEFT JOIN jobranks jr ON u.jobrank=jr.jrID SET us.strength=(us.strength+1)+jr.jrSTRG-1,us.labour=(us.labour+1)+jr.jrLABOURG-1,us.IQ=(us.IQ+1)+jr.jrIQG-1 WHERE u.job > 0 AND u.jobrank > 0"); $db->query("DELETE FROM fedjail WHERE fed_days=0"); $db->query("UPDATE users SET userCONTRACT = userCONTRACT - 1 WHERE userCONTRACT > 0"); $db->query("UPDATE users SET userBANKAMMT = userBANKAMMT + (userBANKAMMT/100*5.5) WHERE userBANKAMMT > 0 AND investlevel = 1"); $db->query("UPDATE users SET userBANKAMMT = userBANKAMMT + (userBANKAMMT/100*3.0) WHERE userBANKAMMT > 0 AND investlevel = 0"); $db->query("UPDATE users SET userBANKAMMT = userBANKAMMT + (userBANKAMMT/100*7.2) WHERE userBANKAMMT > 0 AND investlevel = 2"); $db->query("UPDATE users SET userDAYS=userDAYS-1 WHERE userDAYS>0"); $db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); $db->query("UPDATE users SET daysold=daysold+1, tired='0', boxes_opened=0"); $db->query("UPDATE users SET mailban=mailban-1 WHERE mailban > 0"); $db->query("UPDATE users SET donatordays=donatordays-1 WHERE donatordays > 0"); $db->query("UPDATE users SET cdays=cdays-1 WHERE course > 0"); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/200) where bankmoney>0"); $db->query("UPDATE users SET cybermoney=cybermoney+(cybermoney/100*7) where cybermoney>0"); $q=$db->query("SELECT * FROM users WHERE cdays=0 AND course > 0"); while($r=$db->fetch_row($q)) { $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r['userid']; $db->query("INSERT INTO coursesdone VALUES({$r['userid']},{$r['course']})"); $upd=""; $ev=""; if($coud['crSTR'] > 0) { $upd.=",us.strength=us.strength+{$coud['crSTR']}"; $ev.=", {$coud['crSTR']} strength"; } if($coud['crGUARD'] > 0) { $upd.=",us.guard=us.guard+{$coud['crGUARD']}"; $ev.=", {$coud['crGUARD']} guard"; } if($coud['crLABOUR'] > 0) { $upd.=",us.labour=us.labour+{$coud['crLABOUR']}"; $ev.=", {$coud['crLABOUR']} labour"; } if($coud['crAGIL'] > 0) { $upd.=",us.agility=us.agility+{$coud['crAGIL']}"; $ev.=", {$coud['crAGIL']} agility"; } if($coud['crIQ'] > 0) { $upd.=",us.IQ=us.IQ+{$coud['crIQ']}"; $ev.=", {$coud['crIQ']} IQ"; } $ev=substr($ev,1); if ($upd) { $db->query("UPDATE users u LEFT JOIN userstats us ON u.userid=us.userid SET us.userid=us.userid $upd WHERE u.userid=$userid"); } $db->query("INSERT INTO events VALUES('',$userid,unix_timestamp(),0,'Congratulations, you completed the {$coud['crNAME']} and gained $ev!')"); } $db->query("UPDATE users SET course=0 WHERE cdays=0"); $db->query("UPDATE rentals set reDAYS=reDAYS-1"); $io=$db->query("SELECT * FROM users where rent>0"); $hu=$db->fetch_row($io); $gd=$db->query("SELECT * FROM rentals WHERE reRENTER={$hu['userid']}"); $hd=$db->fetch_row($gd); $db->query("UPDATE users set money=money-{$hd['reCOST']} WHERE userid={$hd['reRENTER']}"); $q=$db->query("SELECT * FROM rentals WHERE reDAYS=0"); $ids=array(); while($r=$db->fetch_row($q)) { if (!$r['reDAYS']) { $rf=$db->query("SELECT * FROM properties WHERE prID={$r['rePID']}"); $gf=$db->fetch_row($rf); $db->query("DELETE FROM properties WHERE prID={$r['rePID']}"); $db->query("UPDATE users SET rent=0 WHERE userid={$r['reRENTER']}"); $db->query("INSERT INTO `properties` (`prID`, `prOWNER`, `prHOUSE`) VALUES ('{$r['rePID']}', '{$r['reOWNER']}', '{$gf['prHOUSE']}');",$c); $db->query("DELETE FROM rentals WHERE reDAYS=0"); } } ?>
  11. can any one help here i am learing php and stuck here how would i put his bit of code so it shows the itemname needed for the crime   if($n['inv_itemid'] != $r['crimeITEM']) { echo "You do not have the required {$ir['$name']} needed to perform this crime."; }   This is where the mod is if you need more infomation http://criminalexistence.com/ceforums/i ... ic=27321.0 and also can anyone tell me what isset is used for in php? Thanks in advance
  12. Re: refresh problem   i didnt ask you to be my baby sitter and i asked for help and if you didnt want to then why reply
  13. Re: refresh problem   i have been searching the forums for about 30mins lol and every script had the same problem.
  14. can someone help me fix a bug please when a user looses a fight and if they refresh on the screen that show them how many xp they lost they keep on loosing xp every time they refresh <?php $atkpage=1; include "globals.php"; $_GET['ID']==abs((int) $_GET['ID']); $_SESSION['attacking']=0; $_SESSION['attacklost']=0; $od=$db->query("SELECT * FROM users WHERE userid={$_GET['ID']}"); if($db->num_rows($od)) { $r=$db->fetch_row($od); print "You lost to {$r['username']}"; $expgain=abs(($ir['level']-$r['level'])^3); $expgainp=$expgain/$ir['exp_needed']*100; print " and lost $expgainp% EXP!"; $db->query("UPDATE users SET exp=exp-$expgain, attacking=0 WHERE userid=$userid"); $db->query("UPDATE users SET exp=0 WHERE exp<0"); event_add($r['userid'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] attacked you and lost.",$c); $atklog=mysql_escape_string($_SESSION['attacklog']); $db->query("INSERT INTO attacklogs VALUES('',$userid,{$_GET['ID']},'lost',unix_timestamp(),0,'$atklog');"); $warq=$db->query("SELECT * FROM gangwars WHERE (warDECLARER={$ir['gang']} AND warDECLARED={$r['gang']}) OR (warDECLARED={$ir['gang']} AND warDECLARER={$r['gang']})"); if ($db->num_rows($warq) > 0) { $war=$db->fetch_row($warq); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT+1 WHERE gangID={$r['gang']}"); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT-1 WHERE gangID={$ir['gang']}"); print " You lost 1 respect for your gang!"; } } else { print "You lost to Mr. Non-existant! =O"; } $h->endpage(); ?>
  15. Saberman

    need help

    Re: need help   could be that your game got injected .
  16. Re: Sell Your Gang VR1   Basically, you didn't make this, so you have no authority whatsoever to post it unless the original creator of this gives you permission to. well unless the original owner owns up and says you dont have my permission to post it then it should be removed and you never know he said he cant remember so he could of made it.
  17. Re: Sell Your Gang VR1 nice mod mate
×
×
  • Create New...