Jump to content

mike1313

Members
  • Posts

    116
  • Joined

  • Last visited

Posts posted by mike1313

  1. I have map for our users in our online MMORPG. We have a section, where you walk around starting at 0,0  thats x,y coords each time you click a direction it updates their coord in the db, but the way the x,y are displayed everytime they move, the number is always 1 behind is there anyway to display the output as a change everytime they click? so if they are at 1,1 they go north itll still display 1,1 until they click again I want them to be able to click once and itll show 1,2 is this at any way possible?

  2. $xy9 returns a number if that number is a certain number I need it to filter out the beginning of a string.

     

    I tried using strlen instead of $xy9=100

     

    I just need it to search for a number if its that number remove it from the string. or if strlen=2, 3, 4 I need to remove the 2nd, 3rd, 4th, characters of the string.

     

    say strlen=2 I want substr to remove the 2 characters, 3, 4 and so on.

  3. This is jumbled but this is the code.

     

    if($xy9 > "0" && $xy9 < "10") {
      $do_pm3 = substr("$do_pm2", 1);
      }
      elseif($xy9 > "10" && $xy9 < "100") {
      $do_pm3 = substr($do_pm2, 0, 2);
      }
      elseif($xy9 > "100" && $xy9 < "1000") {
      $do_pm3 = substr("$do_pm2", 0, 3);
      }
      elseif($xy9 > "1000" && $xy9 < "10000") {
      $do_pm3 = substr("$do_pm2", 0, 4);
      }

     

    The only string returning anything is the first.

  4. I've read the documentation on php.net, but still dont full understand.

     

    $string = '123456';

    $return = substr("$string", 1);

    echo "$return";

     

    I know that $return will echo 23456.

     

    But How can I for instance, using substr be able to echo 345, 456, 56?

     

    Please any help is appreciated. Thanks.

  5. I have a chat room. I need help with this.

     

    $do_pm = preg_replace("|/pm *|", "", $decode);

     

    I'm replacing what's after /pm.

     

    Say /pm 45

     

    is there anyway I can find out whats entered after 45? preferrrably by using preg_replace? or some other method.

     

    Any help is appreciated.

  6. using <input type-text name=somevar>

     

    Alright say they type /word Hello Guy

     

    I just need something where it can select "Hello"

     

    and

     

    "Guy"

     

    into 2 seperate strings. So I can run 2 different queries.

  7. With an  form input box I need to check to see if the user typed after something say they typed "hello Bob Franklin" I need it to select Bob and Franklin in 2 seperate forms, how can I do this?

  8. I've written a ranking system, it finds the user in the db sorts their sort highest to lowest then displays it on the page as such.

     

    1. John 3400 points

    2. Sue 2600 points

    3. Joe 1200 points

     

    How could I make it so for 1 is says 1st instead of 1 all the way to lets say 1000 or unlimited? 2nd 3rd 4th etc.

  9. I've written a simple chatroom for my website. But I want to know how I can make it so if the user types a certain command, that a certain table in the MySql DB can be updated and it doesnt display anything on the page. For example if they wanted to change the color of their font in the chat, they would type /hexcode #FFFFFF

     

    and it would find them in the db and under the field chatfont it would change it to #FFFFFF, I know everything about updating the DB and so forth all I need is what I should use for the line of code to check to see if they posted at least /hexcode and it gets rid of /hexcode and just updates the db with #FFFFFF all help is appreciated thanks.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.