Newbie
Members-
Posts
289 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
Events
Everything posted by Newbie
-
hey all i found this 5050 game on cronus old fourm and its not working properly the person who posted hasnt been on in ages anyways it was just saying "You are trying to bet more than you have" i managed to fix that because the poster had [points] instead of [crystals] now when you type in your bet it doesnt do anything just refreshes the screen can anyone else have a look see if iam missing anything <?php include 'globals.php'; global $h,$ir; //original mod by mark mascola August 11, 2011 if(isset($_POST['match']) && is_numeric($_POST['match'])){ $q=$db->query("SELECT * FROM fifty WHERE bet_id = {$_POST['match']}"); $r = $db->fetch_row($q); $win = floor($r['wager']*(1.8)); if($ir['second'] < $r['wager']){ echo"<br />You are trying to bet more than you have"; $h->endpage(); exit; }elseif($ir['userid'] == $r['bettor']){ echo"<br />You cannot match your own bets"; $h->endpage(); exit; }else{ $db->query("UPDATE users SET second = second - {$r['wager']} WHERE userid={$ir['userid']}"); $j=rand(1,2); if($j==1){//the winner is the original bettor $db->query("UPDATE users SET second = second + ".$win." WHERE userid = {$r['bettor']}"); event_add($r['bettor'], "You won your 50/50 bet of ".$r['wager']." points and earned ".floor($r['wager']*(1.8))." points!"); event_add($ir['userid'], "You lost your 50/50 bet of ".$r['wager']." points."); } if($j==2){//the winner is the matcher $db->query("UPDATE users SET second = second + ".$win." WHERE userid = {$ir['userid']}"); event_add($r['bettor'], "You lost your 50/50 bet of ".$r['wager']." points."); event_add($ir['userid'], "You won your 50/50 bet of ".$r['wager']." points and earned ".floor($r['wager']*(1.8))." points"); } //need to add events to both the bettor and the taker.. need to delete the bet and update players with points $db->query("DELETE FROM fifty WHERE bet_id = {$r['bet_id']}"); } } if(isset($_POST['cryatals']) && is_numeric($_POST['crystals'])){ if($_POST['cryatals'] < 10){ echo "<br />You are not betting enough"; $h->endpage(); exit; } elseif($_POST['cryatals'] > 5000){ echo "<br />You are trying to bet too much"; $h->endpage(); exit; } elseif($ir['second'] < $_POST['cryatals']){ echo "<br />You are trying to bet more than you have"; $h->endpage(); exit; } else{ $db->query("UPDATE users SET `second` = `second` - {$_POST['crystals']} where userid={$userid}"); $db->query("INSERT INTO fifty VALUES('',{$ir['userid']},{$_POST['crystals']},unix_timestamp())"); } } echo"<h2>50/50 Points Game</h2>"; echo"<p>The rules are simple.<br /> 2 players wager the same bet, the winner gets 90% of the pot. The house keeps 10%</p>"; echo"<p>The maximum bet is 5000 points but you may wager more than once.</p>"; echo "<p> <form method='post'> <input type='text' name='points' size='8' maxlength='7'> points (10-5000)<br /><br /> <input type='submit' name='bet' value='PlaceBet'> </form> </p> <h3>Awaiting Bets</h3> <p> <table width='90%'> <tr> <th><b>Mobster</b></td> <th><b>Points</b></td> <th><b>Bet Age</b></td> <th align='center'><b>Bet</b></td> </tr>"; $q = $db->query("SELECT f.*,u.username FROM fifty f LEFT JOIN users u ON f.bettor = u.userid ORDER BY bet_id ASC"); while($r = $db->fetch_row($q)) { echo"<tr>"; echo"<td>".$r['username']."</td>"; echo"<td>".$r['wager']."</td>"; echo"<td>".DateTime_Parse($r['bet_time'])."</td>"; echo "<td><form method='post'>"; echo"<input type='hidden' name='match' value='".$r['bet_id']."' /><input type='submit' value='Match Bet'></form></td>"; echo"</tr>"; } echo"</table></p>"; ?> thanks
-
hey me again sorry to be a pain in the ass but cant figure this out iam working on orgcrimes and i edited it a little to give out min respect and max respect basicly what i want to do now is send a event or insert it into gang events as it dont tell you if u pass or fail the event function wasnt working normaly heres what i done so far event_add($r['username'], "Your Gang's Organised Crime Failed. Go <a href='oclog.php?ID=$i'>here</a> to view the details.", $c); $db->query("INSERT INTO gangevents VALUES('',{$gangdata['gangID']},unix_timestamp(),'Your Gang's Organised Crime Succeeded. Go <a href='oclog.php?ID=$i'>here</a> to view the details');");
-
thanks works perfectly now :)
-
yeh i made it so users dont get the full amount back iv seen on some games that users sell there house before reset and gain intrest from it so by only giving them half the money back it wont work my house structure is hID hNAME hPRICE hWILL hPIC hPOINTS hTAX hSPRICE <?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; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } //House Tax Update $uq=$db->query("SELECT * FROM users"); $Row=0; while($r=$db->fetch_row($uq)) { $will = $r['maxwill']; $hq=$db->query("SELECT * FROM houses WHERE hWILL='{$will}'"); if($db->num_rows($hq) == 0) { } $r2=$db->fetch_row($hq); if($r['bankmoney'] < $r2['hTAX']) { $money=$r['money']; $db->query("UPDATE users SET money=money+'{$r2['hSPRICE']}', will=100, maxwill=100 WHERE userid={$r['userid']}"); event_add($r['userid'],"You failed to pay the tax, so you have lost the house.",$c); } else { $db->query("UPDATE users SET bankmoney=bankmoney-'{$r2['hTAX']}' WHERE userid='{$r['userid']}'"); } $Rows++; } ?> Totally there were <?php print($Rows); ?> rows which were executed. this is all the crontax.php
-
basicly he wants a marige mod from some game/script and gang armory which loans out wepons and for the 3rd one i dnt have a clue cronus is selling a gang armory for $10 it gives you the option to loan items to members http://www.mccodemods.com/mods.php?ID=43
-
yeh the event function is there in globals already checked that its proberly me just putting it in wrong place lol //House Tax Update $uq=$db->query("SELECT * FROM users"); $Row=0; while($r=$db->fetch_row($uq)) { $will = $r['maxwill']; $hq=$db->query("SELECT * FROM houses WHERE hWILL='{$will}'"); if($db->num_rows($hq) == 0) { } $r2=$db->fetch_row($hq); if($r['bankmoney'] < $r2['hTAX']) { $money=$r['money']; $db->query("UPDATE users SET money=money+'{$r2['hSPRICE']}', will=100, maxwill=100 WHERE userid={$r['userid']}"); event_add($r['userid'],"You failed to pay the tax, so you have lost the house.",$c); } else { $db->query("UPDATE users SET bankmoney=bankmoney-'{$r2['hTAX']}' WHERE userid='{$r['userid']}'"); } $Rows++; } ?> Totally there were <?php print($Rows); ?> rows which were executed.
-
ok i have been trying to use this but its not working event_add($r['userid'],"You failed to pay the tax, so you have lost the house.",$c);
-
hello all i have been trying to get my house tax cron to send a user a event when he loses his house due to non payement of tax but everything i try doesnt work can anyone help me out please thanks steven
-
just upload the images to your folder and then open up the page where you want the css Header or login etc look for the html bit will look diff depending on what html your using <!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> just add this someplace in your html <link rel="stylesheet" href="CSSFOLDER/NAMEOFCSS.css" type="text/css" />
-
i know this is old but shouldnt event_add($n['userid'],"You won 5 Points in the number game by picking number {$n['number']}",$c); be event_add($ir['userid'],"You won 5 Points in the number game by picking number {$ir['number']}",$c); or event_add($ir['userid'],"You won 5 Points in the number game by picking number {$no['number']}",$c); ???
-
i just get a white blank screen when i run the cron
-
i tried that but i didn't take out the <br /> original post updated thanks sniko
-
Ok i found a bug when you click to add the house or edit it and you put in the amount of crystals/points it doesnt update it on estate.php or databse i have to manualy add it through the database for it to change hmm ill take another look tommorow see if i can fix it as its late here and tried unless anyone else wants to take a look :) would appreciate it
-
Ok basically what this does is lets users buy houses for money and points/crystals or whatever its called on your game This might need to be edited to fit you game as i only set it up on stranded estate.php & staff_houses.php dunno if this has been done before but never seen it on these fourms 1. Add this to your database i used hPOINTS as i am using points on my game just change the POINTS to whatever you want it called and edit all posts where it says ['hPOINTS'] ALTER TABLE houses ADD hPOINTS INT( 11 ) NOT NULL DEFAULT '0' 2. estate.php <?php include "globals.php"; $mpq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $mp=$db->fetch_row($mpq); $_GET['property']=abs((int) $_GET['property']); if($_GET['property']) { $npq=$db->query("SELECT * FROM houses WHERE hID={$_GET['property']}"); $np=$db->fetch_row($npq); if($np['hWILL'] < $mp['hWILL']) { print "You cannot go backwards in houses!"; } else if ($np['hPRICE'] > $ir['money']) { print "You do not have enough money to buy the {$np['hNAME']}."; } else { $db->query("UPDATE users SET money=money-{$np['hPRICE']},will=0,maxwill={$np['hWILL']} WHERE userid=$userid"); $db->query("UPDATE users SET crystals=crystals-{$np['hPOINTS']},will=0,maxwill={$np['hWILL']} WHERE userid=$userid"); print "Congrats, you bought the {$np['hNAME']} for \${$np['hPRICE']} & {$np['hPOINTS']} points!"; } } else if (isset($_GET['sellhouse'])) { $npq=$db->query("SELECT * FROM houses WHERE hWILL={$ir['maxwill']}"); $np=$db->fetch_row($npq); if($ir['maxwill'] == 100) { print "You already live in the lowest property!"; } else { $db->query("UPDATE users SET money=money+{$np['hPRICE']},will=0,maxwill=100 WHERE userid=$userid"); $db->query("UPDATE users SET crystals=crystals+{$np['hPOINTS']},will=0,maxwill=100 WHERE userid=$userid"); print "You sold your {$np['hNAME']} and went back to your shed."; } } else { print "Your current property: <b>{$mp['hNAME']}</b><br /> The houses you can buy are listed below. Click a house to buy it.<br />"; if($ir['maxwill'] > 100) { print "<a href='estate.php?sellhouse'>Sell Your House</a><br />"; } $hq=$db->query("SELECT * FROM houses WHERE hWILL>{$ir['maxwill']} ORDER BY hWILL ASC"); while($r=$db->fetch_row($hq)) { print "<a href='estate.php?property={$r['hID']}'>{$r['hNAME']}</a>   - Cost: \${$r['hPRICE']} & {$r['hPOINTS']} points   - Will Bar: {$r['hWILL']}<br />"; } } $h->endpage(); ?> staff_houses.php <?php include "sglobals.php"; if($ir['user_level'] > 2) { die("403"); } //This contains shop stuffs switch($_GET['action']) { case "addhouse": addhouse(); break; case "edithouse": edithouse(); break; case "delhouse": delhouse(); break; default: print "Error: This script requires an action."; break; } function addhouse() { global $db, $ir, $c, $h, $userid; $price=abs((int) $_POST['price']); $crystals=abs((int) $_POST['hPOINTS']); $will=abs((int) $_POST['will']); $name=$_POST['name']; if($price and $will and $name) { $q=$db->query("SELECT * FROM houses WHERE hWILL={$will}"); if($db->num_rows($q)) { print "Sorry, you cannot have two houses with the same maximum will."; $h->endpage(); exit; } $db->query("INSERT INTO houses VALUES(NULL, '$name', '$price', '$will', '$crystals')"); print "House {$name} added to the game."; stafflog_add("Created House $name"); } else { print "<h3>Add House</h3><hr /> <form action='staff_houses.php?action=addhouse' method='post'> Name: <input type='text' name='name' /><br /> Price: <input type='text' name='price' /><br /> Points Cost: <input type='text' name='hPOINTS' /><br /> Max Will: <input type='text' name='will' /><br /> <input type='submit' value='Add House' /></form>"; } } function edithouse() { global $db, $ir, $c, $h, $userid; switch($_POST['step']) { case "2": $price=abs((int) $_POST['price']); $crystals=abs((int) $_POST['hPOINTS']); $will=abs((int) $_POST['will']); $q=$db->query("SELECT * FROM houses WHERE hWILL={$will} AND hID!={$_POST['id']}"); if($db->num_rows($q)) { print "Sorry, you cannot have two houses with the same maximum will."; $h->endpage(); exit; } $name=$_POST['name']; $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['id']}"); $old=$db->fetch_row($q); if($old['hWILL'] == 100 && $old['hWILL'] != $will) { die("Sorry, this house's will bar cannot be edited."); } $db->query("UPDATE houses SET hWILL=$will, hPRICE=$price, hNAME='$name', hPOINTS='$crystals' WHERE hID={$_POST['id']}"); $db->query("UPDATE users SET maxwill=$will WHERE maxwill={$old['hWILL']}"); $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); print "House $name was edited successfully."; stafflog_add("Edited house $name"); break; case "1": $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['house']}"); $old=$db->fetch_row($q); print "<h3>Editing a House</h3><hr /> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='2' /> <input type='hidden' name='id' value='{$_POST['house']}' /> Name: <input type='text' name='name' value='{$old['hNAME']}' /> Price: <input type='text' name='price' value='{$old['hPRICE']}' /><br /> Points Cost: <input type='text' name='hPOINTS' value='{$old['hPOINTS']}' /> Max Will: <input type='text' name='will' value='{$old['hWILL']}' /><br /> <input type='submit' value='Edit House' /></form>"; break; default: print "<h3>Editing a House</h3><hr /> <form action='staff_houses.php?action=edithouse' method='post'> <input type='hidden' name='step' value='1' /> House: ".house_dropdown($c, "house")."<br /> <input type='submit' value='Edit House' /></form>"; break; } } function delhouse() { global $db,$ir,$c,$h,$userid; if($_POST['house']) { $q=$db->query("SELECT * FROM houses WHERE hID={$_POST['house']}"); $old=$db->fetch_row($q); if($old['hWILL']==100) { die("This house cannot be deleted."); } $q2=$db->query("SELECT * FROM users WHERE maxwill={$old['hWILL']}"); $ids=array(); while($r=$db->fetch_row($q2)) { $ids[]=$r['userid']; } if(count($ids)) { $db->query("UPDATE users SET money=money+{$old['hPRICE']}, maxwill=100 WHERE userid IN(".implode(', ', $ids).")"); } $db->query("UPDATE users SET will=maxwill WHERE will > maxwill"); $db->query("DELETE FROM houses WHERE hID={$old['hID']}"); print "House {$old['hNAME']} deleted."; stafflog_add("Deleted house {$old['hNAME']}"); } else { print "<h3>Delete House</h3><hr /> Deleting a house is permanent - be sure. Any users that are currently on the house you delete will be returned to the first house, and their money will be refunded.<form action='staff_houses.php?action=delhouse' method='post'> House: ".house_dropdown($c, "house")."<br /> <input type='submit' value='Delete House' /></form>"; } } function report_clear() { global $db,$ir,$c,$h,$userid; if($ir['user_level'] > 3) { die("403"); } $_GET['ID'] = abs((int) $_GET['ID']); stafflog_add("Cleared player report ID {$_GET['ID']}"); $db->query("DELETE FROM preports WHERE prID={$_GET['ID']}"); print "Report cleared and deleted!<br /> <a href='staff_users.php?action=reportsview'>> Back</a>"; } $h->endpage(); ?> and thats it enjoy :) if you find any bugs post here but there should not be any i have tested and working fine :) Screenshots Add house [ATTACH=CONFIG]283[/ATTACH] Edit house [ATTACH=CONFIG]284[/ATTACH] Viewing houses [ATTACH=CONFIG]285[/ATTACH] Buy house [ATTACH=CONFIG]286[/ATTACH]
-
can anyone help me with this when i goto attack it says You did not select a valid ID
-
i cant figure this out was wondering if anyone can help me or point me in the right direction Ok so i created my oc what i was wondering is how do i make the crime show up in the gangs? For example Staff menu > ocs > start oc thanks
-
nice 1 sniko works perfectly now will be using this :) its good for making new players goto a help tutorial etc or a begginer guide
-
I know this old but hey wanted to try it out ok everything was working fine untill i added this function in then i get a http error my whole game does down function orgcrime_dropdown($connection,$ddname="orgcrime",$ selected=-1) { global $db; $ret="<select name='$ddname' type='dropdown'>"; $q=$db->query("SELECT * FROM orgcrimes ORDER BY ocID ASC"); if($selected == -1) { $first=0; } else { $first=1; } while($r=$db->fetch_row($q)) { $ret.="\n<option value='{$r['ocID']}'"; if ($selected == $r['ocID'] || $first == 0) { $ret.=" selected='selected'";$first=1; } $ret.=">{$r['ocNAME']}</option>"; } $ret.="\n</select>"; return $ret; }
-
i get this Warning: Cannot modify header information - headers already sent by (output started at /home/mobsters/public_html/register.php:218) in /home/mobsters/public_html/register.php on line 305
-
i get this when i sign up 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 ' 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, 'Male', unix_timestamp(), '[email protected]' at line 1 Query was INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, lastip_signup) VALUES ( 'Demo', 'Demo', md5('demo'), 1, 5000, 10, , 1, 12, 12, 100, 100, 5, 5, 100, 100, 1, 'Male', unix_timestamp(), '[email protected]', -1, '80.195.247.159', '80.195.247.159')
-
works fine urban just no images for it as it doesnt let you click them now :(
-
if anyone looking for free host which supports cron jobs i would reccommend x10hosting.com
-
basicly it cant open the connect file because it cant find it goto register.php and edit the file for example include_once(config.php) would be if you not moved your files include_once(safe/config.php)
-
Deprecated: Function ereg() is deprecated in /home/doomsday/public_html/register.php on line 65 - FIXED Deprecated: Function ereg_replace() is deprecated in /home/doomsday/public_html/includes/_credits.php on line 551 - FIXED Deprecated: Function ereg() is deprecated in /home/doomsday/public_html/includes/_credits.php on line 554 - FIXED Fatal error: require() [function.require]: Failed opening required 'bottom.php' (include_path='.:/usr/local/php53/pear') in /home/doomsday/public_html/files/prison_check.php on line 13 FIXED EDIT: ok so i managed to fix all the errors above still wondering about the question below Found another error When you do serch players can search as much as they want when you find money it adds to your account then goes back to whatever it was before. example say you were on $0 and you did your search and found $100 it would add it to your account once you click off search your money goes back to 0 edit: No longer need help figured it out