Kieran-R Posted March 16, 2011 Posted March 16, 2011 (edited) Hi, I have created a simple mug mod where users can mug other players for some of there money. This mod should work for both MCCodes V.1, and V.2. NOT WORKING DUIE TO FORUM SWITCHOVER! Edited June 27, 2011 by Kieran-R Quote
Danny696 Posted March 16, 2011 Posted March 16, 2011 Wow, you need lay off the indent key, gonna use up serious file space there.... Quote
bineye Posted March 16, 2011 Posted March 16, 2011 Nice work! One question: how does this differ from the MCCodes base attack script, which already has a mug feature on it? I assume yours works without the need to attack? Which is much better imo. If this is the case, I will have to use it :P Quote
Kieran-R Posted March 16, 2011 Author Posted March 16, 2011 @Danny: Makes it easier to read through the way I do it. @bineye: You dont have to attack the user for this one, and also you do not send them to hospital. Quote
Danny696 Posted March 16, 2011 Posted March 16, 2011 Yes it does, but i think you've over done it :) Quote
War_Hero Posted March 16, 2011 Posted March 16, 2011 For a mod like this, it's a matter of KBs between a file with the identation and a file without. So it wouldn't have much of an effect, really....maybe on a bigger mod, yeah, but not on one this size. :) Quote
Danny696 Posted March 16, 2011 Posted March 16, 2011 Actually each indent = 1 byte, so its actually a matter of bytes fr a mod this small and simple. Quote
War_Hero Posted March 17, 2011 Posted March 17, 2011 It depends on the size of the indent. :) But you've just gone against your original point....indentation in this form hardly makes a difference in file size, and it make it easier to read the script. I always indent my code, but maybe not as much as this. :) Quote
Diesl Posted March 17, 2011 Posted March 17, 2011 Actually each indent = 1 byte, so its actually a matter of bytes fr a mod this small and simple. Or you compress your code and it wouldn't matter. Quote
rulerofzu Posted March 17, 2011 Posted March 17, 2011 Or cut n paste the free code and remove the indents if your that bothered and cant sleep lol select userid,username,location,money,jail,hospital would be much better than select * Well done. Nice simple I would add lots more to it but depends on your game! Quote
Danny.W Posted March 17, 2011 Posted March 17, 2011 Well done look's like a good modification, Keep up the good work! Note: Feel free to space your code as much as you like it's your modification! If they don't like it, then they can create their own... :) Quote
a_bertrand Posted March 17, 2011 Posted March 17, 2011 Danny: a code without indent is barely readable and shows amateur styles normally. The number of byte your source is have little to no effect on the performances, that's why for example functions should be commented at least if not reach the 30% or 50% of your overall code. Yes I know this is not the McCode standard but this is how it should be. Why I say it have little effect? Because PHP is in the worse case a 2 pass interpreted language which means on the first pass the code is transformed into a more compact / checked form which can be either represented as "byte code" or "expression tree" depending who develop the parser and who describe it ;) The second pass the byte code or expression tree is run (so a for loop or any other thing will run actually with this second form not the original source). This intermediate state can be stored either in ram or on disk and that's what all php accelerator do at least. The first pass removes all those space, comments and much more. So once this pass is done your comments or indent will have no effect. Yet how much effect it has on the first pass? Again little to nothing, you may try by yourself and I doubt you will see any effect. Quote
Uridium Posted March 17, 2011 Posted March 17, 2011 I agree with what ever he said above ;) And kieran I think your Indents look nice i can see every { and } very clearly without having to rummage through to spot them nicely done. have a look at the attachment you'll see what i mean :) Quote
Kieran-R Posted March 17, 2011 Author Posted March 17, 2011 Thanks for the comments. I use notepad ++ to make mods and it does make it alot easier to look over, and change things within the code with the tab spacing which I use. Im really not sure if it would make a difference to the performance, but if it does, then simply remove the tab spacing to your liking. :) Quote
Dominion Posted March 17, 2011 Posted March 17, 2011 Some indention annoys me as people do it to look “more professional” when in fact there is just no constancy to it at all. This is not all that bad. Not looked at the mod itself, but the indention does not look bad. :P Always nice to see people posting free mods. :) Quote
a_bertrand Posted March 18, 2011 Posted March 18, 2011 Check out this: http://makewebgames.io/board205/35105-tabs-or-no-is-there-a-speed-difference And you clearly see that it does NO DIFFERENCE, so now stop saying stupid things even before testing. And don't tell me that the second version without tabs nor returns look cooler or easier to read or I will need to spank a few bottoms. Quote
Djkanna Posted March 19, 2011 Posted March 19, 2011 Yes it does, but i think you've over done it :) He's using the standard 4 space tab indent, which is what a lot of people including myself use, there is no problem... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.