Jump to content
MakeWebGames

Matty

Members
  • Posts

    168
  • Joined

  • Last visited

    Never

Everything posted by Matty

  1. I don't code for the MCcodes engine anymore... I got fed up with fixing stuff so much that I decided to make my own engine. Its nearly finished. Anyways, Ive converted a few things I coded for my engine to work for MCcodes, although I haven't tested them as such yet they should all work. This is my leveling code converted to work with MCcodes V1, I did this mainly because arson took his off and many people have asked for it, Ive also done it because arson also used a pointless query in his =/ What does mine do differently? Well instead of reseting the exp each time this keeps it, basically it works like TCs upgrade, it will calculate how many levels the player can upgrade from there experience and it will then upgrade them to that level instead of someone playing, getting 300% then upgrading only to find out they have gone up one level and lost 200% exp, which is what happens now I believe. Check it out anyways. Open up global_func.php and find: function check_level() { global $ir,$c,$userid; $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*3.5); if($ir['exp'] >= $ir['exp_needed']) { $expu=$ir['exp']-$ir['exp_needed']; $ir['level']+=1; $ir['exp']=$expu; $ir['energy']+=2; $ir['brave']+=2; $ir['maxenergy']+=2; $ir['maxbrave']+=2; $ir['hp']+=50; $ir['maxhp']+=50; $ir['exp_needed']=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); mysql_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",$c); } } } REPLACE the whole CheckLevel() function shown above with the following:   function check_level() { global $ir,$c,$userid; $exp_needed=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); if($ir['exp'] >= $exp_needed) { $upgrade = Y; } }   Then save and close that file and upload it or whatever.... Now create the upgrade.php file   <?php /*----------------------------------------------------- -- Advanced Level Upgrade Modification -- Coded by Hack3rmatt -- I am not responsible for any damage this may cause to your game. Use at your own risk! -- upgrade.php -----------------------------------------------------*/ session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); $exp_needed=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2); if($ir[exp] < $exp_needed) { die("You need more experience before you can upgrade!"); } else { /// Start reversing the formula //Work out their exp divided by the set amount in your game $A = ($ir[exp] / 2.2); //Cube root the outcome, this is for the (level+1)*(level+1)*(level+1) part $B = pow($A, 1/3); //Minus one to get rid of all the +1s you did.. This will give you what level they should be at with the exp they hold $whatlevel = $B -1; /// Calculate how many levels they can upgrade $howmanylevels = $whatlevel - $ir[level]; /// Work out how much stats to add, $howmanylevels will times the ammount by how many levels they are upgrading $level + (1*$howmanylevels); $energy + (2*$howmanylevels); $brave + (2*$howmanylevels); $maxenergy + (2*$howmanylevels); $maxbrave + (2*$howmanylevels); $hp + (50*$howmanylevels); $maxhp + (50*$howmanylevels); ///Insert it all into database =) mysql_query("UPDATE users SET level=level+$level,energy=energy+$energy,brave=brave+$brave,maxenergy=maxenergy+$maxenergy,maxbrave=maxbrave+$maxbrave, hp=hp+$hp,maxhp=maxhp+$maxhp where userid=$userid",$c) or die(mysql_error()); print"You upgraded to level [b]$level[/b]!"; } $h->endpage; ?>   The comments are to tell you what does what if you didn't know, they can be removed to compact the code if you wish. Now add this... if($upgrade == Y) { print"[upgrade]"; } ... to where ever you want to display the [upgrade] link when the player can upgrade. I suggest next to the level in the user stats section.   NOTICE - Please don't use this if you don't know what your doing, this can mess up your game if you don't know what it does, that is if your game is up, if its not you have nothing to worry about. BACKUP THE DATABASE AND FILES BEFORE YOU INSTALL. I will not be held responsible for your careless actions =) Let me know if it works or not, It works fine in my engine but I may of messed up the conversion. +1 If you use it =) Matt
  2. Re: Grrr Crons :x You guys should look at what curl actually is...   No its not a THE standard for running a script, its actually a tool, you have to install it. Therefore if the host doesn't have that installed it wont work as deception said, however the host may have installed another 'open source' tool for transferring URL syntax-ed files which would probably use something other than curl considering curl is the actual name of the tool. Death star thats make your statement wrong.   From all those game you coded you know nothing? =/ Games don't use curl or anything its what your host uses, obviously your host uses curl though... Perhaps cURL is the most common, but it isn't the only one. EDIT - My host has told me you can actually edit the prefix from curl.
  3. Re: Grrr Crons :x Yes, but you cant be sure that its curl, there is a possibility his host uses something else. Still death star's suggestion about the email would say a lot more, whether its the script or command prefix.
  4. Re: Grrr Crons :x   How do you know that? Unless your with the same host as him, or your his host you dont know that. My prefix is PHP so it definetly isnt curl is it? He also said hes tried it and it hasnt worked...
  5. Re: Grrr Crons :x I couldnt say, I think its set by your host, you could try php, or nothing? This is how mine are set up.
  6. Re: Grrr Crons :x Are you sure the command prefix 'curl' is what your host uses? I had to put 'PHP' in front of mine to get my crons to work, check with your host thats the best bet ;)
  7. Re: Free PR3 and PR4 Links Im with Decepti0n...
  8. Matty

    plz help

    Re: plz help Or you have a seperate password/username for mysql access, or you havnt assigned a mysql account to that database if required...
  9. Re: Mod Theives :O Read For Your Own Protection!! Its nothing agaisnt you Decepti0n, I can see it was a question one he ignored. Im just fed up of all the crap thats goin on, that all...
  10. Re: Mod Theives :O Read For Your Own Protection!! I agree with that fact, yes its good to be warned, but this turned into an argument, that no one needs to read. Truth be told you have to expect this type of thing happening, it happens, if you arnt prepare to take it then dont sell! For example, today I found a DIRECT link enabling me to download mccode v1.1 (yes its real) along with a few other nulled scripts such as youtube and myspace clones... guess where I found this link? HERE on this forum, even worse it was posted by a moderator, its still there and it was posted on may 16th, so while your arguing about people stealing codes the forum your arguing on is actually kind of promoting stolen codes? IDK, but im fed up of all the pathetic arguments and accusations around this board. You guys are sposed to help people out yet, i see topics of newbies offering codes for free and then senior members insulting them for trying!? Point is if you want to sell mods, sell them... learn to get to know who you are selling to before you jump ahead and pass it over for the cash... If it ends up somewhere you didnt want it to then so what? Its only your fualt for selling it! Everything gets pirated at some point. Live with it. Just to prove that link here it is, I was going to keep it to myself but then i thought whats the point? Forum page - http://criminalexistence.com/ceforums/index.php?topic=4644.0 If you look its hosted on - http://www.criminal-rage.com/ Which is sliverwolf's website (can be found on his sig) Therefore the mccode v1.1 is being hosted by him. Also the main page shows things like criminalrage youtube etc... Take a look at his file in the file uploader thing. The site - http://fileupload.criminal-rage.com/files.php?start=1 You can see that a few files there have the [nulled] extension, i assuming you know what this means, it means its stolen, you also see the *.rar's for the clone sites he has hosted, most probally nulled aswell just like the fileuploader and others there. I think thats enough evidence for me to warn you of him, and for you guys to argue with him. I see nothing backing up the other accusations across the board. Matt
  11. Re: Mod Theives :O Read For Your Own Protection!! Take your pethetic argument elsewhere, it none of our business and quite frankly a waste of database space.
  12. Re: Layout Help / CSS Layers Nice tut, should encourage a few people who are new to coding to take a look at css and xhtml +1 :)
  13. Re: [mccode] Register Page   I have made scripts that would shock you if you saw them. btw. not the images :lol: XHTML is a stricter version of HTML, its better to learn XHTML as there is less room for shabby coding and most tag elements work with all the latest browsers. HTML is for the 12 year olds that want to make something slightly pretty. If you were going to design a website for a company that NEEDED all the accessibility options available to browser to work with their site for example the HTML tag would be ignored by them, whereas does the same effect as but will also empathise that word to blind people visiting the site with text reading software. Basically what I'm trying to say is that ~DeathStar~ you are sounding like a 12 year old, maybe 13 if i was to push it. Yeah XHTML and HTML are pretty much the same but saying that proves that you don't know much about the two languages, I mean why would two of them exist if they were the same. I have also taken a look at you 'custom code' site, its not all that great, I see two very simple mods there. I also see a site which looks like its a free template, mainly because you did a poor job at trying to hide the link to http://www.3dmax-tutorials.com/ (in the bottom right of the white table, next to the copyright which is aligned bad). So yeah, keep your comments to yourself in the future. His coding languages are good. My bets are that he started learning HTML first to get to grips then learnt XHTML, he also knows CSS which plays a huge part in website design nowa days. Ive coded my game from scratch, i didn't use the mccodes script, because i didn't know about it till recently, but the free mods ive found for i have helped me add some extra things to the game (because they can easily be converted) so i want to thank you guys for doing that, but its people like you that put me off buying mods, id much rather do it myself so that i know I'm getting quality. Matt EDIT - Or are you trying to tell us they will shock us on how bad they are? hmmm.
×
×
  • Create New...