User File Problem
#1

When i use a command that will change user file info then all gets delete from the user like:
I type /makeadmin and it succefly makes it and i /q.
but when i check the scripting files I find a black userfile.. It is full before the cmd.
i putted onplayerupdate after onplayerdisconnect:

Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(AccountInfo[playerid][aLogged] == 1)
        {
            new string3[128];
            new playername3[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername3, sizeof(playername3));
            format(string3, sizeof(string3), ACCOUNTS_FOLDER, playername3);
            new ip[20];
            GetPlayerIp(playerid,ip,sizeof(ip));
            new File: hFile = fopen(string3, io_write);
            if (hFile)
            {
            	new var[128];
             	format(var, 128, "Password=%s\n", AccountInfo[playerid][aPassword]);fwrite(hFile, var);
             	format(var, 128, "IP=%s\n",ip);fwrite(hFile, var);
        				format(var, 128, "EE=%d\n", AccountInfo[playerid][aEE]);fwrite(hFile, var);
        				format(var, 128, "Admin=%d\n", AccountInfo[playerid][aAdmin]);fwrite(hFile, var);
        				format(var, 128, "Tut=%d\n", AccountInfo[playerid][aTut]);fwrite(hFile, var);
        				format(var, 128, "Faction=%d\n", AccountInfo[playerid][aFaction]);fwrite(hFile, var);
            }
        }
    }
    return 1;
}
this aint GF or any other gm
Reply


Messages In This Thread
User File Problem - by Naruto4 - 07.12.2009, 15:16
Re: User File Problem - by [Marevin*] - 07.12.2009, 15:18
Re: User File Problem - by Naruto4 - 07.12.2009, 15:19
Re: User File Problem - by Correlli - 07.12.2009, 15:20
Re: User File Problem - by Naruto4 - 07.12.2009, 15:22
Re: User File Problem - by [Marevin*] - 07.12.2009, 15:22
Re: User File Problem - by Correlli - 07.12.2009, 15:23

Forum Jump:


Users browsing this thread: 2 Guest(s)