Checking YSI
#1

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.
Reply
#2

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!
Reply
#3

https://sampwiki.blast.hk/wiki/Fexist
Reply
#4

Oh, shit. Right. I always forget that function exists! lol
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)