Jump to content
MakeWebGames

AlabamaHit

Members
  • Posts

    1,308
  • Joined

  • Last visited

Everything posted by AlabamaHit

  1. Re: [mccodes v2] sendcash.php / Same IP Stop   Please Test before you Doubt. My code works 100%. I would not have posted other wise.
  2. Re: Registration Page If mail out don't work thats your host.
  3. Re: [V2] Garage Mod try changing   $inv=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_userid={$userid} ORDER BY i.itmtype ASC, i.itmname ASC");   to   $inv=$db->query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_userid={$userid} AND it.itmtypeid = 1 ORDER BY i.itmname ASC");
  4. Re: [mccodes v2] sendcash.php / Same IP Stop   Are you serious?   Glad it helps :)
  5. Re: [mccodes v2] sendcash.php / Same IP Stop Small Update. This should fix that problem that Rioter found and the problem ishmell is having with number format.   <?php include_once ("globals.php"); $_GET['ID'] = abs(@intval($_GET['ID'])); $_POST['money'] = abs(@intval($_POST['money'])); if(!$_GET['ID']) { echo "Invalid User ID"; echo "[url='index.php']> Go Home[/url]"; } else if($_GET['ID'] == $userid) { echo "You can not send money to yourself."; echo "[url='index.php']> Go Home[/url]"; } else { if($_POST['money']) { // //This is the part you add to other pages. This is the block. // $get_check = sprintf("SELECT lastip FROM users WHERE userid = %u",abs(@intval($_GET['ID']))); $do_check = $db->query($get_check); $ch = $db->fetch_row($do_check); if($ch['lastip'] == $ir['lastip']) { echo "Sorry, sending on same IP is not allowed."; echo "[url='index.php']> Go Home[/url]"; } else if($_POST['money'] > $ir['money']) { print "Sorry, you do not have that much money."; echo "[url='index.php']> Go Home[/url]"; } else { $do_1 = sprintf("UPDATE users SET money = money - %u WHERE userid = %u",abs(@intval($_POST['money'])),($userid)); $do_2 = sprintf("UPDATE users SET money = money + %u WHERE userid = %u",abs(@intval($_POST['money'])),($userid)); event_add($_GET['ID'], "You received \$".number_format($_POST['money'])." from ".$ir['username']."",$c); $db->query($do_1); $db->query($do_2); $get_it = sprintf("SELECT userid, username, money, lastip FROM users WHERE userid=%u",abs(@intval($_GET['ID']))); $it = $db->query($get_it); $er = $db->fetch_row($it); $do_3 = sprintf("INSERT INTO cashxferlogs VALUES('', %u, %u, %u, unix_timestamp(), '%s', '%s')",($userid),($_GET['ID']),($_POST['money']),($ir['lastip']),($er['lastip'])); $db->query($do_3); echo "You sent \$".number_format($_POST['money'])." to ID ".number_format($_GET['ID'])."."; echo "[url='index.php']> Go Home[/url]"; } } else { echo "<h2>Sending Money</h2> "; echo "You are sending money to ID: [b]".number_format($_GET['ID'])."[/b]."; echo " You have "; echo "[b]\$".number_format($ir['money'])."[/b] you can send."; echo sprintf("<form action='sendcash.php?ID=%u' method='post'>",($_GET['ID'])); echo "Amnt: <input type='text' name='money' /> "; echo "<input type='submit' value='Send' /></form>"; echo " "; echo "<h2>Latest 5 Transfers</h2> "; echo "<table class='table'>"; echo "<tr>"; echo "<th width='25%'>Time</th>"; echo "<th width='25%'>User From</th>"; echo "<th width='25%'>User To</th>"; echo "<th width='25%'>Amount</th>"; echo "</tr>"; $q=$db->query("SELECT cx.*,u1.username as sender, u2.username as sent FROM cashxferlogs cx LEFT JOIN users u1 ON cx.cxFROM=u1.userid LEFT JOIN users u2 ON cx.cxTO=u2.userid WHERE cx.cxFROM=$userid ORDER BY cx.cxTIME DESC LIMIT 5"); while($r=$db->fetch_row($q)) { echo "<tr>"; echo "<td>" . date("F j, Y, g:i:s a",$r['cxTIME']) . "</td>"; echo sprintf("<td>%s [".number_format($r['cxFROM'])."] </td>",stripslashes($r['sender'])); echo sprintf("<td>%s [".number_format($r['cxTO'])."] </td>",stripslashes($r['sent'])); echo "<td>\$".number_format($r['cxAMOUNT'])."</td>"; echo "</tr>"; } echo "</table>"; } } $h->endpage(); ?>   At Strats. No, this is just the sendcash.php You will have to add to your sendbank.php and such. This was made mostly as an example. THis is snippet of code youwill have to add.   $get_check = sprintf("SELECT lastip FROM users WHERE userid = %u",abs(@intval($_GET['ID']))); $do_check = $db->query($get_check); $ch = $db->fetch_row($do_check); if($ch['lastip'] == $ir['lastip']) { echo "Sorry, sending on same IP is not allowed."; echo "[url='index.php']> Go Home[/url]"; }   To know where it goes just look at the page i made. :wink:
  6. Well, this was talked about on another spot on CE. So I decided to post here, what I was talking about. This is an example. You would have to add the block area to all your sending pages. But here ya go. <?php include_once ("globals.php"); $_GET['ID'] = abs(@intval($_GET['ID'])); $_POST['money'] = abs(@intval($_POST['money'])); if(!$_GET['ID']) { echo "Invalid User ID"; echo "[url='index.php']> Go Home[/url]"; } else if($_GET['ID'] == $userid) { echo "You can not send money to yourself."; echo "[url='index.php']> Go Home[/url]"; } else { if($_POST['money']) { // //This is the part you add to other pages. This is the block. // $get_check = sprintf("SELECT lastip FROM users WHERE userid = %u",abs(@intval($_GET['ID']))); $do_check = $db->query($get_check); $ch = $db->fetch_row($do_check); if($ch['lastip'] == $ir['lastip']) { echo "Sorry, sending on same IP is not allowed."; echo "[url='index.php']> Go Home[/url]"; } else if($_POST['money'] > $ir['money']) { print "Sorry, you do not have that much money."; echo "[url='index.php']> Go Home[/url]"; } else { $do_1 = sprintf("UPDATE users SET money = money - %u WHERE userid = %u",abs(@intval($_POST['money'])),($userid)); $do_2 = sprintf("UPDATE users SET money = money + %u WHERE userid = %u",abs(@intval($_POST['money'])),($userid)); event_add($_GET['ID'], "You received \$".number_format($_POST['money'])." from ".$ir['username']."",$c); $db->query($do_1); $db->query($do_2); $get_it = sprintf("SELECT userid, username, money, lastip FROM users WHERE userid=%u",abs(@intval($_GET['ID']))); $it = $db->query($get_it); $er = $db->fetch_row($it); $do_3 = sprintf("INSERT INTO cashxferlogs VALUES('', %u, %u, %u, unix_timestamp(), '%s', '%s')",($userid),($_GET['ID']),($_POST['money']),($ir['lastip']),($er['lastip'])); $db->query($do_3); echo sprintf("You sent \$%d to ID %d.",number_format($_POST['money']),number_format($_GET['ID'])); echo "[url='index.php']> Go Home[/url]"; } } else { echo "<h2>Sending Money</h2> "; echo sprintf("You are sending money to ID: [b]%d[/b].",number_format($_GET['ID'])); echo " You have "; echo sprintf("[b]\$%d[/b] you can send.",number_format($ir['money'])); echo sprintf("<form action='sendcash.php?ID=%u' method='post'>",($_GET['ID']))); echo "Amnt: <input type='text' name='money' /> "; echo "<input type='submit' value='Send' /></form>"; echo " "; echo "<h2>Latest 5 Transfers</h2> "; echo "<table class='table'>"; echo "<tr>"; echo "<th width='25%'>Time</th>"; echo "<th width='25%'>User From</th>"; echo "<th width='25%'>User To</th>"; echo "<th width='25%'>Amount</th>"; echo "</tr>"; $q=$db->query("SELECT cx.*,u1.username as sender, u2.username as sent FROM cashxferlogs cx LEFT JOIN users u1 ON cx.cxFROM=u1.userid LEFT JOIN users u2 ON cx.cxTO=u2.userid WHERE cx.cxFROM=$userid ORDER BY cx.cxTIME DESC LIMIT 5"); while($r=$db->fetch_row($q)) { echo "<tr>"; echo "<td>" . date("F j, Y, g:i:s a",$r['cxTIME']) . "</td>"; echo sprintf("<td>%s [%d] </td>",stripslashes($r['sender']),number_format($r['cxFROM'])); echo sprintf("<td>%s [%d] </td>",stripslashes($r['sent']),number_format($r['cxTO'])); echo sprintf("<td>\$%d</td>",number_format($r['cxAMOUNT'])); echo "</tr>"; } echo "</table>"; } } $h->endpage(); ?> Enjoy.
  7. Re: Help   CREATE TABLE `items` ( `itmid` int(11) NOT NULL auto_increment, `itmtype` int(11) NOT NULL default '0', `itmname` varchar(255) NOT NULL default '', `itmdesc` text NOT NULL, `itmbuyprice` int(11) NOT NULL default '0', `itmsellprice` int(11) NOT NULL default '0', `itmbuyable` int(11) NOT NULL default '0', `effect1_on` tinyint(4) NOT NULL default '0', `effect1` text NOT NULL, `effect2_on` tinyint(4) NOT NULL default '0', `effect2` text NOT NULL, `effect3_on` tinyint(4) NOT NULL default '0', `effect3` text NOT NULL, `weapon` int(11) NOT NULL default '0', `armor` int(11) NOT NULL default '0', PRIMARY KEY (`itmid`) ) ENGINE=MyISAM ;
  8. Re: Auto ban mod [V2] would be something like like this.. and it would go in the itemsend files.. cashsend.. Not the header.   $get_ip_check = sprintf("SELECT lastlogin, lastip FROM users WHERE userid = %u",abs(@intval($_GET['ID']))); $do_ip_check = $db->query($get_ip_check); if($db->num_rows($do_ip_check) > 0) { die("No"); }   Only posting cuase you did :)....ANd you can extend it. to include more than just lastlogin IP. But I would defently put in itemsend, cashsend, etc, Not the header.php. You want to keep stuff out of header.php. and globals.php that is not really needed all the time becuase it will slow your site down.
  9. Re: Need help with simple sql please His games a stupid anyways. They are free domain and free host so whats the point of fixing it.
  10. Re: Auto ban mod [V2] that is what im saying just Block it. then they cant do it. Oh...and if you want to block it. Its free on CE. just search the forums. banning for this is just stupid. You lose colleges, and ISPs like AOL.
  11. Re: [mccodes]Secure demo account Why is this post even here....their is a topic on this already...
  12. Re: My jailescape I think you can do away with $r=$db->fetch_row($db->query("SELECT * FROM users WHERE userid={$_GET['ID']}")); This will help the server load.
  13. Re: Help with needing more than one item what ever makes you feel better. I don't post unless i nkow it works. I know you don't need it here. and its pointless you just slowing down the page. I'm not posting back on this topic cuase your the kind of person that when thinks he is right will not listen. If you want to use the num rows it will work. Its a waist of typing. Waist of server lag for checking. I honestly don't care.
  14. Re: How to make person say something else after you beat quest? If you looked at first code i showed. You should see why yours is not working. your going. else { if(somethign) { Thats wrong. else if(somethign) { thats how. with all the looping how you have it..I cant say how to fix it. cause you have th page wrong...If you want you could post the whole page. ill redo it for you. and you can use that. and the 2nd code i gave a minute ago and it will work fine...
  15. Re: How to make person say something else after you beat quest? your layout should be more liike this..   include "globals.php"; if($ir['crayonquest'] == 1) { die("you've already done this quest"); } if($ir['crayon'] == 0) { die("Pesky Kid: Buy me some crayons!"); } //set $win prize winings $win=rand(10,170); $loss=rand(10,276); $bama = mt_rand(1,20); if($bama == 20 ) { print "Pesky Kid: Hey, thanks! Here's some experience that I mysteriously have! *You gained $win experience!"; $do = sprintf("UPDATE users SET crayon = 0, exp = exp + %u, crayonquest =1 WHERE userid = %u",($win),($userid)); $db->query($do); } else if($bama == 19) { print "Pesky Kid: Hey, thanks! Here's some experience that I mysteriously have! *You gained $win experience!"; $do = sprintf("UPDATE users SET crayon = 0, exp = exp + %u, crayonquest =1 WHERE userid = %u",($win),($userid)); $db->query($do); } else if($bama == 18) { print "Pesky Kid: Hey, thanks! Here's some experience that I mysteriously have! *You gained $win experience!"; $do = sprintf("UPDATE users SET crayon = 0, exp = exp + %u, crayonquest =1 WHERE userid = %u",($win),($userid)); $db->query($do);   now their is some problems with that....i didn't fix...just pointing you the right direction. Cuase i'm unsure what your trying to accomplish here. Now your other page...if your on same page use POST much better.   <?php include_once("globals.php"); if(!isset($_POST['buy'])) { echo "Buy some crayons for that pesky kid, or visit him [url='crayonquest.php'][<u>here!</u>][/url] "; echo "They cost $30 each. "; echo "<form action='crayonquestbuy.php' method='post'>"; echo "<input type='hidden' name='buy' />"; echo "<input type='submit' value='Buy It' />"; echo "</form>"; } else { if($ir['money'] < 30) { echo "You don't have enough money. "; echo "[url='crayonquestbuy.php']> Back[/url]"; $h->endpage(); exit; } if($ir['crayon'] == 1) { echo "You already have a crayon. "; echo "[url='crayonquestbuy.php']> Back[/url]"; $h->endpage(); exit; } $do = sprintf("UPDATE users SET money = money - 30, crayon = 1 WHERE userid = %u",($userid)); $db->query($do); echo "You bought the crayons! Yippie! "; echo "[url='index.php']Go Home[/url] "; echo "[url='crayonquest.php']Go to the pesky kid[/url]"; } $h->endpage(); ?>
  16. Re: Help with needing more than one item Acutally no. Think about it like this. What if all items are qualified. Thne they will always have a num rows less than 2.. Don't do num rows here :-P
  17. Re: I am a bit confused lol
  18. Re: I am a bit confused mysql_query is PHP code. For sending a MySQL query to your database. $db is a Class. People use these for security and ease of use. If you really want to check this out. Search Database Classes. Not on this forum of course lol
  19. Re: always running from a fight i already told you. its NOT your attack.php You said its after you click the action after the fight. So post the code for your after fights. attackleave, attackwon, etc. Thats where the error is. Like i said quite a few post ago.
  20. Re: admins cant be feded [v2] V2 staff can NOT be fedded.....This wont work. Staff being feded. Are being taken off staff and then feded. If not...They have gone in and screwed up the codes. Stock v2 staff can Not be put into jail.
  21. Re: Help with needing more than one item I would use this no neeed to use num rows.   $get_i = sprintf("SELECT inv_qty FROM inventory WHERE inv_itemid = NUMBERHERE AND inv_userid = %u",($userid)); $i = db->query($i); $ii = $db->fetch_row($i); if($ii['inv_qty'] < 2) { print "<h2>Sorry</h2>You don't have any $%#$"; $h->endpage(); exit; }
  22. Re: admins cant be feded [v2] I'm pretty sure that Staff can NOT be fedded in v2. If they are. They are getting Taken off staff then fedded.
  23. Re: [mccode v1 + v2] Lucky Boxes in whatever cron updates your uses Days Old.   mysql_query("UPDATE users set boxes_opened = 0");
  24. Re: Funney Error lol I think its funny when people say that. What are people going to do with the IP? cuase IPs are easy to get lol. Like what I mean is what are they going to hack them lol...Doubt it lol.
  25. Re: Need a decent coder - will pay You should pay for hosting. and a domain.
×
×
  • Create New...