need help with account update automatic OnplayerUpdate
#3

Quote:
Originally Posted by niCe
I'm not sure what do you mean with account update, but maybe posting the part of the script would be a good start.
pawn Code:
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);
                        new PlayerScore, PlayerMoney;
                        PlayerMoney = GetPlayerMoney(playerid);
                        PlayerScore = GetPlayerScore(playerid);
                        AccountInfo[playerid][aScore] = PlayerScore;
                        AccountInfo[playerid][aMoney] = PlayerMoney;
            if (hFile)
            {
                new var[128];
                format(var, 128, "Donotlook=%s\n", AccountInfo[playerid][aPassword]);fwrite(hFile, var);
                format(var, 128, "Donotlook=%s\n",ip);fwrite(hFile, var);
                format(var, 128, "Donotlook=%i\n", AccountInfo[playerid][aLevel]);fwrite(hFile, var);
                format(var, 128, "Donotlook=%i\n", PlayerScore);fwrite(hFile, var);
                format(var, 128, "Donotlook=%d\n", PlayerMoney);fwrite(hFile, var);
                format(var, 128, "Donotlook=%i\n", airstrike[playerid]);fwrite(hFile, var);
                format(var, 128, "Donotlook=%i\n", LandMines[playerid]);fwrite(hFile, var);
                format(var, 128, "Donotlook=%i\n", Rank[playerid]);fwrite(hFile, var);
                fclose(hFile);
            }
        }
    }
    return 1;
}

Encrypt(string[])
{
    for(new x=0; x < strlen(string); x++)
    {
        string[x] += (3^x) * (x % 15);
        if(string[x] > (0xff))
        {
            string[x] -= 256;
        }
    }
}
pawn Code:
forward OnPlayerUpdate(playerid);
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)