Jump to content
MakeWebGames

Newbie

Members
  • Posts

    289
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Newbie

  1. was about to say cronus has his own forum http://mccodemods.com/ but seems its going to be under new ownership i dunno im sure it could work with a few tweaks
  2. would anyone be intrested in using this still if i re worked it and released some updates for it?
  3. mtg had something like this pretty nice addition good job and thanks :)
  4. no problem :) someone would of noticed it eventually ;) rest of code looks good bit to many echo statements for me but hey everyone does it there own way thanks for the free modification don't get to much free stuff lately.
  5. a custom page for referring people to the game which would show who they referred and could include stuff like if they active or not there level etc stuff like that just a idea :P
  6. line 58 you have a small typo exiit but looks good :)
  7. hi there you seem to have missed a index.php file
  8. well from what i have been told you sold death the license but said to him that you did not know the the info for the site therefor the license being useless to him. you gave him the game? mccodes is not yours to give away i would think that was a breach of license? and for you doing him a favor how can you selling him a fake license for money be doing him a favor if he chooses to use mccodes that is up to him i suppose the only thing we can do is wait for death to supply logs/proof
  9. it should not matter that he is not using mccodes anymore for wisecrime.com when ever you and death made the arrangement you sold him your license to run a mccodes game you should not be able to come back and sell it again. edit: by all rights you should of handed over the info when purchase between use two were made.
  10. yep very nice as usual
  11. wisecrime.com is owned by Death from what i have been told
  12. login is pretty nice will check inside later when got a spare minute or two
  13. ps4 with watchdogs and other stuff is only £380 out of Argos now still cheaper than xbox one
  14. nice template $50
  15. i had the same errors for v2.05b remove the html code before the php code add the css into your css file and add the sqls and images then add your file
  16. i get this when i use your viewuser.php Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/mafiaco2/public_html/viewuser.php:25) in /home/mafiaco2/public_html/globals.php on line 28 it appears to be showing up because of the html in the code before the php i removed the html part and it worked [ATTACH=CONFIG]1378[/ATTACH]
  17. yep seems good for the price will have to bookmark this thanks
  18. So i got bored and wanted to have a go at doing a lottery module i think it turned out all right in the end Lets start with the SQL files   CREATE TABLE IF NOT EXISTS `lottery` ( `lotofund` int(30) NOT NULL DEFAULT '0', `tickets` int(30) NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; INSERT INTO `lottery` (`lotofund`, `tickets`) VALUES (0, 0); CREATE TABLE IF NOT EXISTS `lottery_players` ( `user` int(30) NOT NULL DEFAULT '0', `tickets` int(10) NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; CREATE TABLE IF NOT EXISTS `lotowinners` ( `user` int(20) NOT NULL DEFAULT '0', `amountwon` int(50) NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; CREATE TABLE IF NOT EXISTS `lottery_config` ( `ticketprice` int(30) NOT NULL DEFAULT '0', `maxtickets` int(30) NOT NULL DEFAULT '0', `pagedisable` enum('Yes','No') NOT NULL DEFAULT 'No' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `lottery_config` (`ticketprice`, `maxtickets`, `pagedisable`) VALUES (1000, 10, 'No'); ALTER TABLE `grpgusers` ADD `tickets` INT(30) NOT NULL DEFAULT 0;   open up classes.php and add this to the user class $this->tickets = $worked['tickets'];   You can add this to your style sheet if you have one if not add it into the header.php .infobox { background: #101010; width: 200px; height: auto; border: 1px solid gray; border-radius: 5px; padding: 10px; float: left; text-align: center; } .otherbox { background: #101010; width: 400px; height: auto; border: 1px solid gray; border-radius: 5px; padding: 4px; float: right; text-align: center; } .buysection,.infobox { margin-top: 5px; } .btn { background: #585858; width: auto; height: auto; border: 1px solid black; border-radius: 3px; } .input { background: #202020; color: #FFFFFF; border: 1px solid black; padding: 1px; }   Ok now time for the files. lottery.php <?php include(__DIR__.'/header.php'); $res = mysql_query("SELECT * FROM `lottery`"); $row = mysql_fetch_array($res); $checkp = mysql_query("SELECT * FROM `lottery_players` WHERE `user` = ".$user_class->id); $num = mysql_num_rows($checkp); $checkt = mysql_fetch_array($checkp); $config = mysql_query("SELECT * FROM `lottery_config`"); $worked = mysql_fetch_array($config); if($worked['pagedisable'] == 'Yes') { echo Message('Admin has disabled the Lottery Page.'); include_once(__DIR__.'/footer.php'); exit; } $_POST['amount'] = isset($_POST['amount']) && ctype_digit($_POST['amount']) ? abs(intval($_POST['amount'])) : null; if(array_key_exists('buy', $_POST)) { if(empty($_POST['amount'])) { echo Message("You didn't enter a valid amount"); include(__DIR__ . '/footer.php'); exit; } $cost = $worked['ticketprice'] * $_POST['amount']; $usercash = $user_class->money - $cost; $tickets = $user_class->tickets + $_POST['amount']; $loto = $row['lotofund'] + $cost; $ltick = $row['tickets'] + $_POST['amount']; $deficit = $worked['maxtickets'] - $user_class->tickets; $havetick = $checkt['tickets'] + $_POST['amount']; if($tickets > $worked['maxtickets']) { echo Message('The max tickets is '.number_format($worked['maxtickets']).'. This means you can only buy '.number_format($worked['maxtickets'] - $user_class->tickets).' more ticket'.($deficit == 1 ? '' : 's')); include_once(__DIR__.'/footer.php'); exit; } if($_POST['amount'] > $worked['maxtickets']) { echo Message('You can only purchase '.number_format($worked['maxtickets'])); include_once(__DIR__.'/footer.php'); exit; } if($user_class->money < $worked['ticketprice']) { echo Message('You cant afford '.number_format($_POST['amount']).' tickets. It costs $'.number_format($worked['ticketprice'] * $_POST['amount'])); include_once(__DIR__.'/footer.php'); exit; } if($user_class->tickets > $worked['maxtickets']) { echo Message('You have already purchased max tickets which is '.number_format($worked['maxtickets'])); include_once(__DIR__.'/footer.php'); exit; } if($user_class->money >= $worked['ticketprice'] && $_POST['amount'] <= $worked['maxtickets']) { if($num) { echo Message('You have purchase '.$_POST['amount'].' lottery tickets for $'.number_format($cost)); mysql_query("UPDATE `grpgusers` SET `money` = ".$usercash.", `tickets` = ".$tickets." WHERE `id` = ".$user_class->id); mysql_query("UPDATE `lottery` SET `lotofund` = ".$loto.", `tickets` = ".$ltick); mysql_query("UPDATE `lottery_players` SET `tickets` = ".$havetick." WHERE `user` = ".$user_class->id); } else { echo Message('You have purchase '.$_POST['amount'].' lottery tickets for $'.number_format($cost)); mysql_query("UPDATE `grpgusers` SET `money` = ".$usercash.", `tickets` = ".$tickets." WHERE `id` = ".$user_class->id); mysql_query("UPDATE `lottery` SET `lotofund` = ".$loto.", `tickets` = ".$ltick); mysql_query("INSERT INTO `lottery_players` VALUES('$user_class->id',".$_POST['amount'].")"); } } } ?> <tr><td class="contenthead">Lottery</td></tr> <tr><td class="contentcontent"> <div class="infobox"> <span>Welcome to the lottery</span> <span>Each ticket costs $<?php echo number_format($worked['ticketprice']); ?></span> <span>Maximum of <?php echo number_format($worked['maxtickets']); ?> tickets per person</span> </div> <div class="otherbox"> <span>Lottery Fund: $<?php echo number_format($row['lotofund']); ?></span> <span>Tickets Purchased: <?php echo number_format($row['tickets']); ?></span> </div> </td></tr> <tr><td class="contentcontent"> <div class="buysection"> <form method="post"> [buy Tickets] <input type="text" name="amount" value="1" maxlength="2" /> <input type="submit" name="buy" value="Buy Ticket" /> </form> </div> </td></tr> <tr><td class="contenthead">Previous Winners</td></tr> <tr><td class="contentcontent"> <?php $win = mysql_query("SELECT * FROM `lotowinners`"); $check = mysql_num_rows($win); while($row = mysql_fetch_array($win)) { $user = new User($row['user']); if($check == 0) { echo "<div class='infobox'><span>There has been no previous Winners</span></div>"; } else { echo " <table class='infobox'> <tr> <td>".$user->formattedname." - $".number_format($row['amountwon'])."</td> </tr>"; } echo "</table>"; } ?> </td></tr>   lottery_config.php <?php include(__DIR__.'/header.php'); $allowed = array(1,2); if($user_class->id != in_array(1,$allowed)) { echo Message('You are not allowed here.'); include_once(__DIR__.'/footer.php'); exit; } $res = mysql_query("SELECT * FROM `lottery_config"); $row = mysql_fetch_array($res); if(isset($_POST['disable'])) { if($row['pagedisable'] == 'No') { echo Message('You have disabled the lottery page'); mysql_query("UPDATE `lottery_config` SET `pagedisable` = 'Yes' WHERE `pagedisable` = 'No'"); } else if($row['pagedisable'] == 'Yes') { echo Message('You have enabled the lottery page.'); mysql_query("UPDATE `lottery_config` SET `pagedisable` = 'No' WHERE `pagedisable` = 'Yes'"); } } $_POST['price'] = isset($_POST['price']) && ctype_digit($_POST['price']) ? abs(intval($_POST['price'])) : null; if(isset($_POST['setprice'])) { if(empty($_POST['price'])) { echo Message('Invalid Price'); include_once(__DIR__.'/footer.php'); exit; } if(!is_numeric($_POST['price'])) { echo Message('Price must be a number.'); include_once(__DIR__.'/footer.php'); exit; } if($_POST['price'] == $row['ticketprice']) { echo Message('It is already set to that nothing has changed.'); include_once(__DIR__.'/footer.php'); } if($_POST['price'] != $row['ticketprice']) { echo Message('You have updated the price to $'.number_format($_POST['price'])); mysql_query("UPDATE `lottery_config` SET `ticketprice` = ".$_POST['price']); } } $_POST['tickets'] = isset($_POST['tickets']) && ctype_digit($_POST['tickets']) ? abs(intval($_POST['tickets'])) : null; if(isset($_POST['settickets'])) { if(empty($_POST['tickets'])) { echo Message('Invalid Price'); include_once(__DIR__.'/footer.php'); exit; } if(!is_numeric($_POST['tickets'])) { echo Message('Tickets must be a number.'); include_once(__DIR__.'/footer.php'); exit; } if($_POST['ticketprice'] == $_POST['tickets']) { echo Message('It is already set to this so nothing has changed.'); include_once(__DIR__.'/footer.php'); } if($_POST['tickets'] != $row['maxtickets']) { echo Message('You have updated the max tickets to '.number_format($_POST['tickets'])); mysql_query("UPDATE `lottery_config` SET `maxtickets` = ".$_POST['tickets']); } } ?> <tr><td class="contenthead">Lottery Panel</td></tr> <tr><td class="contentcontent"> <table width="100%" style="background: #101010" cellpadding="5"> <tr> <td> <span>Disable/Enable Lottery Page<span> <form method="post"> <?php if($row['pagedisable'] == 'No') { echo ' <input type="submit" name="disable" class="btn" value="Disable Page" />'; } if($row['pagedisable'] == 'Yes') { echo ' <input type="submit" name="disable" class="btn" value="Enable Page" />'; } ?> </form> </td> </tr> <tr> <td> <hr> <i>Set Ticket Price</i> <form method="post"> Price: <input type="text" name="price" value="0" class="input" /> <input type="submit" name="setprice" class="btn" value="Set Ticket Price" /> </form> </td> </tr> <tr> <td> <hr> <i>Set Max Tickets per person</i> <form method="post"> Max Tickets: <input type="text" name="tickets" value="0" class="input" /> <input type="submit" name="settickets" class="btn" value="Set Max Tickets" /> </form> </td> </tr> </table> </td></tr>   lot_cron.php <?php include('dbcon.php'); include('classes.php'); if(isset($_GET['code']) != 'Your code here') { echo "<span style='color:red'><h2>Error</h2></span>"; exit; } else { $res = mysql_query("SELECT * FROM `lottery_players` ORDER BY RAND() LIMIT 1"); $checkwinner = mysql_num_rows($res); while($row = mysql_fetch_array($res)) { if($checkwinner == 0) { } else { $winner = new User($row['user']); $check = mysql_query("SELECT * FROM `lottery`"); $worked = mysql_fetch_array($check); Send_Event($winner->id, "Congrats you have won the lottery your prize is $".number_format($worked['lotofund'])); mysql_query("UPDATE `grpgusers` SET `money` = `money` + {$worked['lotofund']} WHERE `id` = ".$winner->id); mysql_query("UPDATE `lottery` SET `lotofund` = '0',`tickets` = '0'"); mysql_query("UPDATE `grpgusers` SET `tickets` = '0' WHERE `tickets` > '0'"); mysql_query("INSERT INTO `lotowinners` VALUES('$winner->id',".$worked['lotofund'].")"); mysql_query("TRUNCATE TABLE `lottery_players`"); } } } ?>   ok some screenshots [ATTACH=CONFIG]1372[/ATTACH][ATTACH=CONFIG]1373[/ATTACH][ATTACH=CONFIG]1374[/ATTACH]
  19. As sniko said take your time and learn the lingo first then try playing around with the game code (while game is offline) until you understand what does what making a game should never be a quick option quite a lot of new developers just rump right in the deep end without knowing what does what. Anyways good luck with your learning and hope it all goes well for you.
  20. Freedom Fighters War Generals The Forgotten Heroes that's all i can think of right now :P
  21. i use Aptana Studio 3 its free and pretty nice editor also i have just found this site the other day and i found it pretty useful to me so might be to you http://learnlayout.com/
  22. Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 in /home/a3544250/public_html/includes/db_connect.php on line 11 Free Web Hosting ERROR: Please make sure you update the file /includes/db_connect.php with the correct MySQL database information.
  23. post up the error and the line of code from the error
  24. i have used rc before its a good engine but to me its coded weird but its good engine
  25. yes this is rc engine good luck with sales
×
×
  • Create New...