Jump to content
MakeWebGames

chris3010

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Everything posted by chris3010

  1. Broke The cron doesnt run. When you copy and paste the cron link in to the browser then it just redirects me to my game.
  2. Re: [mccode v2] Lottery Ok heres my cron_weekly.php <?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; include("./global_func.php"); $sql = $db->query("SELECT * FROM `lottery`"); $rows = $db->num_rows($sql); $row = $db->fetch_row($sql); $winner = rand(1,$rows); $winnerq = sprintf("SELECT `userid` FROM `lottery` WHERE `id` = %d", $winner); $winnerq1 = $db->query($winnerq); $user = $db->fetch_row($winnerq1); $credit = sprintf("UPDATE `users` SET `money` = `money` + %d WHERE `userid` = (%u)", $row['jackpot'], $user['userid']); event_add($user['userid'],"You won the weekly lottery and were credited £{$row['jackpot']}",$c); $db->query("INSERT INTO announcements VALUES('User ID {$user['userid']} won the weekly lottery. Well done!', unix_timestamp())"); $db->query("UPDATE users SET new_announcements=new_announcements+1"); $db->query($credit); $db->query("UPDATE `users` SET `lottery` = 0"); $db->query("TRUNCATE TABLE `lottery`"); } ?>
  3. Re: [mccode v2] Lottery Does anyone know how to make the money get paid to the winner? Mine doesn't work. This is my lottery.php: <?php include "globals.php"; switch($_GET['action']) { case 'buysub': buy_sub(); break; default: index(); break; } function index() { global $db,$ir,$userid; $cost = 1000; $tick = 100; $sql = sprintf("SELECT * FROM `lottery`"); $query = $db->query($sql); $row = $db->fetch_row($query); echo sprintf(" <font color = 'yellow' size = '4' /><b /> Welcome to the Nation Jackpot. You currently have %d tickets and are able to purchase up to %d tickets per week. Each ticket costs ?%d. The jackpot is ?%u.", $ir['lottery'], $tick, $cost, $row['jackpot']); echo " <form action = 'lottery.php?action=buysub' method = 'post' /> <input type = 'text' name = 'buysub' value = '1' /> <input type = 'submit' value = 'Buy Tickets' /> </form>"; } function buy_sub() { global $db,$ir,$userid; $_POST['buysub'] = abs((int) $_POST['buysub']); $cost = 1000; $price = $cost * $_POST['buysub']; if($_POST['buysub'] > 100) { die("You can't buy more than 100 lottery tickets. <a href = 'index.php' />Go Home</a>"); } if($ir['lottery'] >= 100) { die("You have already purchased 100 tickets this week. <a href = 'index.php' />Go Home</a>"); } if($_POST['buysub'] + $ir['lottery'] > 100) { die("You can't buy this many tickets because you would exceed the maximum amount of allowed tickets. <a href = 'index.php' />Go Home</a>"); } if($ir['money'] < $price) { die("You don't have enough money to buy {$_POST['buysub']} tickets. <a href = 'index.php' />Go Home</a>"); } else { print "You have bought {$_POST['buysub']} lottery tickets. <a href = 'lottery.php' />Go Back</a>"; $sql = sprintf("UPDATE `users` SET `lottery` = `lottery` + '%d', `money` = `money` - '%d' WHERE `userid` = ('%u')", $_POST['buysub'], $price, $userid); $db->query($sql); $sql1 = sprintf("INSERT INTO `lottery` (id,userid, amount) VALUES (%d,%u, %d)", '',$userid, $price); $db->query($sql1); $sql2 = sprintf("UPDATE `lottery` SET `jackpot` = `jackpot` + '%d'", $price); $db->query($sql2); } } $h->endpage(); ?>
  4. Re: Rating Modification Help ...   ALTER TABLE `users` ADD `rating` INT( 25 ) NOT NULL , ADD `max_rating` INT( 25 ) NOT NULL ;   run this SQL
  5. Re: Rating Modification Help ...   include "globals.php"; if ($ir['max_rating']>=1) { echo "Only 1 rating per day"; echo " <a href=viewuser.php?u={$_GET['user']}>Back</a>"; exit; $h->endpage(); } $evenuser=$_GET['user']; if ($evenuser==$userid) { echo "Your not allowed to rate yourself"; echo " <a href=viewuser.php?u={$_GET['user']}>Back</a>"; exit; $h->endpage(); } $rr=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid={$_GET['user']}",$c) or die(mysql_error()); $rrr=mysql_fetch_array($rr); $rate=$_GET['rate']; echo "You gave {$rrr['username']} "; if ($rate==plus) { echo "+1 Rating"; global $ir,$c,$h,$userid; $evenuser=$_GET['user']; $rate=$_GET['rate']; mysql_query("UPDATE users SET rating=rating+1 WHERE userid=$evenuser", $c); mysql_query("UPDATE users SET max_rating=max_rating+1 WHERE userid=$userid", $c); $evenuser=$_GET['user']; event_add($evenuser, "<a href=viewuser.php?u={$ir['userid']}>{$ir['username']}</a> gave you $rate 1 Rating!", $c); echo " <a href=viewuser.php?u={$_GET['user']}>Back</a>"; exit; } if ($rate==minus) { echo "-1 Rating"; global $ir,$c,$h,$userid; $evenuser=$_GET['user']; $rate=$_GET['rate']; mysql_query("UPDATE users SET rating=rating-1 WHERE userid=$evenuser", $c); mysql_query("UPDATE users SET max_rating=max_rating+1 WHERE userid=$userid", $c); $evenuser=$_GET['user']; event_add($evenuser, "<a href=viewuser.php?u={$ir['userid']}>{$ir['username']}</a> gave you $rate 1 Rating!", $c); echo " <a href=viewuser.php?u={$_GET['user']}>Back</a>"; exit; } $h->endpage(); ?>   try this. How do i put it in a box?
  6. Re: Item market error ok sorry
  7. Re: [mccode v1] bug report mod Sorry problem fixed
  8. Warning: Missing argument 1 for item_remove(), called in /home/urbanwar/public_html/itemmarket.php on line 19 and defined in /home/urbanwar/public_html/global_func.php on line 339 Warning: Missing argument 2 for item_remove(), called in /home/urbanwar/public_html/itemmarket.php on line 19 and defined in /home/urbanwar/public_html/global_func.php on line 339 Warning: Missing argument 3 for item_remove(), called in /home/urbanwar/public_html/itemmarket.php on line 19 and defined in /home/urbanwar/public_html/global_func.php on line 339 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 'AND inv_itemid=' at line 1 Query was SELECT * FROM inventory WHERE inv_userid= AND inv_itemid=   i get this error when i try to reove an item from the market. Please help
  9. My game is V2 and i live in england. I wanted to have english time on my game and have got it. But dont know how to change it because we had to add an hour on last week for the summer. If anyone knows how to chane it please help.
  10. Re: [mccode v1] bug report mod Thanks
  11. Re: [mccode v1] bug report mod Could anyone code this to V2?
  12. Re: [mccode v2] Fishing Mod What was the point in this all you have to do is change it through your SQL or that is what i did.
  13. Re: [mccode v2] Display Cabinet Yeah i get nearly the same error. QUERY ERROR: Table 'urbanwar_urban.display' doesn't exist Query was SELECT * FROM display WHERE disp_userid=1 i have run the mysql a few times changed it a bit but still doesnt allow me to add the sql. Help please.
  14. Re: item market cap How do you cap an item so someone can only take a certain amount of it in an hour?
  15. Re: [mccode] Profile Signatures Who said i was using bbcode?
  16. Re: [mccode] Profile Signatures I used Joel's v2 profile sig mod but i get this error when i go into preferences and then click on profile signature. Fatal error: Call to undefined function signature_change() in /home/urbanwar/public_html/preferences.php on line 43
×
×
  • Create New...