-
Posts
1,099 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
Events
Everything posted by Lithium
-
Re: Help!! Mccodes Lvl hack Allow alphanumeric only $string = "/^[A-Za-z0-9]+$/"; Allow alphanumeric with spaces $string = "/^[A-Za-z0-9 ]+$/ "; Allow alphanumeric with underscore and dashes $string = "/^[A-Za-z0-9_-]+$/"; Allow alphanumeric with underscore, dashes, and spaces $string = "/^[A-Za-z0-9_- ]+$/"; and then preg_match( $string, "text to remove unwanted chars" )
-
Re: Help!! Mccodes Lvl hack that is not an hack... You should trim usernames to allow only a-zA-Z0-9, and also... it doesn't give 100% exp... You beat xxx and gained 6% EXP! You hide your weapons and drop xxx off outside the hospital entrance. Feeling satisfied, you walk home.QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'triplx'' WHERE userid=5' at line 1
-
Re: Table + CSS problem @ POG1 and killah, As my post says, i had set css images to body and table, though simply it didn't showed up the table image for some reason, though thx for the tips @ Luke thanks for the div tip, as it worked. Though i still wonder why it did not worked with the css.
-
Re: Include or Require? I want some proof of this. I have seen nothing that would suggest so and given that there are different wants to display stuff, I would assume the server knows where to go. / = current ../ = up one level ./ = find it (This is the one that may cause a problem, the other 2 I see nothing though) Require() uses the relative path, and php processes as you said, on that way, though even that way, php needs to make a filessytem call to know the full path of the file... therefor is far better using the full path from the start, and not the relative path
-
Re: Include or Require? it is indeed better to place the full path as php will "try to guess" the relative path upon the root folder. If you place the full path it will indeed increase the performance, as it will go dsrectly to the file and process it.
-
Re: hour cron negative v2 basicly... yes
-
I bumped into something new to me, and can't seem to get an answer anywhere, so here it goes... I have a background image inside a .css file on the body element... background-image: url(../images/background.jpg); background-repeat: repeat; now i need to set a table with a background image, let's say... background-image: url(../images/table.jpg); background-repeat: repeat; apparently... all good, but it doesn't show the table image. (also, placing image on td is not an option), also style tag inside the table element doesn't work as well... any suggestions to make this work? Thanks :)
-
Re: hour cron negative v2 try zero'ing the time value and see if it goes neg again, it stuck at that point probably because you fixed the code while negative and never zero'ed it.
-
[mccode] Small mod (getting back into coding)
Lithium replied to gurpreet's topic in Free Modifications
Re: Small mod (getting back into coding) I think its more, you trying to learn to code, not again! lol But thats where we all started so keep it up and you might start producing some quality work! Read code that has been posted by the "better" coders such as well, nyna, floydian, luke etc etc and try and familiarize with there style and work on it :wink: that could be read like... "So I'm trying to learn coding, again..." meaning he started to learn and quit ;) but oh well, semantics is not my strong, atleast not in english :D -
mccode-v2 streets.php includes image + ability to fight NPCS
Lithium replied to Uridium's topic in Free Modifications
Re: [mccode v2] streets.php includes image + ability to fight NPCS Going in the line of Luke's post to ease up the 200 row/column listing, there are quite a load of if's that could be taken out if($ir['money']> -1) { $chance = rand(1,16); } else if($ir['money'] > 999999) { $change = rand(1,17); // <- $change? or $chance? } this could be easyly changed to $chance = ($ir['money'] < '99999') ? rand(1,16) : rand(1,17); and then... if ($chance == 1) { $expcur=(($ir['exp']+$ir['exp_needed'])/100); $exp=(($expcur)*rand(1,5)); print"<center><font size=3><font color=red>You stop in the local gym and purchase some illegal steroids , you gain some exp! "; $db->query("UPDATE users SET exp=exp+$exp WHERE userid=$userid",$c); } this could be easyly changed to switch($chance) { case 1: //whatever code to satisfy $chance($result) break; .... } a closer look to the code shows that the mapped image... isn't doing anything there... or am i missing something? -
Re: [mccode v2] Av Bank ROTFL, damn your math seems to be quite good. 100*0.01 = 101 ? well 101 indeed for maths money=money+(money*0.01) would basically lets show example 100 = 100 + (100*0.01) 100 = 100 + 1 so money = 101 hard to even use the calculator
-
Re: [REVIEW] Crime-Network.com - Please review! GRPG is the the engine... and yes it's a GRPG engine based game
-
Re: [mccode v2] Farming See... there again you show how you fall pretty quickly from your high horse! ++$var is way faster than $var++ html processing is faster than <?php ?> and... echo '<option value="'.$option.'">'.$option.'</option>'; $option++; stops the loop at 29 as of $option++; echo '<option value="'.$option.'">'.$option.'</option>'; stops the loop at 30 as required... But then again... i am the noob, sorry for point just these 3 points to you master coder :)
-
Re: [mccode v2] Farming lol, quite true, and at a glance... it could be saved a huge amount of code lines... as an example... from 30 lines to 1 $option = "1"; while ($option < "30") { ?> <option value="<?=$option?>"><?=$option?></option> <? } ?> As this occurs twice... well 58 lines of code saved... ever heard of spacing? or did you just thing it was clever to make it 1 line instead of 6 $option = "1"; while ($option < "30") { ?> <option value="<?=$option?>"><?=$option?></option> <? } ?> people are here to learn not read sloppy coding... ?> ... don't even get me started... If people are here to learn, how did a master coder like you didn't even notice that my code is on an endless loop?, as far as it goes, try to be picky for the right reasons, and try to benchmark both ways :) your way, ending loop $option = "1"; while ($option < "30") { ++$option ?> <option value="<?=$option?>"><?=$option?></option> <? } ?> my way (sloppy), ending loop $option = "1"; while ($option < "30") { ++$option ?> <option value="<?=$option?>"><?=$option?></option> <? } ?>
-
Re: [mccode V2] Bank Investment but i still have something to say! :P ereg_replace() can and should be replaced for strtr() which is just a little bit faster, also... less print's and more formed html can speed it up! :)
-
Re: [mccode V2] Bank Investment are you sure? i see conditions where you have days count (duration of investments) and it seems you don't verify the amount of days the investment has taken... ;) take 2 You have them there! sorry :D
-
Re: Guess the next poster wrong again!!! Easter Bunny next? :D
-
Re: Av Bank [FREE] 100% = total bank, therefor 1% = bank*0.01, etc etc etc so, getting on the Zero's code for 1% interest it would be something like this $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney*0.01) where bankmoney>0 and donatordays>0"); or $db->query("UPDATE users SET bankmoney=bankmoney+(bankmoney*.01) where bankmoney>0 and donatordays>0");
-
Re: One Big Code! while($post_count < 1000000) ++$post_count;
-
Re: Guess the next poster Santa's next?
-
Re: [mccode v2] Farming lol, quite true, and at a glance... it could be saved a huge amount of code lines... as an example... from 30 lines to 1 $option = "1"; while ($option < "30") { ?> <option value="<?=$option?>"><?=$option?></option> <? } ?> As this occurs twice... well 58 lines of code saved...
-
Re: Hospital/Jail Count stuck LOL, at last you show your face :) down to insults, and even if i am writing on your mother language, seems you still don't know how to read. I called myself a script kiddie not you, but then, with that kind of reaction... i wonder... you are definetly a kid and it also seems i hit the nail on the head with that one :)
-
Re: Hospital/Jail Count stuck I know more than you? Who knows? Perfect programmer? Is there such a thing? And even far from being a programmer, i like to consider myself as a wannabe-zero-script-affect-kiddie so i can say (not) to everyone i know it all and how easy things are, until the day i get someone who's willing to help me and i act dumb! Issues with your coding? Why should I? You are the (pretensious) perfeccionist, not me. I just stated that for such a "perfeccionist programmer" you should accept others suggestions instead making literaly "dumb" fixes like that.
-
Re: Hospital/Jail Count stuck Seems you are missing something... I've never told WHERE to place the query... But then again reading your comments Zero, just makes me laugh, after seeing how you fix a minor issue on a script of your own :) Let's see... House Insurance as you sell it... gives... 3 days insurance right? wrong! I pointed you that and was willing to tell you how, but then... how you fixed it? Added one more day so the 3 days would be covered... Nice fix from a guy that shows himself to everyone as being on a high coding standard.
-
Re: Hospital/Jail Count stuck benchmarking... not the best option... giving full done code to users that don't seem to want to learn... your is definetly the best way. ;)