Need Help With Y_INI
#1

Hi guys.

I made a Login/register system using Y_INI but my problem is OnPlayerDisconnect. What happes is that it doesn't replace the text instead it makes new ones.

Inside the .ini

[Player Data Of gtakilleriv]
Password = 177406563
Cash = 0
Admin = 0
Kills = 0
Score = 0
Ip = 127.0.0.1
Deaths = 0
[Player Data Of gtakilleriv]
Cash = 0
Admin = 0
Kills = 0
Score = 0
Deaths = 0


It's like that I'm not sure what's wrong. My OnPlayerDisconnect :-

Код:
public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    new name[MAX_PLAYER_NAME],string1[50];
   	GetPlayerName(playerid, name, sizeof(name));
	format(string1,sizeof(string1), "Player Data Of %s", name);
	INI_SetTag(File,string1);
	INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
	INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
	INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
	INI_WriteInt(File, "Score", PlayerInfo[playerid][pScore]);
	INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
	INI_Close(File);
	return 1;
}
I'm not sure what's wrong it did the same thing when I made a "/makeadmin" command, instead of replacing the current text it made a new one.

Thank you.
Reply
#2

Well thanks for your help I will see it now.

I hope in your new release(If there is gonna be one) you can add spaces

Anyways thanks for your great work ******.
Reply
#3

Alright I will use that thanks for your help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)