Jump to content
MakeWebGames

ShizzleNizzle

Members
  • Posts

    295
  • Joined

  • Last visited

    Never

Everything posted by ShizzleNizzle

  1. Hey all, this is a simple modification at the moment but will be updated. Every time a user level's up they will gain "Awards". There is still some more to this...It will be updated soon so it's done via cron_day.php and check's for level,crimes,houses, anything you want and gives awards based on that. :) This is still useable at the moment as it gives out awards as they level up... Put this is PHPmyadmin. ALTER TABLE `users` ADD `awards` int(11) NOT NULL default '2'   Open global_func.php and replace.   $db->query("UPDATE users SET level=level+1,exp=$expu,energy=energy+2,brave=brave+2,maxenergy=maxenergy+2,maxbrave=maxbrave+2, hp=hp+50,maxhp=maxhp+50 where userid=$userid");   With.   mysql_query(sprintf("UPDATE users SET level = level + 1 , exp = %s , energy = energy + 2 , brave = brave + 2 , maxenergy = maxenergy + 2 , maxbrave = maxbrave + 2 , hp = hp + 50 , maxhp = maxhp + 50 , awards = awards + 2 WHERE (userid = %s) " , abs(@intval($expu)) , $userid));   Then make a file called awards.php.   <?php /* # Made By WhizzBang # For use by CE/Dev-Forum Members # Do not claim as your own! */ include_once(DIRNAME(__FILE__) . "/globals.php"); if (isset($_GET['page'])) switch($_GET['page']) { case 'index' : index(); break; case 'buycrys' : buycrys(); break; case 'brave' : brave(); break; case 'will' : will(); break; } function index() { global $ir; echo '<h3>Welcome to the [i][b]Award[/b][/i] center!</h3> </a> '; echo "<table border = '0' cellspacing = '1' width = '75%'> <td bgcolor = #CCCCCC> [b]Info:[/b] You get award's once you level up, the quicker you level up the more awards you get! You can spend these awards on numerous things, they are all listed here and more to come soon! You can either use them or save then the choice is [b]Yours[/b]</td></table> "; echo 'You currently have [b]'.number_format($ir['awards']).' Awards[/b] '; echo " <table border = '0' cellspacing = '1' width = '75%'> <tr> <th bgcolor = '#CCCCCC'>What You Get</th> <th bgcolor = '#CCCCCC'>Amount Needed</th> <th bgcolor = '#CCCCCC'>Use</th> </tr> <td>10 Crystals</td> <td>1 Award</td> <td align = 'center'><a href = 'awards.php?page=buycrys'>Use</a></td> <tr> <td>Brave Refill</td> <td>10 Awards</td> <td align = 'center'><a href = 'awards.php?page=brave'>Use</a></td> </tr> <tr> <td>Will Refill</a></td> <td>15 Awards</td> <td align = 'center'><a href = 'awards.php?page=will'>Use</a></td> </tr> </table> "; } function buycrys() { global $ir , $userid , $h; if(!isset($_POST['awards'])) { $_POST['awards'] = abs(@intval($_POST['awards'])); echo "<table width = '50%' cellspacing = '1' border = '0'><td bgcolor = '#CCCCCC'>"; echo "So you've come to use some awards to get some crystals, this is a good place to come! "; echo 'You currently have a total of [b]'.number_format($ir['awards']).' Awards [/b], spend them wisely.</td></table> '; echo " <table border = '0' cellspacing = '1' width = '50%'> <td> 1 [b]Awards[/b] = 10 [b]Crystals[/b] <form action = 'awards.php?page=buycrys' method = 'post'> Enter the amount of [b]Awards[/b] you wish to trade for Crystals:<input type = 'text' name = 'awards' value = '0'> <input type = 'submit' value = 'Trade'> </form></td></table>"; } else { $_POST['awards'] = str_replace(',', '', $_POST['awards']); $_POST['awards'] = abs(@intval($_POST['awards'])); if(empty($_POST['awards']) ||$_POST['awards'] > $ir['awards']) { die("Either you didn't enter a number, or you didn't fill out the form."); } if(strlen($_POST['awards']) > 4) { die("I don't think you could obtain this amount while abiding by game rules..."); } if ($ir['awards'] < 1) { die("You do not have the required amount of Awards to complete this transaction"); } else { $gain = $_POST['awards'] * '10'; $crystal = sprintf("UPDATE users SET awards = awards - %s , crystals = crystals + %s WHERE (userid = %u) " , abs(@intval($_POST['awards'])) , abs(@intval($gain)) , $userid ); mysql_query($crystal); } printf ("You successfully traded %s [b]Awards[/b] for %s Crystals!" , abs(@intval($_POST['awards'])) , abs(@intval($gain)) ); } } // function brave() { global $ir , $userid , $h; if(!isset($_POST['awards'])) { $_POST['awards'] = abs(@intval($_POST['awards'])); echo "<table width = '50%' cellspacing = '1' border = '0'><td bgcolor = '#CCCCCC'>"; echo "Brave Refills are put into your inventory, so you can either Use/Sell them! "; echo 'You currently have a total of [b]'.number_format($ir['awards']).' Awards[/b], spend them wisely.</td></table> '; echo " <table border = '0' cellspacing = '1' width = '50%'> <td> 10 [b]Awards[/b] = 1 [b]Brave Refill[/b] <form action = 'awards.php?page=brave' method = 'post'> Enter the amount of [b]Brave Refills[/b] you wish to buy:<input type = 'text' name = 'awards' value = '0'> <input type = 'submit' value = 'Trade'> </form></td></table>"; } else { $loss = $_POST['awards'] * '10'; $qty = $_POST['awards'] / '10'; $_POST['awards'] = str_replace(',', '', $_POST['awards']); $_POST['awards'] = abs(@intval($_POST['awards'])); if(empty($_POST['awards']) ||$loss > $ir['awards']) { die("Either you didn't enter a number, or you didn't fill out the form."); } if ($ir['awards'] < 10) { die("You do not have the required amount of Awards to complete this transaction"); } if(strlen($_POST['awards']) > 4) { die("I don't think you could obtain this amount while abiding by game rules..."); } else { //HERE $update = sprintf("UPDATE users SET awards = awards - %s WHERE (userid = %u) " , abs(@intval($loss)) , $userid ); mysql_query($update); $itmid = 1; //Change this ID to the ItemID you wish to use... $item = sprintf("INSERT INTO inventory VALUES ('',%s,%s,%s) " , abs(@intval($itmid)) , $userid , $_POST['awards'] ); mysql_query($item); } printf ("You successfully traded %s [b]Awards[/b] for %s Brave Refills!" , abs(@intval($loss)) , abs(@intval($_POST['awards'])) ); } } function will() { global $ir , $userid , $h; if(!isset($_POST['awards'])) { $_POST['awards'] = abs(@intval($_POST['awards'])); echo "<table width = '50%' cellspacing = '1' border = '0'><td bgcolor = '#CCCCCC'>"; echo "Will Refills are put into your inventory, so you can either Use/Sell them! "; echo 'You currently have a total of [b]'.number_format($ir['awards']).' Awards[/b], spend them wisely.</td></table> '; echo " <table border = '0' cellspacing = '1' width = '50%'> <td> 15 [b]Awards[/b] = 1 [b]Will Refill[/b] <form action = 'awards.php?page=will' method = 'post'> Enter the amount of [b]Will Refills[/b] you wish to buy:<input type = 'text' name = 'awards' value = '0'> <input type = 'submit' value = 'Trade'> </form></td></table>"; } else { $loss = $_POST['awards'] * '15'; $qty = $_POST['awards'] / '10'; $_POST['awards'] = str_replace(',', '', $_POST['awards']); $_POST['awards'] = abs(@intval($_POST['awards'])); if(empty($_POST['awards']) ||$loss > $ir['awards']) { die("Either you didn't enter a number, or you didn't fill out the form."); } if ($ir['awards'] < 15) { die("You do not have the required amount of Awards to complete this transaction"); } if(strlen($_POST['awards']) > 4) { die("I don't think you could obtain this amount while abiding by game rules..."); } else { //HERE $update = sprintf("UPDATE users SET awards = awards - %s WHERE (userid = %u) " , abs(@intval($loss)) , $userid ); mysql_query($update); $itmid = 1; //Change this ID to the ItemID you wish to use... $item = sprintf("INSERT INTO inventory VALUES ('',%s,%s,%s) " , abs(@intval($itmid)) , $userid , $_POST['awards'] ); mysql_query($item); } printf ("You successfully traded %s [b]Awards[/b] for %s Will Refills!" , abs(@intval($loss)) , abs(@intval($_POST['awards'])) ); } } ?>   I have tested a bit so there shouldn't be any error's, in the case that there is just post here :). If anyone wants something added to it let me know and i'll do it aswell :)
  2. Re: Helping me learn :)   Can you elaborate on your idea please? I don't understand lol
  3. Hey! I've just started advancing my coding abilities and I'm doing quite well. To gain experience I want people to post their mod ideas here and I will try my best to make them I think can secure my scripts well :) I've learnt alot, some functions I've learnt include str_replace() sprintf() mysql_real_escape_string() htmlspecialchars() stripslashes() strlen() And more. Obivously to help me advance the mod will be free for everyone :-D nothing to hard, I'm new to this :-D
  4. Re: [Any]Zyzamic Network Definitely not worthy of selling,although they are OK
  5. Re: New Look Look's excellent :) One thing though, the "REGISTER NOW" part, make that an image with a good font. At the moment it's just sitting there in blue writing....ewww This is only my opinion btw...Well done
  6. Re: SMALL security mod Nice this will come in handy for many people :) Simple yet effective!, just like you said.
  7. Re: MCcode V2 user DB hack Or just do this lol...   Would'nt be hard at all
  8. Re: Advanced Tax Mod [$5]   That would be a good idea sounds good :) Yes, i'd certainly buy it if that's added!, it's already value for money but this would be a great addon!
  9. Re: Mccodes Lite Userstats IQ Bug   If he's using MC Lite then that wont work. Its mysql_query in LITE. (correct me if im wrong)
  10. Re: [MC CODE V2] WORLD WAR 4 - TEMPLATE I love it!...How much you selling for? Also if it's a free template will I need to link to the original creator at all?
  11. Re: [MC CODE V2] WORLD WAR 4 - TEMPLATE If it's any good I may be interested in buying still....
  12. Re: [MCCODES 2] Above and beyond (i think) car mod $10   I suggest you don't sell to him, a lot of people know what he's like. He would have already lined up people to buy it by the time you send it to him lol
  13. Re: Advanced Tax Mod [$5] Just got a question... Is there some sort of staff function to edit/add/ tax's on houses ect?
  14. Re: Mono District And YOU think that's right? Also the domain is TERRIBLE lol
  15. Re: Mono District Still report it though (dont think dabomstew will give a **** though)
  16. Re: Mono District A backup of monodistrict has been going around pretty much since it opened...
  17. Re: [mccodes][V2]changable currency mod Dayo, that idea about changing currency's in different location's is brilliant idea!, good work
  18. Re: [mccode v2] Player Card ($8) Look's really good well done!
  19. Re: not sure about this Firefox can't establish a connection to the server at mynewsite.exofire.net.
  20. Re: What would you do with $100,000,000?     *Quickly making more account's!!
  21. Re: [mccode v2] Annoucements Upgrade! EDIT: Wrong post hehe
  22. Re: CE Server It's been going faster for me. Since the changeover the server's seem to be alot faster...
  23. Re: Th3 Str33ts It was looking okay...till I logged in. That template has been used 100's of time's, get's a little boring. The domain then just kill's it, all those number's EWWW... I dont see nothing special here although this is just my opininion...
  24. Re: [Guide]MC Economy Yep I agree, as long as the everything in the game is expensive it's still a challenge to the player. Either way there both enjoyable
  25. Re: Workshop ($10) I'll certainly buy at $5
×
×
  • Create New...