Jump to content
MakeWebGames

Curt

Members
  • Posts

    525
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Curt

  1. Hello, It does keep track of the pot in the database. Also if your admin account is userid #1 then it will show you the combonation when you view the page. if not then a small edit would allow you so ;) Thanks for the comments, Curt
  2. Hello, I release simple mods for free from time to time as a way to pay back to the community that helped me when I first started. This is a simple crack the safe for points mod I made last year sometime... Basicly a player can pay x amount of points/crystals for a chance to guess the 3 digit combination to the safe. If they get the correct combination they get all the points in the safe. Once someone wins the combo resets to random numbers and they start over again :) I know its a simple mod but someone will use it ;) Cheers   cracksafepoints.php <?php /*################################################################ CRACK THE SAFE MOD - POINTS MADE BY : CURT THUGBATTLE.COM Copyright 2010 #################################################################*/ include "globals.php"; $safeprice = 1; // HOW MANY POINTS IT COST TO ATTEMPT A CRACK $showprice=$safeprice; $restartamount=25; // HOW MANY POINTS ARE IN THE POT WHEN IT RESETS echo "<h1> Crack Points Safe </h1>"; echo "<table width=100%><tr><td align=center valign=top>"; $cc=$db->query("SELECT * FROM cracksafep WHERE cracksafe_active=1 LIMIT 1"); $cs=$db->fetch_row($cc); $snum1 = $cs['cracksafe_n1']; $snum2 = $cs['cracksafe_n2']; $snum3 = $cs['cracksafe_n3']; $_POST['n1'] = abs((int) $_POST['n1']); $_POST['n2'] = abs((int) $_POST['n2']); $_POST['n3'] = abs((int) $_POST['n3']); $num1= $_POST['n1']; $num2= $_POST['n2']; $num3= $_POST['n3']; $pot = $cs['cracksafe_pot']; echo " CURRENT WORTH :<span style='color:orange'> ".number_format($pot)." Points </span> "; if ($_POST['submit']) { if ( $ir['crystals'] < $safeprice ) { echo "Each attempt to crack the Safe costs ".number_format($safeprice)." Points. You cant afford to try."; return; } $db->query("UPDATE users SET crystals=crystals-$safeprice WHERE userid = $userid"); $db->query("UPDATE cracksafep SET cracksafe_pot=cracksafe_pot+$safeprice WHERE cracksafe_active=1"); if ($num1 == $snum1 AND $num2 == $snum2 AND $num3 == $snum3) { ## IF YOU WIN $newnum1=rand(1,9); $newnum2=rand(1,9); $newnum3=rand(1,9); $db->query("UPDATE users SET crystals=crystals+{$cs['cracksafe_pot']} WHERE userid = $userid"); $db->query("UPDATE cracksafep SET cracksafe_active=0, cracksafe_winner=$userid WHERE cracksafe_active=1"); $db->query("INSERT INTO cracksafep VALUES ( '',$newnum1,$newnum2,$newnum3,$restartamount,'','',1)"); $pot=0; echo "<span style='color:orange'> The Safe Opened UP ! You walked inside grabbed the depostit and disapeared into the night...</span>"; } else { ## IF YOU LOSE if ($ir['userid'] == 1) { echo " ADMIN VIEW : "; echo " Your numbers : {$num1} and {$num2} and {$num3} and Safe Numbers : {$snum1} and {$snum2} and {$snum3} "; } $pot+=$safeprice; echo " <span style='color:red'> The Combination did not open the safe. </span>"; } } echo " "; echo " <form action='cracksafepoints.php' method='post'> <input type='text' name='n1' size='1' value='0' maxlength=1 /> - <input type='text' name='n2' size='1' value='0' maxlength=1 /> - <input type='text' size='1' name='n3' value='0' maxlength=1 /> <input type='submit' name='submit' value='Crack Safe' /></form> "; echo " For ".number_format($showprice)." Points you can have a crack at the safe ! "; echo " If you guess the correct combination you will recieve all the points in the safe, if you fail the points spent to crack the safe will be put into the safe."; echo "</td><td width=50% align=center valign=top>"; // PUT SAFE IMAGE HERE //echo "[img=images/cracksafe.jpg]"; echo "</td></tr>"; echo "</table>"; $h->endpage(); ?>   Here is the SQL:   CREATE TABLE IF NOT EXISTS `cracksafep` ( `cracksafe_id` int(11) NOT NULL AUTO_INCREMENT, `cracksafe_n1` int(11) NOT NULL, `cracksafe_n2` int(11) NOT NULL, `cracksafe_n3` int(11) NOT NULL, `cracksafe_pot` int(11) NOT NULL, `cracksafe_winner` int(11) NOT NULL, `cracksafe_when` int(11) NOT NULL, `cracksafe_active` int(11) NOT NULL, PRIMARY KEY (`cracksafe_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; INSERT INTO `cracksafep` (`cracksafe_id`, `cracksafe_n1`, `cracksafe_n2`, `cracksafe_n3`, `cracksafe_pot`, `cracksafe_winner`, `cracksafe_when`, `cracksafe_active`) VALUES (1, 1, 1, 1, 1, 0, 0, 1);
  3. Well from my experience as a Game Owner I believe admin accounts should not be competing with other players with stats/levels..or what ever..so basically admins should not play the game but instead monitor and make sure the game is running smoothly and solve any problems that arise in a timely manner. This is what i believe anyway... nice first mod :)
  4. Hey, Because your working offline i would suggest not worrying to much about getting the crons running... There is the alternative to crons which uses timestamps, search 1 minute cron removal and you will find it.. also if you rather use crons you can simply visit the link directly in the browser to run the cron... set in your header a query to keep your bars full and such for testing purposes and you should be ready to roll.... so all in all, forget about getting crons to run offline for you on your own pc...lol..use what i said and use crons if you want on your "online version".. good luck to you ;) Cheers
  5. hey, im not sure to be honest but maybe line 28 of the buyammo function might be the problem ?.. $i=mysql_insert_id($c); because the vairable you are looping is $i so maybe that might throw it off...lol good luck, looks like a nice mod ;)
  6. I used that because it selects the items from the item market so there would be duplicates...
  7. awesome contribution to the community :)
  8. Hey, you could do a row count like so :     $HOSPCNT=$db->query("SELECT userid FROM users WHERE hospital>0"); $HCNT=$db->num_rows($HOSPCNT);   You can do the same for jail :   $JAILCNT=$db->query("SELECT userid FROM users WHERE jail>0"); $JCNT=$db->num_rows($JAILCNT);   $HCNT and $JCNT will display how many people are in the hospital and jail... Hope that helps you..
  9. I think someone stole your "custom Script" ! thegangsterbliss.info
  10. here is an example how to do this:   $value=$ir['level']*5+4; echo " The value is $value ";   remember to put () around the part of the equation you want to be executed first..such as:   $value=$ir['level']*(5+4);   This will make it so it adds 5+4 first then multiplies it by the users level. Hope that helps you.
  11. lol...seems a recode of mccode lite is not meant to be...seeing as everyone who does a recode "loses" there one and only copy :P
  12. LINE 32 $ir['username'] Should be {$ir['username']}
  13. I started playing on poker stars a year or so ago... I enjoy gambling when im not working on my games :) I was wondering if anyone is willing to trade me some Poker Stars real money for some paypal money ? I do not have a credit card to make my own deposits :( Thanks if anyone can help me out :) Curt
  14. I agree with you :P   thanks, I have never played any type of dice game in real life so i simply did a quick internet search and used the rules that it said..lol feel free to make any changes you want ;)
  15. advantage = its free to download dis-advantage=its non-licensed, so Mccode owners can shut your game down.
  16. Thanks guys for posting the facts up for me. This will make me rethink my 3rd project a little bit..lol It does not sound to good that any custom work i do has to be released for free...
  17. lol... click on your inventory and put an item on the market from there.... should be a link next to the item to put it on the market :P
  18. awsome :D
  19. I downloaded mccode lite version for the first time recently... I was wondering if I edited the script to be a little bit like V2 such as the single line include for each page instead of the v1 code...that if i could continue to create my game for free with the free engine ?... The script will be for personal use and im gonna strip it down more and work on a project almost from scratch...lol I just want to have it so V2 mods are easily incorporated into the game :) Any experiences from anyone ? i will be using mccodes lite for my third project which i will be taking my time on... Thanks, Curt
  20. $num_updates = floor($timesinceupdate / 300);   That is the part that tells how many times it should be updated..if 30 minutes has passed since last update then $num_updates will equal 6.. So you can simply multiply the updates by this.. such as :   $ENERGYGAIN=(energy * .10) * $num_updates;   Hope that helps you :)  
  21. Hey, did you add these data rows to your itemmarket table in your database ?   ALTER TABLE `itemmarket` ADD `imPOINTS` INT( 11 ) NOT NULL DEFAULT '0' ; ALTER TABLE `itemmarket` ADD `imQTY` INT( 11 ) NOT NULL DEFAULT '1' ;
  22. BUG FOUND ! Line 49 Remove the entire query.
  23. lol...i am surprised no one noticed this :P ANOTHER BUG - MAJOR BUG !!! line 62: mysql_query("UPDATE `users` SET `money`=`money`+$MONEYBACK, `crystals`=`crystals`+$POINTSBACK WHERE `userid`={$ir['userid']}",$c);   remove that entire query...my fault guys..lol I had it when a player removed their items it would credit them the price they set for their item...lol This could have been a real economy killer... Top post updated
  24. Small bug fixed. line 83: change : mysql_query("INSERT INTO `inventory` VALUES('',{$r['imITEM']},$userid,1)",$c) or die(mysql_error()); $i = mysql_insert_id($c);   to: item_add($userid, $r['imITEM'], 1);   Top post updated... Thanks everyone.
  25. Hello, Thanks, i am aware of the optimization methods. I did not optimize this mod to the fullest it could have been but why should I do all the work for you guys :P.. btw should not be much of a speed difference seeing as there is few data columns in the itemmarket... but thanks for the thought :)
×
×
  • Create New...