Deleting y_ini files
#1

Hello everyone.
I was testing a register/login system and all was working fine untill i have noticed that when someone leaves the register dialog ,it kicks out yourself and it is counted as the account was created.I mean the ini file create the account when it must not.

pawn Код:
if(!response) return Kick(playerid);
So there is the line when the player press "ESC" or "Quit" it kicks out the player but it also create the ini file.

pawn Код:
[Player's Data]
AdminLevel = 0
VIPLevel = 0
Money = 0
Scores = 0
Kills = 0
Deaths = 0
There is the ini file made when someone press Quit.This must not be happening ; this file must not be made.

I was thinking on adding the fclose function on it - something like this

pawn Код:
if(!response)      
{
        Kick(playerid);
    new INI:file = INI_Open(Path(playerid));
    INI_Close(file);
    fremove(file);
}
Kicking the player then open the file and remove/close it.Of course that code won't work ,it was just an example but i need ideas..... thanks a lot!
Reply
#2

pawn Код:
new INI:file = INI_Open(Path(playerid));
    INI_Close(file);
    fremove(file);
INI tag is not the same as File tag.

And i wonder why you do that, just kick the player and thats it. The problem will be in your OnDialogResponse or OnPlayerConnect/OnPlayerDisconnect.
Reply
#3

I know that is not the same , but there is NOT a ini function to delete a normal file.And i have found a solution by myself.Just make a variable like "logged" (example) and check if the player is logged .If it is logged can save the info and if it is not it won't save anything.
Thanks anyway,
Reply
#4

OnPlayerDisconnect, do you save the player's info ? if yes it also gets called, maybe it's getting saved there
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)