Deleting y_ini files - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Deleting y_ini files (
/showthread.php?tid=593565)
[Solved]Deleting y_ini files -
UploaD - 07.11.2015
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!
Re: Deleting y_ini files -
Gammix - 07.11.2015
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.
Re: Deleting y_ini files -
UploaD - 07.11.2015
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,
Re: Deleting y_ini files -
PrO.GameR - 07.11.2015
OnPlayerDisconnect, do you save the player's info ? if yes it also gets called, maybe it's getting saved there