• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • Minecraft 1.16.220 Update + Bug/Crash Fixes
    Added MCPE 1.16.220 version and fixed crashes for multiple plugins. You can view the full changelist here.
  • Forum Updates - 4/11/2021
    Various changes have been made to the forums and a few categories. You can view the full changelist here.

A tutorial showing how to check if a player is online from the first letters of their name

Warning!
Hello , there have been no replies in this thread for more than 30 days.
Please make sure you have a valid reason before you reply to this thread or you may face moderation action.
#1
Here is a tutorial on how to check if a player is online from the first letters of their name.
Code:
cmd create online An example command showing how to check if a player is online from a part of their first name | /online <player>
cmd add online if varset(%args%[1]) = %false% then message %p% §cUsage: /online <player>
cmd add online if varset(%args%[1]) = %false% then exit
cmd add online %find% = %args%[1]
cmd add online %online% = onlineplayers()
cmd add online %num% = 0
cmd add online if %num% >= size(%online%) then goto 10
cmd add online if (lowercase(substring(%online%[%num%], 0, size(%find%))) = lowercase(%find%)) and (varset(%player%) = %false%) then %player% = %online%[%num%]
cmd add online %num% = %num% + 1
cmd add online goto 6
cmd add online if varset(%player%) = %false% then message %p% §c%find% isn't online.
cmd add online if varset(%player%) = %false% then exit
cmd add online message %p% %player% §ais online.
if you had the player "Steve" online then doing /online ste or /online S will say that Steve is online.