Posts: 390
Threads: 119
Joined: Feb 2012
Reputation:
0
How to check if some player already has some name? For example I want to make /changemyname but how do I make the script check if that name already exist? Using YSI/Yini save system.
Posts: 7,801
Threads: 187
Joined: Feb 2010
Reputation:
0
Depending on how you've done your file-based system, you have to loop through the files and use strcmp to compare them with the name a person is trying to use. Most people set the name of the file to the username of the player who's information is in the file; so you'd have to loop through all file names to determine if the name someone wants exists or not.
.. another reason why I use MySQL!
Posts: 7,801
Threads: 187
Joined: Feb 2010
Reputation:
0
Oh, shit. Right. I always forget that function exists! lol