Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

get right player name in file with big letters

Comments in 'Plugin Development' started by Xenturio, Dec 3, 2014.

  1. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    can someone say me ??

    if i save $p->getName(),
    In file

    then the system save not GamerXy
    It save gamerxy - how i get the right name from player with big letters in the file?

    same with strtolower($name)
  2. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    Or how to ignore if player name have big letters... or change big letters to small one

    If have made a region it save the nickname in small letters like gamerxy
    but the real nick is GamerXY
  3. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Use it like:
    PHP:
    strtolower($player->getName())
    EvolSoft likes this.
  4. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
  5. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Then don't use strtolower(), if you save players' names inside a config made by you, there should be no problem ;)
  6. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    Yes i dont use it by place and break event ... think thats my mistake
  7. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    XD
  8. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    Its the same then he save all the time players in small letters
  9. Xenturio
    Offline

    Xenturio Active Member

    Joined:
    Sep 19, 2014
    Posts:
    333
    Minecraft User:
    Xenturio
    close -.- i forgot it by break and place but all ove in the code by array save and something else -.-
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Off-topic: if you use a MySQL database, it is default to be case-insensitive.
    If you use SQLite3 database, you can add a COLLATE NOCASE specification for a row when creating a table to make it case-insensitive.
    Xenturio likes this.

Share This Page

Advertisement