Jump to content
MakeWebGames

NonStopCoding

Members
  • Posts

    572
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by NonStopCoding

  1. i just meant me in general i believe the price is to high for me but everyone has there own opinions and prices
  2. i noticed this aswell i was planning on trying to fix it up but been busy
  3. i think the price is to high too 20 gbp per sale but looking nice project price / expected amount of sales = sale price i use this to work out a rough price for my modules
  4. so he does never mind then :D but if you do it on pc remember to tab ;)
  5. iv used it for ages and never had any issues at all
  6. I mix my editors up but there for windows your sony runs off android i have same phone accept a lower version mine is the Sony Xperia L the apps for php editors are pretty crap for android i must admit Aptana Studio 3 The world’s most powerful open-source web development IDE just got better. Rebuilt from the ground-up. It's now much faster, customizable and includes new features to help you be more productive. Learn more. download http://www.aptana.com/products/studio3/download.html I also use notepad ++ (i only use this for mysql coding as aptana don't handle it but if you have both installed and create a file with the db extention it opens notepad++ for you )
  7. you could tab the code a little so its easier to read for people also you have some extra </tr>   <?php include_once "globals.php"; print "<h3>Your Home Brewery</h3 <p>You are sitting in your shed.</br>What would you like to brew?</p></br> <table width='55%' border='0' cellspacing='1' cellpadding='3' class='table' style='text-align:center;'> <tr> <th colspan='3'>Brewery Options</th> </tr> <tr> <td>Beer</td> <td><a href='brewery.php?action=beer'>Brew</a></td> </tr> <tr> <td>Whiskey</td> <td><a href='brewery.php?action=whiskey'>Brew</a></td> </tr> <tr> <td>Cider</td> <td><a href='brewery.php?action=cider'>Brew</a></td> </tr> <tr> <td>Vodka</td> <td><a href='brewery.php?action=vodka'>Brew</a></td> </tr> </table><hr width=85%>"; print "This module is a working progress.Should be up and running in a few weeks."; ?>
  8. meh i dunno then stupid ravens
  9. edit - - - Updated - - -   Only thing i can think of that would throw the code off is if you dont have the event_add function check the include "config.php"; make sure that it has the global_funcs.php file included in it if not i guess this could be your problem if so heres your fixe choices 1. Add this code into your config file some place   include('global_funcs.php');   2. copy the code below into your cron file function event_add($userid, $text, $connection = 0) { global $db; $text = $db->escape($text); $db->query( "INSERT INTO `events` VALUES(NULL, $userid, " . time() . ", 0, '$text')"); $db->query( "UPDATE `users` SET `new_events` = `new_events` + 1 WHERE `userid` = {$userid}"); return 1; }   There is slim chance that this event_add function might be dfiffrent from yours but if so open up your global funcs file and find the function and copy it into the module 3. try add this to your cron   include_once('global_funcs.php');   Edit: Also without the money_formatter() function the code will fail
  10. Thanks jc iv updated op and lowered the int just noticed it was at 30 no need for that high lol
  11. http://makewebgames.io/showthread.php/46077-Lottery-Mod
  12. This module is not completed yet but its nearly there so ill post up the code Module Info Module Name: Lottery System Module Version: v1.00 Module Creator: NonStopCoding This module will allow users to be able to buy a lottery ticket or tickets depending on what you the game owner set max tickets to be for the demo purposes i only used 10. The more tickets you buy the better of a chance (kinda its still pretty much random) you have at winning Staff members with user level of 2 can update the ticket price and set max tickets user can buy Secured the code the best i can (please do post if you find a weak point) SQL CREATE TABLE IF NOT EXISTS `lottery_players` ( `user` int(11) NOT NULL DEFAULT '0' ) ENGINE=MyISAM; CREATE TABLE IF NOT EXISTS `lottery_config` ( `ticketprice` int(11) NOT NULL DEFAULT '0', `maxtickets` int(11) NOT NULL DEFAULT '0', `pagedisable` enum('Yes','No') NOT NULL DEFAULT 'No' ) ENGINE=MyISAM; ALTER TABLE `users` ADD `tickets` int(11) NOT NULL default '0'   open up your globals.php goto the very last line and add this code $config = $db->query("SELECT `ticketprice`,`maxtickets`,`pagedisable` FROM `lottery_config`"); $lottoconfig = $db->fetch_row($config);   save and close globals.php lottery.php - (Please Remember to remove ,$allowed from line 21) http://pastebin.com/0BRjW8an lotto_cron.php This file here i used mccodes v2.05b if you use lower version of mccodes this might not work for you if so remove this snippet of code and add your's from your cron file   <?php /* If this cron does not work then remove the next 9 lines of code from this line and add in your's from your cron */ require_once('globals_nonauth.php'); if($argc == 2) { if($argv[1] != $_CONFIG['code']) exit; } else if(!isset($_GET['code']) || $_GET['code'] !== $_CONFIG['code']) exit; $random_select = $db->query("SELECT `user` FROM `lottery_players` ORDER BY RAND() LIMIT 1"); $rs = $db->fetch_row($random_select); $lotto_config = $db->query("SELECT `ticketprice` FROM `lottery_config`"); $lc = $db->fetch_single($lotto_config); $winnings = $db->query("SELECT COUNT(`user`) FROM `lottery_players`"); $win = $db->fetch_single($winnings); $gain = $lc * $win; $db->query("UPDATE `users` SET `money` = `money` + {$gain} WHERE `userid` = {$rs['user']}"); event_add($rs['user'], "You have won ".money_formatter($gain)." on the lottery."); $db->query("TRUNCATE TABLE `lottery_players`"); $db->query("UPDATE `users` SET `tickets` = 0"); ?>   Some Screenshots [ATTACH=CONFIG]2087[/ATTACH][ATTACH=CONFIG]2088[/ATTACH][ATTACH=CONFIG]2089[/ATTACH]
  13. got it pretty much covered :) but thanks Main Lottery page - 100% Buy function - 100% Option to set max tickets and price per ticket - 0% Edit & test cron - 0% Previous Winners - 0% Then ill be able to release it i have made some changes to the module * Instead of using the insert / update tickets i have made a simple for statement and made it insert the amount of rows of the max tickets they purchase the more tickets the user buys the more of a chance he has of being selected. * Changed the database structure a little * Cleaned up some code and made it look more like a mccodes module * Optimized the code to only pull the required info
  14. Thanks mate saves me making a new topic ;)
  15. Not sure today or tomorrow if i have the time but changed things around a little [ATTACH=CONFIG]2086[/ATTACH]
  16. I am working on making it work for mccodes but some changes
  17.   if($worked['pagedisable'] == 'Yes') { echo 'Admin has disabled the Lottery Page.'; $h->endpage();; }   should be   if($worked['pagedisable'] == 'Yes') { echo 'Admin has disabled the Lottery Page.'; $h->endpage(); exit; }   but other than that looks alright from a quick scan :P Edit: edit alot of echos :D i think i'm going to re code this hehe
  18. on the subject earlier you mentioned you using ravens as you cant afford a v2 well mccodes.com offers a free version its a stripped down verion of v2 but its free and i am sure that you could transfer the db wrapper no problem at all change all mysql_ to $db-> etc Ravens will eat the hell out of the resources so unless you are using it for learning purposes and not actually making a game out of it you will need a pretty decent host to run it smoothly
  19. Hi you can't blame them from posting what they think (There have been tons of people here trying to sell others work yes i know your not selling it) you have come here for help and posting insults like that. Instead of insulting people which honestly wont get you anyplace at all for example lets say you create another mod and need assistance i don't believe very many people will help you with the way your insulting people instead of this you should provide proof that you coded it so people cant throw accusations around.
  20. ditch ravens and move to mccodes v2.05b
  21. glad to see it got fixed had no internet for days damn its been a nightmare lol
  22. here is a updated version http://privatepaste.com/beb0cbb16a code version:   <?php require(__DIR__./'sglobals.php'); echo " <div class='generalinfo_txt'> <div><img src='images/info_left.jpg' alt='' /></div> <div class='info_mid'><h2 style='padding-top:10px;'> New Business</h2></div> <div><img src='images/info_right.jpg' alt='' /></div> </div> <div class='generalinfo_simple'>"; if($ir['user_level'] > 2) die("Unauthroized Access!"); $_GET['action'] = isset($_GET['action']) && ctype_alpha($_GET['action']) ? strtolower(trim($_GET['action'])) : ''; switch($_GET['action']) { case "createbusiness": create_business_form(); break; case "createbusinesssub": create_business_sub(); break; default: print "Error this script requires an action."; break; } function create_business_form() { global $h; print " <form action='staff_business.php?action=createbusiness' method='POST'> <h3>Create a Business</h3> Name: <input type='text' name='className' /> Minimum users for business: <input type='text' name='classMembers'/> Business Description: <textarea rows=4 cols=40 name='classDesc' /></textarea> Cost to start business: <input type='text' name='classCost'/> <input type='submit' value='Create' /> </form>"; $h->endpage(); } function create_business_sub() { global $db,$ir,$h; if($ir['user_level'] > 2) die("Unauthorized Access!"); $cn = isset($_POST['className']) && ctype_alpha($_POST['className']) ? $db->escape(strip_tags(stripslashes($_POST['className']))) : ''; $cd = isset($_POST['classDesc']) && ctype_alpha($_POST['classDesc']) ? $db->escape(strip_tags(stripslashes($_POST['classDesc']))) : ''; $cm = isset($_POST['classMembers']) && ctype_digit($_POST['classMembers']) ? abs(intval($_POST['classMembers'])) : 0; $cc = isset($_POST['classCost']) && ctype_digit($_POST['classCost']) ? abs(intval($_POST['classCost'])) : 0; if(empty($cn) || empty($cd) || empty($cm) || empty($cc)) { echo "You have missed a required field."; $h->endpage(); exit; } $db->query("INSERT INTO `businesses_classes` VALUES('', '{$cn}', '{$cm}', '{$cd}', '{$cc}')"); print "The business was successfully created.<br /> <a href="staff_business.php?action=createbusiness">Back!</a>"; stafflog_add("Created the <span class="highlight">business</span>: {$_POST['className']}"); } $h->endpage();
  23. omg its getting worse
×
×
  • Create New...