Jump to content
MakeWebGames

CrazyT

Members
  • Posts

    708
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by CrazyT

  1. Re: Let see   :? What is your problem, you didn't say so i didn't reply.
  2. Re: [mccode v2] View User Instead of having load's of (if/else) for example. <?php //Only for colors! if($r['gang']) { print "<TD>[b][url='gangs.php?action=view&ID={$r[']{$r['gangNAME']}[/url][/b]</TD>"; } else { print "<TD>[b]N/A[/b]</TD>"; } Could be. <?php //Only for colors!! echo ($r['gang'] ? "<td>[b]<a href=\"gangs.php?action=view&ID=". $r['gang'] ."\">". htmlentities($r['gangNAME']) ."</a>" : "<td>[b]Not in a gang![/b]</td>");
  3. Re: Mafia Text Based Game? There are ton's of script's for mafia games, lying around on google, all you have to do is a google search. http://www.google.co.uk/search?hl=en&q= ... =&aq=f&oq= Wasn't hard was it.
  4. Re: Let see   <?php //Only for colors!! if($stat=="strength") { print "You trained {$_POST['amnt']} times and gained {$gain} strength."; } elseif($stat=="agility") { print "You trained {$_POST['amnt']} times and gained {$gain} speed."; } elseif($stat=="guard") { print "You trained {$_POST['amnt']} times and gained {$gain} defense."; } elseif($stat=="labour") { print "You trained {$_POST['amnt']} times and gained {$gain} seamanship."; } Instead of having all of that you could use switch(); <?php //Only for colors!! switch($stat) { case "strength" : echo "Some message!"; break; case "agility" : echo "Some message!"; break; case "guard" : echo "Some message!"; break; case "labour" : echo "Some message"; break; case "TrainAll" : echo "Some message"; break; }
  5. Re: 3 Word Game   Hawk and danny696...
  6. Re: [V2] Cron Mods Request @ AshTonka.. Use code tags please. :-D like.. [code] Some code here [/code]
  7. Re: New Houses Mod [Mccodes V2] Hey, Immortalthug you maybe new but next time can you use Code Tags please :-D.. ty ;) [code] SOME CODE [/code]
  8. Re: Mccodes V2 Request Name Changes For Could have. <?php //Only for colors!! if(strlen($_POST['color']) > 6)) { $_POST['color'] = 'FFFFFF'; } //If $_POST['color'] is longer than 6 chars, it will set color to FFFFFF. $db->query("UPDATE `users` SET `color` = '". mysql_real_escape_string(trim($_POST['color'])) ."' WHERE `userid` = ". $userid);
  9. Re: [mccode v2] View User   Add this to both files below include "globals.php"   if ($_GET['userid']) { $r['userid'] = abs((int) $_GET['userid']); } else { die("Invalid use of file!"); }   And on the viewuser... the link to cactons.php should be 'cactions.php?userid={$r['userid']}' Seems sniko forgot to pass the vars ;) though as for what i was told, everything works fine :) if(isset($_GET['userid']) && is_numeric($_GET['userid'])) { $r['userid'] = abs((int) $_GET['userid']); } else { echo "Invalid use of file!"; $h->endpage(); exit; } :-D and instead of having 1 file for the link's and other files for diff stuff, why not just make functions for it? :-D
  10. Re: Help needed will pay!   lol. Could be minute cron? Maybe the host don't accept 1 minute crons :-)
  11. Re: Street Images   No i haven't tested it. It will work.. how i have done it. :-D
  12. Re: 3 Word Game   //lol... Then Hawk and......
  13. Re: Street Images You just gave me a idea, so here i go lol. Everytime you click search in streets.php a diff image shows... <?php //Only for colors!! $sql = $db->query("SOME QUERY"); $count_rows = $db->num_rows($sql); $image = mt_rand(1, $count_rows); echo "<img src=\"/images/streets/". $image .".png\" alt=\"Streets\" title=\"Streets\" />"; Count how many streets there are (if using database) then just make street images like.. 1.png, 2.png, 3.png *me thinks its a good idea lol. If not database can just do like. <?php //Only for colors!! $image = mt_rand(1, 10); //change number 10 to the last number of the image you have! echo "<img src=\"/images/streets/". $image .".png\" alt=\"Streets\" title=\"Streets\" />";
  14. Re: Let see What error are you getting.
  15. Re: 3 Word Game   danger boy's eye
  16. Re: Illegalife and his GFX Inside the game looks awesome!!!!!!! +1 for your work!
  17. Re: [McCodes v2] ($3) Database driven voting script with incentive and security   Is it ioncubed ?... if not just remove the code from it lol
  18. Re: [mccodes V2]Personal Status Mod[mccodes V2] Can be one function :roll: <?php //Only for colors!! //Note not tested! function sm_change() { global $userid, $h, $db; if(isset($_POST['sm'])) { if(empty($_POST['sm'])) { echo "You didnt enter a new status message!"; $h->endpage(); exit; } else if(strlen($_POST['sm']) >= 30) { echo "You status message is to long!"; $h->endpage(); exit; } else { $_POST['sm'] = str_replace(array("<", ">", "\\\'"), array("<", ">", "'"), $_POST['sm']); $db->query("UPDATE `users` SET `sm` = '". mysql_real_escape_string(trim($_POST['sm'])) ."' WHERE `userid` = ". $userid); echo "Status Message Changed!"; } } else { echo "<h3>Status Message Change Change</h3> Here, you can change your status message that will be shown on your profile. <form action=\"preferences.php?action=smchange\" method=\"POST\"> [b]Status Message:[/b] <input type=\"text\" name=\"sm\" /> <input type=\"submit\" value=\"Change Status Message\" /></form>"; } }
  19. Re: [mccodes V2]Personal Status Mod[mccodes V2] Limit it... if(strlen($_POST['sm']) >= 30) { echo "Status Message to long, need's to be no longer than 30 chars!"; $h->endpage(); exit; }   Also i see that you used $_POST['newname'].. (username) part :|
  20. CrazyT

    Cron advise

    Re: Cron advise   Dang so many queries
  21. Re: Secure user ip! - NEW   Ahh :P
  22. Re: Secure user ip! - NEW Im not sure but somethink like this $IP = (preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', getenv('REMOTE_ADDR'))) || (preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', getenv('REMOTE_ADDR'))) ? getenv('REMOTE_ADDR') : "Invalid IP"; or somethink :P
  23. Re: Secure user ip! - NEW Ya this is for IPv4.. but you can edit it...
  24. This is to secure user ip variable. I know loads of people have done it here is a way i have done it. $IP = (preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', getenv('REMOTE_ADDR')) ? getenv('REMOTE_ADDR') : "Invalid IP");   If the user ip is not valid it will put into the database .. Invalid IP.. :) Also better than using mysql_real_escape_string($_SERVER['REMOTE_ADDR']);
  25. Re: [MCODES V2] Userids Probs   Delete the game? lol
×
×
  • Create New...