
gurpreet
Members-
Posts
834 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by gurpreet
-
Re: V2 Education days go negative <?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"); $q2=$db->query("SELECT * FROM fedjail WHERE fed_days=0"); $ids=array(); while($r2=$db->fetch_row($q2)) { $ids[]=$r2['fed_userid']; } if(count($ids) > 0) { $db->query("UPDATE users SET fedjail=0 WHERE userid IN(".implode(",", $ids).")"); } $db->query("DELETE FROM fedjail WHERE fed_days=0"); $db->query("UPDATE users SET daysingang=daysingang+1 WHERE gang > 0"); $db->query("UPDATE users SET splatturns=3"); $db->query("UPDATE users SET strategoturns=0"); $db->query("UPDATE users SET tokens=0"); $db->query("UPDATE users SET brothel=0",$c); $db->query("UPDATE users SET turns=25"); $db->query("UPDATE users SET tired=0"); $db->query("UPDATE users SET dare=5"); $db->query("UPDATE users SET popularity=2"); $db->query("UPDATE users SET clubvisits=0"); $db->query("UPDATE users SET happiness=happiness-1 WHERE married != 0"); $db->query("UPDATE users SET daysold=daysold+1, 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 AND cdays > 0"); $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney/50) 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($r2=$db->fetch_row($q2)) { $cd=$db->query("SELECT * FROM courses WHERE crID={$r['course']}"); $coud=$db->fetch_row($cd); $userid=$r2['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("TRUNCATE TABLE votes"); $fo=fopen("jailshouts.txt","w"); fclose($fo); ?> Try that.
-
Re: Quantify Mod for V2! I done the item_add stuff, but people still have the un-quantified items from before i put in the item_add stuff...So they can't quantify that.
-
Re: [mccode v2] Attack :) Try this: <?php include "globals.php"; $menuhide=0; $atkpage=1; $user_class=$ir; $q=$db->query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$_GET['ID']}"); $attack_person=$db->fetch_row($q); $qo=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_primary']}"); $user_class1=$db->fetch_row($qo); $q1=$db->query("SELECT i.* FROM items i WHERE i.itmid={$user_class['equip_armor']}"); $user_class2=$db->fetch_row($q1); $weapon= "{$user_class1['itmname']}"; if(mysql_num_rows($qo) == 0) { $weapon="Fists"; } $eq=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$attack_person['equip_primary']})"); if(mysql_num_rows($eq) == 0) { $wep="Fists"; } else { $cnt=0; while($r=$db->fetch_row($eq)) { $enweps[]=$r; $cnt++; } $weptouse=rand(0,$cnt-1); $wep=$enweps[$weptouse]['itmname']; } $enperc=(int) ($ir['energy']/$ir['maxenergy']*100); $gq=$db->query("SELECT * FROM gangs WHERE gangID={$attack_person['gang']}"); $ga=$db->fetch_row($gq); $error = ($enperc < 25) ? "You need to have at least 25% of your energy if you want to attack someone." : $error; $error = ($user_class['jail'] > 0) ? "You can't attack someone if you are in jail." : $error; $error = ($user_class['hospital'] > 0) ? "You can't attack someone if you are in the hospital." : $error; $error = ($_GET['ID'] == "") ? "You didn't choose someone to attack." : $error; $error = ($_GET['ID'] == $userid) ? "You can't attack yourself." : $error; $error = ($attack_person['location'] != $user_class['location']) ? "You must be in the same city as the person you are attacking. Duh." : $error; $error = ($attack_person['username'] == "") ? "That person doesn't exist." : $error; $error = ($attack_person['hospital'] > 0) ? "You can't attack someone that is in the hospital." : $error; $error = ($attack_person['jail'] > 0) ? "You can't attack someone that is in jail." : $error; //$error = ($user_class['level'] > 5 && $attack_person['level'] < 6) ? "You can't attack someone that is level 5 or below because you are higher than level 5." : $error; ////////////// ^^ if you like to have it so noobs stay alive longer ?><div id="main " style="a"><center><?PHP if (isset($error)){ echo ($error); $h->endpage(); exit; } if ($user_class['energy'] >= $user_class['maxenergy']/4) { $user_class['energy']-= floor($user_class['maxenergy']/4); $me=floor($user_class['maxenergy']/4); $db->query("UPDATE users SET energy=energy- {$me} WHERE userid=$userid"); $_SESSION['attacklog']=""; $_SESSION['attackdmg']=0; } $yourhp = $user_class['hp']; $theirhp = $attack_person['hp']; $damagestat = number_format($user_class['strength']) ; $itstat = $user_class1['weapon']; $damplu = $damagestat * ($itstat*100); $ratio=($user_class['level']*100)/($attack_person['level']*100); print "<center>Pirate Battles <font color=yellow>The fight Ratio is ".$ratio."%</font> You are in a Battle with ".$attack_person['username']." </center>"; echo " You come in with your ".$weapon." With a Strenght of ".$damplu." (+".$itstat."%) "; $wait = ($user_class['agility'] > $attack_person['agility']) ? 1 : 0; $hospital = 600; $qo=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$attack_person['equip_primary']})"); $r1=$db->fetch_row($qo); $qo=$db->query("SELECT i.* FROM items i WHERE i.itmid IN({$attack_person['equip_primary']})"); $r2=$db->fetch_row($qo); $damage = (int) (($user_class1['weapon']*$user_class['strength']/($attack_person['guard']/1.5))); $theirdamage = (int) (($r1['weapon']*$attack_person['strength']/($user_class['guard']/1.5))); while($yourhp > 0 && $theirhp > 0){ $damage = ($damage < 1) ? 1 : $damage; $theirdamage = ($theirdamage < 1) ? 1 : $theirdamage; if($wait == 0){ $yourhp = $yourhp - $theirdamage; echo "<font color=red>".$attack_person['usename']."Takes their turn to swing at you!</font> "; echo $attack_person['username']. " hit you for " .number_format($theirdamage). " damage using their ".$wep.". "; } else { $wait = 0; } if($yourhp > 0) { $damage = (int) (($user_class1['weapon']*$user_class['strength']/($attack_person['guard']/1.5))); $damage = ($damage < 1) ? 1 : $damage; $theirhp = $theirhp - $damage; echo "<font color=green>You swing at them!</font> "; echo "You hit " .$attack_person['username']. " for " . number_format($damage) . " damage using your ".$weapon.". "; } if($theirhp <= 0){ // attacker won $winner = $user_class['ID']; $theirhp = 0; $moneywon = floor($attack_person['money'] /10); $expwon = 150 - (25 * ($user_class['level'] - $attack_person['level'])); $expwon = ($expwon < 0) ? 0 : $expwon; $hosptime=20; $hospreason = "Attacked by ".$user_class['username']."" ; $newexp = $expwon + $user_class['exp']; $newmoney = $user_class['money'] + $moneywon; $result = $db->query("UPDATE `users` SET `exp` = '".$newexp."', money = '".$newmoney."' WHERE `userid`='".$user_class['userid']."'"); $newmoney = $attack_person['money'] - $moneywon; $result = $db->query("UPDATE `users` SET `hp`= 1,`hospital` ='".$hosptime."', `money` = '".$newmoney."', `hospreason` = '".$hospreason."' WHERE `userid`='".$attack_person['userid']."'"); $atklog=mysql_escape_string($_SESSION['attacklog']); $db->query("INSERT INTO attacklogs VALUES('',".$user_class['userid'].",".$attack_person['userid'].",'won',unix_timestamp(),".$moneywon.",'$atklog');"); event_add($attack_person['userid'], "You were hospitalized by ".$user_class['username']." for 20 minutes."); $final ="<center>You hospitalized " .$attack_person['username']. ". You gain $expwon exp and stole $".$moneywon." from " .$attack_person['username']. ". </center>"; $pwnd =""; $warq=$db->query("SELECT * FROM gangwars WHERE (warDECLARER={$user_class['gang']} AND warDECLARED={$attack_person['gang']}) OR (warDECLARED={$user_class['gang']} AND warDECLARER={$attack_person['gang']})"); if ($db->num_rows($warq) > 0) { $war=$db->fetch_row($warq); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT-2 WHERE gangID={$attack_person['gang']}"); $ga['gangRESPECT']-=2; $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT+2 WHERE gangID={$user_class['gang']}"); $pwnd =" You earnt 2 respect for your gang!"; } if ($ga['gangRESPECT']<=0 && $attack_person['gang']) { $db->query("UPDATE users SET gang=0 WHERE gang={$attack_person['gang']}"); $db->query("DELETE FROM gangs WHERE gangRESPECT<='0'"); $db->query("DELETE FROM gangwars WHERE warDECLARER={$ga['gangID']} or warDECLARED={$ga['gangID']}"); } $bots=array(96,94,5,97,98,99,142,138,138,140,141,146,143,144,145);//Your Battle Tent Bots $moneys=array(96 =>5000,94 =>5000,5 => 500,97 => 5000, 98 => 500, 99 => 10000, 142 => 1500,138 =>10000,140 =>10000,141 =>10000,146 =>20000,143 =>15000,144 =>15000,145 =>15000); if(in_array($attack_person['userid'],$bots)) { $gain=$moneys[$attack_person['userid']]; $db->query("UPDATE users SET money=money+$gain WHERE userid=$userid",$c); $finalbot =""; $finalbot =" Congrats, for beating the Challenge Bot {$attack_person['username']}, you have earnt \$$gain!"; } } if($yourhp <= 0){ // defender won $winner = $attack_person['ID']; $yourhp = 0; $moneywon = floor($user_class['money'] /10); $expwon = 100 - (25 * ($attack_person['level'] - $user_class['level'])); $expwon = ($expwon < 0) ? 0 : $expwon; $hosplost = "Lost to ".$attack_person['username']."" ; $hosptime=20; $newexp = $expwon + $attack_person['exp']; $newmoney = $attack_person['money'] + $moneywon; $result = $db->query("UPDATE `users` SET `exp` = '".$newexp."', money = '".$newmoney."' WHERE `userid`='".$attack_person['userid']."'"); $newmoney = $user_class['money'] - $moneywon; $result = $db->query("UPDATE `users` SET `hp`= 1,`hospital` ='".$hosptime."' ,`money` = '".$newmoney."', `hospreason` = '".$hosplost."' WHERE `userid`='".$user_class['userid']."'"); $atklog=mysql_escape_string($_SESSION['attacklog']); $db->query("INSERT INTO attacklogs VALUES('',".$attack_person['userid'].",".$user_class['userid'].",'won',unix_timestamp(),".$moneywon.",'$atklog');"); $final = $attack_person2 . " beat you and stole $".$moneywon." from you."; $pwnd =""; $warq=$db->query("SELECT * FROM gangwars WHERE (warDECLARER={$user_class['gang']} AND warDECLARED={$attack_person['gang']}) OR (warDECLARED={$user_class['gang']} AND warDECLARER={$attack_person['gang']})"); if ($db->num_rows($warq) > 0) { $war=$db->fetch_row($warq); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT+1 WHERE gangID={$attack_person['gang']}"); $db->query("UPDATE gangs SET gangRESPECT=gangRESPECT-1 WHERE gangID={$user_class['gang']}"); $pwnd =" You lost 1 respect for your gang!"; } } } echo "$final"; echo "$pwnd "; echo "$finalbot"; $h->endpage(); ?></div></center>
-
Re: Quantify Mod for V2! I change urrdel to currdel, but i still get the parse error.
-
Re: Little Bit Of Cron Help Wouldn't you increase the WHERE 'brave' < 100 for higher levels? I think level 49 and above have more than 100 brave... $SQL = "UPDATE `users` SET `brave` = `brave` + 5 WHERE `brave` < 1000 AND `donatordays` < 1"; $SQL_2 = "UPDATE `users` SET `brave` = `brave` + 10 WHERE `brave` < 1000 AND `donatordays` > 0"; That should cover into the level 400's.
-
Re: Simple register edit Nope, I didn't state you were flaming me, I stated you flame people who aren't as good as you at coding. I've seen it before, and no, I won't post the links or w.e because we both know you do.
-
Re: Print once? Working perfectly, just need to make the img size bigger (vertically). +1 again.
-
Re: Print once? Update: print "<center><td style='background-image: url(background.gif); width: 185px;'><table style='width: 100%; border: 0px;' cellpadding='0' cellspacing='0'> <td></td> </tr> <tr> <td></td> </tr> <tr> <td style='background-image: url(background.gif); width: 185px;'><table style='width: 100%; border: 0px;' cellspacing='0' cellpadding='0'> <tr> <td style='width: 10px;'> </td> <td style='width: 0px; vertical-align: top;'><font face='Verdana' size='1'>"; There are 2 parts to the sidemenu, top and bottom. I stuck the no repeat in both, after (background.gif) and they don't show. Screeny of what it looks like now without the no repeat stuff:
-
Re: Jail Bust Just fixed a few query problems and fixed the chance to bust people. Also, I meant my jailbust.php as in the one I'm using.
-
Re: Simple register edit And I admit I'm a noob. Now just piss off if you got nothing better to do except flame people who aren't as good as you at coding.
-
Ok so I added a sidemenu.php and it keeps repeating on the side on long pages eg. Userlist. print "<center><td style='background-image: url(background.gif); width: 185px;'><table style='width: 100%; border: 0px;' cellpadding='0' cellspacing='0'> <td></td> That is part, and I will take a screenie when I get home. Is there a way to print once?
-
Re: A standalone Mug mod Hehe, you gotta ask to know ;)
-
Re: Simple register edit Simple, just look for the variable $sm in your register file. Find: $sm=(number here); Edit the number to whatever you want the users money to be.
-
Re: A standalone Mug mod you dont hack their accounts, it's like in real life if you steal someones credit card details, you get some money. I can't add this to my game as I have too many stuff like this, but it's pretty self-explanitory.
-
Re: PHPMYADMIN query So simple...I suck at SQL, thought it would use the MCcodes query format. +1 for this, thanks, and delete topic when a mod sees this. Thanks again
-
UPDATE users SET crystals=1 WHERE crystals <=6050 AND =>4000 basically, when I was starting my game and stuff and I gave mass payments of like 5000, 1000, 250, etc. and some people used a few crystals, then stopped playing (100+ days ago last movement). So I want to make it so if someone has inbetween 6050 crystals and 4000 (nobody has it who is active) then it will set their crystals to 1. I use the code above and it says:
-
Re: edit new user items...Money,crystals Staff_special.php Just look at the old DP's, copy and paste old ones, but edit it a bit so it's a different DP.
-
Re: [mccode] Password reset code I get an error, everything is in as you said. Fatal error: Cannot redeclare randomstring() (previously declared in /home/gurpreet/public_html/global_func.php:433) in /home/gurpreet/public_html/global_func.php on line 456 450-459 function randomString($length) { $string = md5(time()); $highest_startpoint = 32-$length; $randomString = substr($string,rand(0,$highest_startpoint),$length); return $randomString; } ?>
-
Re: Event add problem Well it's not my fault I made a mistake Mr. Perfect... :roll:
-
Re: edit new user items...Money,crystals http://criminalexistence.com/ceforums/index.php?topic=27660.0 Check out my post, if needed I'll update with the items and stuff.
-
Hi there, I was just going through my jailbust.php (which I found somewhere here, can't remember who made it) and I thought I'd make it a bit better with a few more stuff..Don't flame me as it's my first PROPER release. Create a file called jailbust.php, then add the following in it: <?php include "globals.php"; $_GET['ID'] = abs((int) $_GET['ID']); if(!$_GET['ID']) { echo "This user is not in jail."; } if (!isset($_GET['action'])){ $qq=$db->query("SELECT * FROM users WHERE userid={$_GET['ID']}",$c); $r=$db->fetch_row($qq); $bravecost=5; echo "Are you sure you want to bust {$r['username']} out of jail? It will cost $bravecost brave to bust them out of jail. >[url='jailbust.php?action=yes&ID={$_GET[']Yes[/url] [url='jail.php']No[/url]<"; } else { if ($_GET['action']=='yes') { $qq=$db->query("SELECT * FROM users WHERE userid={$_GET['ID']}",$c); $r=$db->fetch_row($qq); $bravecost=5; $jailbusted=rand(1,10); if ($ir['jail'] > 0) { echo "You can't bust {$r['username']} when your in jail yourself."; $h->endpage(); exit; } if ($r['jail'] ==0) { echo "{$r['username']} is already out of jail."; $h->endpage(); exit; } if ($ir['userid'] == $_GET['ID']) { echo "You bust yourself out of jail."; $h->endpage(); exit; } if ($ir['brave'] < $bravecost) { echo "You dont have enough brave to bust {$r['username']} out of jail"; $h->endpage(); exit; } if ($ir['hospital'] > 0) { echo "You can't bust {$r['username']} when your the hospital."; $h->endpage(); exit; } if ($ir['userid'] != $_GET['ID']) { $j1per=$db->query("SELECT conf_value FROM settings WHERE conf_id=20",$c); $jj1per=$db->fetch_row($j1per); if ($jailbusted <=6); { print "You Successfuly busted {$r['username']} out of jail"; $db->query("UPDATE users SET jail=0 WHERE userid={$_GET['ID']}",$c); $db->query("UPDATE users SET jail_reason='Not In Jail.' WHERE userid={$_GET['ID']}", $c); $db->query("UPDATE users SET brave=brave-$bravecost WHERE userid=$userid",$c); event_add($r['userid'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] Busted you out of jail.",$c); } } else { $jail=(int) rand(1,20); print "You were caught attempting to help {$r['username']} escape and thrown in jail for $jail minutes."; $db->query("UPDATE users SET brave=brave-$bravecost WHERE userid=$userid",$c); $db->query("UPDATE users SET jail=jail+$jail WHERE userid=$userid", $c); $db->query("UPDATE users SET jail_reason='Caught busting {$r['username']} out of jail' WHERE userid=$userid", $c); event_add($r['userid'],"[url='viewuser.php?u=$userid']{$ir['username']}[/url] was arrested while trying to bust you out of jail.",$c); } } } ?> next, open jail.php and find [[url='jailbail.php?ID={$r[']Bail[/url]] Before add: [[url='jailbust.php?ID={$r[']Bust[/url]]
-
Re: Event add problem Where did you add the query? I'm a noob at this, but I think you are missing a 'texthere', as in a field/column entry. As in say you have 10 columns in your DB and the query inserts 11..Something like that. OR Try this: event_add($ir['userid'], "<font color=red>You have recieved a warning for the reason {$_POST['reason']} if you continue your ways further action will be taken. Sniper Wars staff.", $c);
-
Re: Images when equipping an item. Paste lines 10-20 here, otherwise we can't really see how the error is happening.
-
Re: Mod Request Kinda..It's a winnig streak, but you don't have it in a row, you have it total attacks to do with gang wars. Say I attack 20 people I get 20 kills on the leaderboard. If I get attacked and then I attack back, I have 21. Being attacked has nothing to do with this, just to make it so you get a top fighters list to do with wars only.
-
Re: exp not working In the file which will have the query to insert into the DB..