Issue with y_ini
#1

Since I updated old YSI to new one (3.1) I have issue related to deleting files.

So I have this deleteacc command which I use for deletting accounts, and it is very simple...
If I am admin (of certain level or more) + sscanf for string (because Name_Surname is string), if account of that string exist, script removes it (with fremove funcion).

Before updating the YSI it all worked fine.
But, as I tested it on my home server, I created new account... and quited the game. After that I tryed to delete account manually... I got some error saying something like 'file in use, cannot be removed etc.'

And next thing I wanted to see is the fremove funcion => https://sampwiki.blast.hk/wiki/Fremove
Where it says => Note: If the file you are attempting to delete is open at the time that fremove is used, it will not work. You must first use fclose before you try deleting it, that is, if you have used fopen.

My question would be: Is there a way to fix this or this is because of y_ini include ..

Btw: I have /changename command also 'not working' as it should. (Set new player name, create new file for name, update the player to new file, delete the old file - it doesnt want to, so it acctually creates 1 extra account)

Thanks for reading.
Reply
#2

The file functions(file.inc) don't have anything to do with y_ini. Just close the file before deleting it, that simple.

Post the code for your setname command.
Reply
#3

EDIT: Solved.

I was using fopen to create files (but I dint fclose them) so they remained opened all the time (after player registration, and also, after /changename)..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)