Checking YSI -
Squirrel - 01.05.2013
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.
Re: Checking YSI -
Scenario - 01.05.2013
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!
Re: Checking YSI -
2KY - 01.05.2013
https://sampwiki.blast.hk/wiki/Fexist
Re: Checking YSI -
Scenario - 01.05.2013
Oh, shit. Right. I always forget that function exists! lol
Re: Checking YSI -
Pottus - 02.05.2013
You could try this plugin
https://sampforum.blast.hk/showthread.php?tid=92246
native file_move(file[],destination[]); // Moves a file
Basically the same as renaming.