15.09.2012, 13:47
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 :-
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.
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; }
Thank you.