
corruptcity || skalman
Members-
Posts
358 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
Events
Everything posted by corruptcity || skalman
-
yeah its an outrage aint it lol
-
got a big problem with my crons....
corruptcity || skalman replied to kaine-'s topic in General Discussion
i could set your crons up for you but i would require access to your cpanel -
dreamweaver and mc for me then CE/MWG
-
need some help with this
corruptcity || skalman replied to corruptcity || skalman's topic in General Discussion
ok tyvm alain that was 1st time that ive used joined query before so was sure -
hi im trying to make a drug streets page for my drugs mod but im gettin an error with my join table query its prob somethink ive missed $loc is equal to 1 $q=$db->query("SELECT s.*,d.*,i.* FROM drugs_streets s LEFT JOIN drugs_drugs d LEFT JOIN drugs_inv i ON s.drugid = d.drugid WHERE s.location = $loc and i.userid = $userid"); this is the errror i get when i run the code 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 'WHERE s.location = 1 and i.userid = 3' at line 1 Query was SELECT s.*,d.*,i.* FROM drugs_streets s LEFT JOIN drugs_drugs d LEFT JOIN drugs_inv i ON s.drugid = d.drugid WHERE s.location = 1 and i.userid = 3
-
Stat Inserting and withdrawing mod
corruptcity || skalman replied to corruptcity || skalman's topic in Free Modifications
the reason why your gettin that error was when i was testing it out i commented out the delete query all you need to do is remove the // and it will work lol there is 1 on the statmarket page and the other 1 is on the statadd -
Stat Inserting and withdrawing mod
corruptcity || skalman replied to corruptcity || skalman's topic in Free Modifications
ok peeps here it is the final page of the mod the stat market page i have setup my tester site so you can see the mod in action the site is http://tester.corruptcity.net i have created 4 account demo through demo 4 and the passwords for all are abc123 all 3 links that you need are on the main menu stat withdraw, stat insert and stat market before i post the code i would like to say thanks to Entropia for giving me the idea for the mod, Immortal Thug thanks m8 you help me alot even if i was a pain in the ass lol, fbiss and others. if you like the stat market im im thinking about making an item market like it which i will sell. here is the code statmarket.php <?php include_once "globals.php"; $_GET['statid'] = isset($_GET['statid']) && is_numeric($_GET['statid']) ? abs(@intval($_GET['statid'])) : false; switch($_GET['action']) { case 'strength': strength(); break; case 'guard': guard(); break; case 'labour': labour(); break; case 'agility': agility(); break; case 'IQ': IQ(); break; case 'buy': buy(); break; case 'add': add(); break; case 'remove': remove(); break; default: index();break; } function index() { global $db,$ir,$dm,$userid; print " <h3>StatMarket</h3> <table width='80%' border='1' align='center'> <tr> <td width='10'><div align='center'>[url="statmarket.php>All</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=strength>Strength[/url]</div></td> <td width='10'><div align='center'>[url="statmarket.php?action=guard>Guard</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=labour>Labour[/url]</div></td> <td width='10'><div align='center'>[url="statmarket.php?action=agility>Agility</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=IQ>IQ[/url]</div></td> </tr> </table> "; echo "[url='statinsert.php']Add a listing[/url] "; echo "Viewing all listings "; echo "<table class='table' border=1 width='100%'>"; echo "<tr>"; echo "<th>Player</th>"; echo "<th>Stat</th>"; echo "<th>Amount</th>"; echo "<th>Price</th>"; echo "<th>Links</th>"; echo "</tr>"; $q=$db->query("SELECT i.*,u.* FROM implant_market i LEFT JOIN users u ON u.userid=i.userid WHERE i.stat_type ORDER BY i.stat_type ASC, i.PRICE ASC"); while($i=$db->fetch_row($q)) { if($i['userid'] == $userid) { $link = "[url='statmarket.php?action=remove&statid={$i['][Remove][/url]"; } else { $link = "[url='statmarket.php?action=buy&statid={$i['][buy][/url]"; } print "\n<tr><td align=center>[{$i['userid']}] [url='viewuser.php?u={$i['][{$i['username']}][/url]</td> <td align=center>{$i['stat']}</td> <td align=center>{$i['amount']}</td> <td align=center>{$i['price']}</td> <td align=center> $link</td></tr>"; } print "</table>"; } function strength() { global $db,$ir,$dm,$userid; print " <h3>StatMarket</h3> <table width='80%' border='1' align='center'> <tr> <td width='10'><div align='center'>[url="statmarket.php>All</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=strength>Strength[/url]</div></td> <td width='10'><div align='center'>[url="statmarket.php?action=guard>Guard</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=labour>Labour[/url]</div></td> <td width='10'><div align='center'>[url="statmarket.php?action=agility>Agility</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=IQ>IQ[/url]</div></td> </tr> </table> "; echo "[url='statinsert.php']Add a listing[/url] "; echo "Viewing all Strength listings "; echo "<table class='table' border=1 width='100%'>"; echo "<tr>"; echo "<th>Player</th>"; echo "<th>Stat</th>"; echo "<th>Amount</th>"; echo "<th>Price</th>"; echo "<th>Links</th>"; echo "</tr>"; $type = 1; $q=$db->query("SELECT i.*,u.* FROM implant_market i LEFT JOIN users u ON u.userid=i.userid WHERE i.stat_type = $type ORDER BY i.stat_type ASC, i.PRICE ASC"); while($i=$db->fetch_row($q)) { if($i['userid'] == $userid) { $link = "[url='statmarket.php?action=remove&statid={$i['][Remove][/url]"; } else { $link = "[url='statmarket.php?action=buy&statid={$r['][buy][/url]"; } print "\n<tr><td align=center>[{$i['userid']}] [url='viewuser.php?u={$i['][{$i['username']}][/url]</td> <td align=center>{$i['stat']}</td> <td align=center>{$i['amount']}</td> <td align=center>{$i['price']}</td> <td align=center>$link</td></tr>"; } print "</table>"; } function guard() { global $db,$ir,$dm,$userid; print " <h3>StatMarket</h3> <table width='80%' border='1' align='center'> <tr> <td width='10'><div align='center'>[url="statmarket.php>All</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=strength>Strength[/url]</div></td> <td width='10'><div align='center'>[url="statmarket.php?action=guard>Guard</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=labour>Labour[/url]</div></td> <td width='10'><div align='center'>[url="statmarket.php?action=agility>Agility</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=IQ>IQ[/url]</div></td> </tr> </table> "; echo "[url='statinsert.php']Add a listing[/url] "; echo "Viewing all Guard listings "; echo "<table class='table' border=1 width='100%'>"; echo "<tr>"; echo "<th>Player</th>"; echo "<th>Stat</th>"; echo "<th>Amount</th>"; echo "<th>Price</th>"; echo "<th>Links</th>"; echo "</tr>"; $type = 2; $q=$db->query("SELECT i.*,u.* FROM implant_market i LEFT JOIN users u ON u.userid=i.userid WHERE i.stat_type = $type ORDER BY i.stat_type ASC, i.PRICE ASC"); while($i=$db->fetch_row($q)) { if($i['userid'] == $userid) { $link = "[url='statmarket.php?action=remove&statid={$i['][Remove][/url]"; } else { $link = "[url='statmarket.php?action=buy&statid={$r['][buy][/url]"; } print "\n<tr><td align=center>[{$i['userid']}] [url='viewuser.php?u={$i['][{$i['username']}][/url]</td> <td align=center>{$i['stat']}</td> <td align=center>{$i['amount']}</td> <td align=center>{$i['price']}</td> <td align=center> $link</td></tr>"; } print "</table>"; } function labour() { global $db,$ir,$dm,$userid; print " <h3>StatMarket</h3> <table width='80%' border='1' align='center'> <tr> <td width='10'><div align='center'>[url="statmarket.php>All</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=strength>Strength[/url]</div></td> <td width='10'><div align='center'>[url="statmarket.php?action=guard>Guard</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=labour>Labour[/url]</div></td> <td width='10'><div align='center'>[url="statmarket.php?action=agility>Agility</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=IQ>IQ[/url]</div></td> </tr> </table> "; echo "[url='statinsert.php']Add a listing[/url] "; echo "Viewing all LAbour listings "; echo "<table class='table' border=1 width='100%'>"; echo "<tr>"; echo "<th>Player</th>"; echo "<th>Stat</th>"; echo "<th>Amount</th>"; echo "<th>Price</th>"; echo "<th>Links</th>"; echo "</tr>"; $type = 3; $q=$db->query("SELECT i.*,u.* FROM implant_market i LEFT JOIN users u ON u.userid=i.userid WHERE i.stat_type = $type ORDER BY i.stat_type ASC, i.PRICE ASC"); while($i=$db->fetch_row($q)) { if($i['userid'] == $userid) { $link = "[url='statmarket.php?action=remove&statid={$i['][Remove][/url]"; } else { $link = "[url='statmarket.php?action=buy&statid={$r['][buy][/url]"; } print "\n<tr><td align=center>[{$i['userid']}] [url='viewuser.php?u={$i['][{$i['username']}][/url]</td> <td align=center>{$i['stat']}</td> <td align=center>{$i['amount']}</td> <td align=center>{$i['price']}</td> <td align=center>$link</td></tr>"; } print "</table>"; } function agility() { global $db,$ir,$dm,$userid; print " <h3>StatMarket</h3> <table width='80%' border='1' align='center'> <tr> <td width='10'><div align='center'>[url="statmarket.php>All</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=strength>Strength[/url]</div></td> <td width='10'><div align='center'>[url="statmarket.php?action=guard>Guard</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=labour>Labour[/url]</div></td> <td width='10'><div align='center'>[url="statmarket.php?action=agility>Agility</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=IQ>IQ[/url]</div></td> </tr> </table> "; echo "[url='statinsert.php']Add a listing[/url] "; echo "Viewing all Agility listings "; echo "<table class='table' border=1 width='100%'>"; echo "<tr>"; echo "<th>Player</th>"; echo "<th>Stat</th>"; echo "<th>Amount</th>"; echo "<th>Price</th>"; echo "<th>Links</th>"; echo "</tr>"; $type = 4; $q=$db->query("SELECT i.*,u.* FROM implant_market i LEFT JOIN users u ON u.userid=i.userid WHERE i.stat_type = $type ORDER BY i.stat_type ASC, i.PRICE ASC"); while($i=$db->fetch_row($q)) { if($i['userid'] == $userid) { $link = "[url='statmarket.php?action=remove&statid={$i['][Remove][/url]"; } else { $link = "[url='statmarket.php?action=buy&statid={$r['][buy][/url]"; } print "\n<tr><td align=center>[{$i['userid']}] [url='viewuser.php?u={$i['][{$i['username']}][/url]</td> <td align=center>{$i['stat']}</td> <td align=center>{$i['amount']}</td> <td align=center>{$i['price']}</td> <td align=center>$link</td></tr>"; } print "</table>"; } function IQ() { global $db,$ir,$dm,$userid; print " <h3>StatMarket</h3> <table width='80%' border='1' align='center'> <tr> <td width='10'><div align='center'>[url="statmarket.php>All</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=strength>Strength[/url]</div></td> <td width='10'><div align='center'>[url="statmarket.php?action=guard>Guard</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=labour>Labour[/url]</div></td> <td width='10'><div align='center'>[url="statmarket.php?action=agility>Agility</a></div></td> <td"]<div align='center'><a href=statmarket.php?action=IQ>IQ[/url]</div></td> </tr> </table> "; echo "[url='statinsert.php']Add a listing[/url] "; echo "Viewing all IQ listings "; echo "<table class='table' border=1 width='100%'>"; echo "<tr>"; echo "<th>Player</th>"; echo "<th>Stat</th>"; echo "<th>Amount</th>"; echo "<th>Price</th>"; echo "<th>Links</th>"; echo "</tr>"; $type = 5; $q=$db->query("SELECT i.*,u.* FROM implant_market i LEFT JOIN users u ON u.userid=i.userid WHERE i.stat_type = $type ORDER BY i.stat_type ASC, i.PRICE ASC"); while($i=$db->fetch_row($q)) { if($i['userid'] == $userid) { $link = "[url='statmarket.php?action=remove&statid={$i['][Remove][/url]"; } else { $link = "[url='statmarket.php?action=buy&statid={$r['][buy][/url]"; } print "\n<tr><td align=center>[{$i['userid']}] [url='viewuser.php?u={$i['][{$i['username']}][/url]</td> <td align=center>{$i['stat']}</td> <td align=center>{$i['amount']}</td> <td align=center>{$i['price']}</td> <td align=center>$link</td></tr>"; } print "</table>"; } function buy() { global $ir, $db, $userid, $h; if(!$_GET['statid']) { echo "Listing ID not specified. [url='statmarket.php']Back[/url]"; $h->endpage(); exit; } if(!$ir['money']) { echo "You have no money. [url='statmarket.php']Back[/url]"; $h->endpage(); exit; } $select = sprintf("SELECT * FROM implant_market WHERE (statid = '{$_GET['statid']}')", $_GET['statid']); $query = $db->query($select); if(!$db->num_rows($query)) { echo "This listing does not exist. [url='statmarket.php']Back[/url]"; $h->endpage(); exit; } $row = $db->fetch_row($query); if($row['userid'] == $userid) { echo "You can't buy your own listing. [url='statmarket.php']Back[/url]"; $h->endpage(); exit; } $total = $row['price']; $statname = $row['stat']; $amount = $row['amount']; $type = $row['stat_type']; $name = $db->fetch_single($db->query(sprintf("SELECT username FROM users WHERE (userid = '{$ir['userid']}')", $row['userid']))); if($ir['money'] > $total) { $update1 = sprintf("UPDATE users SET money = money - $total WHERE (userid = '{$ir['userid']}')", $total, $userid); $update2 = sprintf("UPDATE users SET money = money + $total WHERE (userid = '{$row['userid']}')", $total, $row['userid']); $insert1 = sprintf("INSERT INTO implants (statid, userid, stat, amount, stat_type) VALUES ('{$_GET['statid']}', '{$userid}', '{$statname}', '{$amount}', '{$type}')"); $delete = sprintf("DELETE FROM implant_market WHERE (statid = '{$_GET['statid']}')", $_GET['statid']); $db->query($update1); $db->query($update2); $db->query($insert1); $db->query($delete); $event = sprintf("[url='viewuser.php?u='][/url] bought your Implant for \$ $total from the stat Market. ", $userid, $ir['username']); event_add($row['userid'], $event); echo sprintf("You bought the Implant from '{$row['userid']}' for \$ $total . [url='statmarket.php']Back[/url]"); } else { echo "You don't have enough money. [url='statmarket.php']Back[/url]"; $h->endpage(); exit; } } function remove() { global $db, $userid, $h; if(!$_GET['statid']) { echo "Listing ID not specified. [url='statmarket.php']Back[/url]"; $h->endpage(); exit; } $select = sprintf("SELECT * FROM implant_market WHERE (statid = '{$_GET['statid']}' AND userid = '{$userid}')"); $query = $db->query($select); if(!$db->num_rows($query)) { echo "Either this listing does not exist, or you don't own it. [url='statmarket.php']Back[/url]"; $h->endpage(); exit; } $row = $db->fetch_row($query); $insert = sprintf(" INSERT INTO implants (statid, userid, stat, amount, stat_type) VALUES ('{$_GET['statid']}', '{$userid}','{$_GET['stat']}','{$_GET['amount']}','{$_GET['stat_type']}')"); $delete = sprintf(" DELETE FROM implant_market WHERE (statid = '{$_GET['statid']}' and userid = $userid"); $db->query($insert); $db->query($delete); echo "Your implant have been returned to you <a href=statmarket.php> Back</a>"; } ?> -
Stat Inserting and withdrawing mod
corruptcity || skalman replied to corruptcity || skalman's topic in Free Modifications
doesnt matter it was about my last post it was working for me yesterday as my pc was playing funny buggers -
Stat Inserting and withdrawing mod
corruptcity || skalman replied to corruptcity || skalman's topic in Free Modifications
ignore me -
I originally PMed this to Gucci Mane but i thought that it could be helpful to anyone that was in the same position as gucci was. Dont worry this time i DID USE a Calculator lol ok the formula for working out the exp is ((yourlevel+1)*(yourlevel+1)*(yourlevel+1)*2.2) so if your level is 1 then it would be (1+1)*(1+1)*(1+1)*2.2) 2 * 2 * 2 * 2.2 = 17.6 exp needed for the 1st level no if you want to make it bigger increase the *2.2 bit or increase the +1 to say +3 now for my example ((1+2)*(1+2)*(1+2)*2.5) = 22.5 the only problem with increasing the +1 or *2.2 is that it will take longer to level up the higher you go so you wanna bear that in mind to show this i will work it out for a level 10 ((10+1)*(10+1)*(10+1)*2.2) = 2928.2 now with mine ((10+2)*(10+2)*(10+2)*2.5) = 4320 as you can see it has added on almost a 1/3rd more exp
-
Stat Inserting and withdrawing mod
corruptcity || skalman replied to corruptcity || skalman's topic in Free Modifications
ok you dont need to do any of them -
yeah my maths sucks when i havent had much sleep lol
-
Stat Inserting and withdrawing mod
corruptcity || skalman replied to corruptcity || skalman's topic in Free Modifications
this is to statadd.php <?php include "globals.php"; $_GET['statid'] = abs((int) $_GET['statid']); $_GET['amount'] = abs((float) $_GET['amount']); $_GET['stat_type'] = abs((int) $_GET['stat_type']); $_GET['stat'] = mysql_real_escape_string($_GET['stat']); $cost = abs((int) $_POST['price']); if($_GET['statid'] && $_POST['price'] && $_GET['amount'] && $_GET['stat_type'] && $_GET['stat']) { $implants=$db->query("SELECT * FROM implants WHERE statid='{$_GET['statid']}' and userid=$userid"); if($db->num_rows($implants)==0) { print "Invalid statid line 14 "; } else { $s=$db->fetch_row($implants); $db->query("INSERT INTO implant_market (marketid, statid, userid, stat, stat_type, amount, price) VALUES ('','{$s['statid']}',$userid,'{$_GET['stat']}', '{$_GET['stat_type']}', '{$_GET['amount']}', '$cost')"); $db->query("DELETE FROM implants WHERE statid='{$_GET['statid']}' and userid=$userid"); $db->query("INSERT INTO smarketlogs (smlid, statid, userid, stat, stat_type, amount, price, time) VALUES('','{$_GET['statid']}',$userid,'{$_GET['stat']}', '{$_GET['stat_type']}','{$_GET['amount']}', '$cost',unix_timestamp())"); print "Stat Added to the market. <a href=statinsert.php> Back</a>"; } } else { $s=$db->fetch_row($implants); print "Adding an item to the item market... <form action='statadd.php?statid={$_GET['statid']}&stat={$_GET['stat']}&stat_type={$_GET['stat_type']}&amount={$_GET['amount']}&price={$_GET['price']}' method='post'> <input type='hidden' name='statid' value='{$_GET['statid']}' /> Price: <input type='text' name='price' value='100' /> <input type='submit' value='Add' /></form>"; } $h->endpage(); ?> im still working on the stat market page will paste it once done i will also setup this mod on my testing site so that you can see it working before if you want to use it the link will be http://tester.corruptcity.net -
Stat Inserting and withdrawing mod
corruptcity || skalman replied to corruptcity || skalman's topic in Free Modifications
ok here is the statwithdraw.php <?php include_once "globals.php"; $statnames=array( 'Strength' => 'strength', 'Agility' => 'agility', 'Guard' => 'guard', 'Labour' => 'labour', 'IQ' => 'IQ'); if($_POST['statselect'] && array_key_exists(''.$_POST['statselect'].'',$statnames)) { $stat=$statnames[''.$_POST['statselect'].'']; $wdperc= 10; //Change to the percent that you with like to withdrawl, EX. 20 would be 20% $withdrawn=$ir[''.$stat.'']*($wdperc/100); //Specify Stat Type 1=strength 2=agility 3=guard 4=labor 5=IQ if($stat=="strength") { $statype = 1; } if($stat=="agility") { $statype = 2; } if($stat=="guard"){ $statype = 3; } if($stat=="labour") { $statype = 4; } if($stat=="IQ") { $statype = 5; } //END $db->query("UPDATE userstats SET $stat=$ir[$stat]-$withdrawn WHERE userid=$ir[userid]"); $db->query("Insert into implants (statid, userid, stat, amount, stat_type) VALUES ('',".$ir['userid'].",'$stat ','$withdrawn','$statype')"); if(!$stat) { die("This stat cannot be withdrawn."); } else { $inc=$ir[$stat]-$withdraw; if($stat=="strength") { print "<hr>You Safety Managed to fill the Stat Implant with some of your strength. You have lost {$withdrawn} strength from this process. You now have {$inc} strength.</hr>"; } elseif($stat=="agility") { print "<hr>You Safety Managed to fill the Stat Implant with some of your Agility. You have lost {$withdrawn} agility from this process. You now have {$inc} agility.</hr>"; } elseif($stat=="guard") { print "<hr>You Safety Managed to fill the Stat Implant with some of your Guard. You have lost {$withdrawn} guard from this process. You now have {$inc} guard.</hr>"; } elseif($stat=="labour") { print "<hr>You Safety Managed to fill the Stat Implant with some of your Labour. You have lost {$withdrawn} labour from this process. You now have {$inc} labour.</hr>"; } elseif($stat=="IQ") { print "<hr>You Safety Managed to fill the Stat Implant with some of your IQ. You have lost {$withdrawn} labour from this process. You now have {$inc}.</hr>"; } print "<hr />"; $ir[''.$stat.'']-=$withdrawn; } } $ir['strank']=get_rank($ir['strength'],'strength'); $ir['agirank']=get_rank($ir['agility'],'agility'); $ir['guarank']=get_rank($ir['guard'],'guard'); $ir['labrank']=get_rank($ir['labour'],'labour'); $ir['IQrank']=get_rank($ir['IQ'],'IQ'); print "Choose the stat you want to withdraw from. <form action='statwithdraw.php' method='post'> Stat: <select type='dropdown' name='statselect'> <option style='color:red;' value='Strength'>Strength (Have {$ir['strength']}, Ranked {$ir['strank']}) <option style='color:blue;' value='Agility'>Agility (Have {$ir['agility']}, Ranked {$ir['agirank']}) <option style='color:green;' value='Guard'>Guard (Have {$ir['guard']}, Ranked {$ir['guarank']}) <option style='color:brown;' value='Labour'>Labour (Have {$ir['labour']}, Ranked {$ir['labrank']}) <option style='color:orange;' value='IQ'>IQ (Have {$ir['IQ']}, Ranked {$ir['IQrank']}) </select> <input type='submit' value='withdraw' /></form>"; $h->endpage(); ?> here is the statinsert.php <?php include_once "globals.php"; print "<h3>Implants</h3><hr />"; $implants=$db->query("SELECT * FROM implants WHERE userid=$ir[userid]"); if ($s=$db->num_rows($implants) == 0) { print "[b]You have no Implants![/b]"; } else { print "[b]Your items are listed below.[/b] <table width=80% class=\"table\" border=\"1\" cellspacing=\"1\"> <tr> <td width=20% align=center class=\"h\">Stat</td> <td width=20% align=center class=\"h\">Amount</td> <td width=30% align=center class=\"h\">Insert</td> </tr>"; $lt=""; while($s=$db->fetch_row($inv)) { if($lt!=$s['itmtypename']) { $lt=$s['itmtypename']; print "\n<tr><td colspan=3>[b]{$lt}[/b]</td></tr>"; } print "<tr><td align=center>{$s['stat']}"; if ($s['inv_qty'] > 1) { print "x{$s['amount']}"; } print "</td><td align=center>{$s['amount']}</td><td>"; $type = $s['stat_type']; $amount = $s['amount']; $stat_type = $s['stat_type']; print "[[url='impinsert.php?type=$type&statid={$s[']Insert[/url]] [[url='statadd.php?statid={$s[']Add To Market[/url]]</td>"; print "</td></tr>"; } print "</table>"; } $h->endpage(); ?> impinsert.php <?php /* 1 = Strength 2 = Agility 3 = Guard 4 = Labour 5 = IQ */ include_once "globals.php"; $statid = abs((int) $_GET['statid']); $stat = mysql_real_escape_string ($_GET['stat']); $type = abs((int) $_GET['type']); // DETERMINE AMOUNT & STAT NAME $ad=$db->query("SELECT * FROM implants WHERE statid ={$_GET['statid']} and userid=$userid"); $s=$db->fetch_row($ad); $amount = $s['amount']; $statname = $s['stat']; // END $statid=$db->query("SELECT * FROM implants WHERE statid=$statid and userid=$userid"); if($db->num_rows($statid)==0) { print "Invalid stat ID"; $h->endpage(); exit; } else { $stid=$db->fetch_row($statid); } if($type != '1' && $type != '2' && $type != '3' && $type != '4' && $type != '5') { print "Invalid stat"; $h->endpage(); exit; } print"You use the implant and you gained $amount amount of $statname. "; $update = sprintf("UPDATE `userstats` SET $statname=$statname+$amount WHERE userid=$userid"); mysql_query($update); $delete = ("DELETE FROM implants WHERE statid={$_GET['statid']} and userid=$userid"); mysql_query($delete); ?> still more to come -
ok here is the SQL for the mod [mysql] -- Table structure for table `implants` -- CREATE TABLE IF NOT EXISTS `implants` ( `statid` int(11) NOT NULL AUTO_INCREMENT, `userid` int(11) NOT NULL, `stat` tinytext NOT NULL, `amount` decimal(11,4) NOT NULL, `stat_type` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`statid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- [/mysql] [mysql] -- Table structure for table `implant_market` -- CREATE TABLE IF NOT EXISTS `implant_market` ( `marketid` int(11) NOT NULL AUTO_INCREMENT, `statid` int(11) NOT NULL, `userid` int(11) NOT NULL, `stat_type` int(11) NOT NULL, `amount` decimal(11,4) NOT NULL, `price` int(11) NOT NULL, PRIMARY KEY (`marketid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- [/mysql] [mysql] -- Table structure for table `smarketlogs` -- CREATE TABLE IF NOT EXISTS `smarketlogs` ( `smlid` int(11) NOT NULL AUTO_INCREMENT, `statid` int(11) NOT NULL, `userid` int(11) NOT NULL, `stat_type` int(11) NOT NULL, `amount` decimal(11,4) NOT NULL, `price` int(11) NOT NULL, `time` int(11) NOT NULL, PRIMARY KEY (`smlid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; -- [/mysql] ok still more to come
-
yeah per each level its (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); so for the 1st level you need ((1+1)*(1+1)*(1+1)*2.2)=8.8 and for level 10 it would be ((10+1)*(11)*(11)*2.2)=2928.2 if you want to change it open up your global_func and find the function: check_level() the bit your looking for is the line b4 the query
-
ok tyvm for your input fbiss
-
yeah sure there you go fbiss and thanks again [mysql] -- Table structure for table `drugs_streets` -- CREATE TABLE IF NOT EXISTS `drugs_streets` ( `streetid` int(11) NOT NULL AUTO_INCREMENT, `location` int(11) NOT NULL, `drug` text NOT NULL, `defaultprice` int(11) NOT NULL, `buy` int(11) NOT NULL, `sell` int(11) NOT NULL, PRIMARY KEY (`streetid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=67 ; -- [/mysql] [mysql] -- Table structure for table `drugs_drugs` -- CREATE TABLE IF NOT EXISTS `drugs_drugs` ( `drugid` int(11) NOT NULL AUTO_INCREMENT, `userid` int(11) NOT NULL, `crack` int(11) NOT NULL, `cocaine` int(11) NOT NULL, `heroin` int(11) NOT NULL, `weed` int(11) NOT NULL, `mdma` int(11) NOT NULL, `lsd` int(11) NOT NULL, `speed` int(11) NOT NULL, `ketamine` int(11) NOT NULL, `speck` int(11) NOT NULL, `crystalmeth` int(11) NOT NULL, `amphetamine` int(11) NOT NULL, PRIMARY KEY (`drugid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- [/mysql]
-
hi im having a problem with trying to make my drugs mod ive got a page called drugstreets and on that page ive got a table that needs to get info from 2 tables 1 table holds the drugs and what they are worth and the other table holds all the drugs that that user has. here is my problem im trying to join the 2 tables but what ive tried it doesnt work as i dont have anythink that needs to be linked between then 2. so what would be the best way to fix or sort this is out if you need any more info or want to see the code sofar just holla
-
hi i thought i would start with spreading the work about my 1st ever free mod, and with this mod your user will be able to withdraw a small % of any of their stats its 1 type of stat per each empty implant as default i have set it that it takes 10% of any stat. there will be a stat market where you can sell all the implants if you want to or send to another player and of course insert that implant. I got the idea of this mod from the MMORRPG game Entropia which i used to play where you would either loot or buy ESI (empty skill implants) which would hold 10% and that could be given away or sold and the other person would insert it. the mod is almost finished just need to finish the stat market and add the extra lines of code in inventory i would expect that i will be able to post the mod up by no later than the end of the week
-
need some help with this
corruptcity || skalman replied to corruptcity || skalman's topic in General Discussion
ok ive sorted thos problems out but no im getting to different problems prob no 1: when the query is run for adding the implant to market the price always says 0 in myadmin no 2:its stopped asking me to enter a price to sell it for $cost was used just to make sure it wasnt the $_GET['price'] buggering up this is the new code <?php include "globals.php"; $_GET['statid'] = abs((int) $_GET['statid']); $_GET['price'] = abs((int) $_GET['price']); $_GET['amount'] = abs((float) $_GET['amount']); $_GET['stat_type'] = abs((int) $_GET['stat_type']); $cost = abs((int) $_GET['price']); if($_GET['statid']) { $implants=$db->query("SELECT * FROM implants WHERE statid='{$_GET['statid']}' and userid=$userid"); if($db->num_rows($implants)==0) { print "Invalid stat ID line 13 "; } else { $s=$db->fetch_row($implants); $db->query("INSERT INTO implant_market (marketid, statid, userid, stat_type, amount, price) VALUES ('','{$s['statid']}',$userid, '{$_GET['stat_type']}', '{$_GET['amount']}', '$cost')"); $db->query("DELETE FROM implants WHERE statid='{$_GET['statid']}' and userid=$userid"); $db->query("INSERT INTO smarketlogs (smlid, statid, userid, stat_type, amount, price, time) VALUES('','{$_GET['statid']}',$userid,'{$_GET['stat_type']}','{$_GET['amount']}', '$cost',unix_timestamp())"); print "Stat added to market."; } } else { $implant=$db->query("SELECT * FROM implants WHERE statid='{$_GET['statid']}' and userid=$userid"); if($db->num_rows($implant)==0) { print "Invalid Stat ID line 33"; } else { $s=$db->fetch_row($implant); print "Adding an item to the item market... <form action='statadd.php?type=$type&amount=$amount&stat_type=$stat_type&statid={$s['statid']}'' method='get'> <input type='hidden' name='ID' value='{$_GET['statid']}' /> Price: <input type='text' name='price' value='100' /> <input type='submit' value='Add' /></form>"; } } $h->endpage(); ?> -
need some help with this
corruptcity || skalman replied to corruptcity || skalman's topic in General Discussion
when i use my copy of the code i get this error 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 '100',unix_timestamp())' at line 1 Query was INSERT INTO smarketlogs (smlid, statid, userid, stat, amount, price, time) VALUES('','0','3'','', '100',unix_timestamp()) but when i tried your 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 '100)' at line 2 Query was INSERT INTO implant_market (marketid, statid, userid, stat, amount, price) Values ('',0,3,'',,100)