Jump to content
MakeWebGames

Kieran-R

Members
  • Posts

    551
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kieran-R

  1. Defintely wouldn't suggest Dave... I was waiting for him to code me a template once, he said he was busy, and continued to say it would get done next week... After over 1 and 1/2 month waiting, I asked for refund... I suggest you contact W3 Theory - Peter. He does sown quality cut/slicing/coding at a very cheap price. Never had any experiences with Dayo though. Mabe you should also try Haunted Dawg? I'm sure he had a thread on here once about cutting/HTML for $20?
  2. Hey. Ive set up timestamps on my game, but ive come accross a small problem which im not to sure now to fix. WHen a user loads the page, and noone has loaded the page in ages, it wil only update once. Whereas it should be updating however many times the update has ben missed. For example, I have a 5 minutes timestamp. No one loads the page for 30 minutes. then someone does load the page, it only updates once instead of updating 6 times. He is my code for 5 minutes:   // 5 MINUTE TIME STAMPS!!!!!! $updates_sql = $db->query("SELECT * FROM `updates` WHERE `name` = 'fivemin'"); while ($line = mysql_fetch_array($updates_sql)) { $update = $line['lastdone']; } $timesinceupdate = time() - $update; if ($timesinceupdate>=300) { $num_updates = floor($timesinceupdate / 300); *** MYSQL QUERY'S HERE $thetime = time(); $result2 = $db->query("UPDATE `updates` SET `lastdone` = '".$thetime."' WHERE `name` = 'fivemin'"); $leftovertime = $timesinceupdate - (floor($timesinceupdate / 300) * 300); if ($leftovertime>0) { $newupdate = time() - $leftovertime; $setleftovertime = $db->query("UPDATE `updates` SET `lastdone` = '".$newupdate."' WHERE `name` = 'fivemin'"); } // 5 MINUTE TIME STAPS DONE!!!!   ^^ thats not the full file, but all the timestamps parts. If someone could help me then I would greatly appreciate it!
  3. if you really want a "dedicated" manager, you should definitely look into giving them a % of revenue. Then the person will be determined to add new updates ect...   Good luck with your search though! :D
  4. Read the error. Its tells you exactly what someone in this forum is going to tell you. "Table 'announcements' already exists" delete that table, and any other table on your DB, and restart the installation.
  5.   Thanks for that Curt. thats defintally gave me an idea.
  6. You dont get the point that im trying to tell you danny. Players that play your game arnt going to be abel to see your code. So why does it really matter what your code is lke... You could make the mod I have posted as clean as you want. But it aint gona change what what the player in the game see's. Now lets get back on topic now... Is there any bugs/errors in the mod that would need fixed? or is everything good?
  7. As a player in a game? no.
  8. I replaced it. But what really matters? the user experience? Or your experience looking over the code? Not as if users in your game are going to be asking to view your codes to make sure it has $db-> instead of mysql_ are they?
  9. Ok thanks for pointing those points out! Ive updated the original post with a more consistent code ;) It still looks a bit messy, as I don't use tab spaces... (not really sure where to put tab spaces tbh lol)
  10. what difference does it make? Its just the way I do it. Also, whats "('ima n00b')" all about?
  11. Nope lol. I dont get you. Can you explain to me a little more? Give me an example of whats not quite right?
  12. Well I seen quite a few lottery mods on this site, but not one of them was bugles, and lacked some easy to implement features. So I decided to make my own, and post it for free so everyone can use it This is a money, and crystals/points lottery. (Please note, they are called points in my game, but it can be easily changed!) SQLS: [mysql]CREATE TABLE IF NOT EXISTS `moneylotto` ( `ticketid` int(11) NOT NULL auto_increment, `userid` int(11) NOT NULL, PRIMARY KEY (`ticketid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `pointslotto` ( `ticketid` int(11) NOT NULL auto_increment, `userid` int(11) NOT NULL, PRIMARY KEY (`ticketid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `moneylottowinners` ( `id` int(11) NOT NULL auto_increment, `winner` int(11) NOT NULL, `amount` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `pointslottowinners` ( `id` int(11) NOT NULL auto_increment, `winner` int(11) NOT NULL, `amount` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; [/mysql] lotterycron.php <?php // Created, and released for free for the MWG (makewebgames.io) community by Kieran-R include "config.php"; include "global_func.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; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } //Money Lotto $ticketssold=$db->num_rows($db->query("SELECT * FROM moneylotto")); $payout=($ticketssold*50000)*0.90; $rand=rand(1,$ticketssold); $win=$db->query("SELECT * FROM moneylotto where ticketid=$rand"); $winner=$db->fetch_array($win); event_add($winner['userid'],"Congratulations! You have won the weekly lottery, and claimed your ".money_formatter($payout)." reward!",$c); $db->query("UPDATE users SET bankmoney=bankmoney+$payout WHERE userid={$winner['userid']}"); $db->query("TRUNCATE TABLE moneylotto"); $db->query("INSERT INTO moneylottowinners (id, winner, amount) VALUES ('', '{$winner['userid']}', '$payout')"); //Money Lotto End //Points Lotto $ticketssold=$db->num_rows($db->query("SELECT * FROM pointslotto")); $payout=($ticketssold*50)*0.90; $rand=rand(1,$ticketssold); $win=$db->query("SELECT * FROM pointslotto where ticketid=$rand"); $winner=$db->fetch_array($win); event_add($winner['userid'],"Congratulations! You have won the weekly points lottery, and claimed your $payout points reward!",$c); $db->query("UPDATE users SET crystals=crystals+$payout WHERE userid={$winner['userid']}"); $db->query("TRUNCATE TABLE pointslotto"); $db->query("INSERT INTO pointslottowinners (id, winner, amount) VALUES ('', '{$winner['userid']}', '$payout')"); //Points Lotto End ?>   lottery.php <?php // Created, and released for free for the MWG (makewebgames.io) community by Kieran-R include "globals.php"; $ticketssold=$db->num_rows($db->query("SELECT * FROM moneylotto")); $mytickets=$db->num_rows($db->query("SELECT * FROM moneylotto WHERE userid=$userid")); $jackpot=($ticketssold*50000)*0.90; echo" <h2>Weekly Lottery</h2> Welcome to the weekly money lottery! Buy your lottery ticket for this week and be in with a chance of winning the jackpot! You can purchase as many lottery tickets as you wish for $50,000 per ticket: [b]Total Tickets Sold:[/b] $ticketssold [b]Your Tickets:[/b] $mytickets [b]Current Jackpot:[/b] ".money_formatter($jackpot)." [b]Payout Time:[/b] Friday 9:00PM "; if ($_POST['tickets']){ if ($ir['money'] < 50000){ echo " Sorry. You need [b]$50,000[/b] or more to buy a lottery ticket!"; } else { $db->query("UPDATE users SET money=money-50000 WHERE userid=$userid"); $db->query("INSERT INTO moneylotto (ticketid, userid) VALUES ('', '$userid')"); echo " Congratulations on purchasing a lottery ticket for this weeks lottery!"; } } echo" <form method='POST' action=lottery> <input type='hidden' name='tickets' value=1 length=2 /> <input type='submit' value='Buy Lottery Ticket'> "; //Previous Winners $prewinners=$db->query("SELECT * FROM moneylottowinners ORDER BY id DESC LIMIT 10"); echo" <h3>Previous Winners</h3> <table width=65% cellspacing=1 class='table' border='1'><tr><th>Winner</th><th>Amount</th></tr>"; while($r=$db->fetch_row($prewinners)) { $user=$db->fetch_array($db->query("SELECT username FROM users WHERE userid={$r['winner']}")); echo"<tr><td><a href=viewuser.php?u={$r['winner']}>{$user['username']}</td><td>[b]".money_formatter($r['amount'])."[/b]</td></tr>"; } echo"</table>"; //Previous Winners Done $h->endpage(); ?>   pointslottery.php <?php // Created, and released for free for the MWG (makewebgames.io) community by Kieran-R include "globals.php"; $ticketssold=$db->num_rows($db->query("SELECT * FROM pointslotto")); $mytickets=$db->num_rows($db->query("SELECT * FROM pointslotto WHERE userid=$userid")); $jackpot=($ticketssold*50)*0.90; echo" <h2>Weekly Points Lottery</h2> Welcome to the weekly points lottery! Buy your lottery ticket for this week and be in with a chance of winning the jackpot! You can purchase as many points lottery tickets as you wish at 50 points per ticket: [b]Total Tickets Sold:[/b] $ticketssold [b]Your Tickets:[/b] $mytickets [b]Current Jackpot:[/b] $jackpot Points [b]Payout Time:[/b] Friday 9:00PM "; if ($_POST['tickets']){ if ($ir['crystals'] < 50){ echo " Sorry. You need [b]50 Points[/b] or more to buy a points lottery ticket!"; } else { $db->query("UPDATE users SET crystals=crystals-50 WHERE userid=$userid"); $db->query("INSERT INTO pointslotto (ticketid, userid) VALUES ('', '$userid')"); echo " Congratulations on purchasing a points lottery ticket for this weeks lottery!"; } } echo" <form method='POST' action=pointslottery> <input type='hidden' name='tickets' value=1 /> <input type='submit' value='Buy Lottery Ticket'> "; //Previous Winners $prewinners=$db->query("SELECT * FROM pointslottowinners ORDER BY id DESC LIMIT 10"); echo" <h3>Previous Winners</h3> <table width=65% cellspacing=1 class='table' border='1'><tr><th>Winner</th><th>Amount</th></tr>"; while($r=$db->fetch_row($prewinners)) { $user=$db->fetch_array($db->query("SELECT username FROM users WHERE userid={$r['winner']}")); echo"<tr><td><a href=viewuser.php?u={$r['winner']}>{$user['username']}</td><td>[b]{$r['amount']} Points[/b]</td></tr>"; } echo"</table>"; //Previous Winners Done $h->endpage(); ?>   Make lotterycron.php to run every week at 9PM, link lotter.php, and pointslottery.php and your done! Any bugs, feel free to post and ill do my best to fix them up.
  13. Ahh. I found the error. Its because in teh MySQL query, i put a string on its own instead of surrounding it with ' '
  14. echo "Welcome Back ".username_formatter($ir['username'])."!";
  15. Hmm Im getting an error from: $FETCH=mysql_fetch_array($USER); Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource Cant seem to se why that would be erroring though...
  16. Hello Well I was trying to make a function where it would make the URL, staff colours, and donator image appear. Although ive ran into a problem. Ive never really attempted to work with functions before, but this is what I came up with: function username_formatter($username) { $USER=mysql_query("SELECT * FROM users WHERE username=$username"); $FETCH=mysql_fetch_array($USER); if($FETCH['donatordays']&&$FETCH['user_level']==1) { $FETCH['username'] = "<font color=white>[b]{$FETCH['username']}[/b]</font>";$d="[img=donator.gif]"; } if($FETCH['user_level']==2) { $FETCH['username'] = "<font color=red>[b]{$FETCH['username']}[/b]</font>";$d="[img=donator.gif]"; } if($FETCH['user_level']==5) { $FETCH['username'] = "<font color=#00FF00>[b]{$FETCH['username']}[/b]</font>";$d="[img=donator.gif]"; } if($FETCH['gang']>0){ $gang=mysql_query("SELECT * FROM gangs WHERE gangID={$FETCH['gang']}"); $gn=mysql_fetch_array($gang); $gangtag="[url='gangs.php?action=gang_view&gang_id={$FETCH['][{$gn['gangPREF']}][/url]"; } else { $gangtag=""; } $user="$gangtag <a href=viewuser?u={$FETCH['userid']} />{$FETCH['username']}</a> $d"; return $user; }   to use this function, I would do: username_formatter(***USERNAME***). But it just displays nothing. Yes. I am printing it correctly lol If someone could assist me then it would be much appreciated!
  17. you havent even got an images folder. So how have you got the images uploaded?
  18. You still have to email him though. No instant download.
  19. I Bought his texas hold em mod about 2 weeks ago. So yea he's still around. Just not on MWG. You can email him here: [email protected]
  20. Nice mod :) But im having problems with it inserting into the DB after one user has already bought drug materials. The first user, yes it works. But the 2nd it doesnt... I dont see where this error could be coming from as ive looked at the mysql query...
  21. Thanks for all the links guys!
  22. That helped alot! Thanks. :D
  23. Since when do I live in Manchester? lol
  24. Check that $worked['vault']; does not = 0, or no number at all. If so, theres your problem.
  25. Hey. Im looking for voting sites that have voting incentive's available for use? Ive currently found: apexwebgaming.com, and toprpgames.com Any other site URL's would be great!
×
×
  • Create New...