11.03.2011, 14:41
Quote:
My scripter actually created this and he is on holiday for two weeks now,
Could you edit it.. so I can use it with like saving OnPlayerDisconnect |
pawn Code:
public OnPlayerUpdate(playerid)
{
return 1;
}
pawn Code:
public OnPlayerDisconnect(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, "Password=%s\n", AccountInfo[playerid][aPassword]);fwrite(hFile, var);
format(var, 128, "IP=%s\n",ip);fwrite(hFile, var);
format(var, 128, "Level=%i\n", AccountInfo[playerid][aLevel]);fwrite(hFile, var);
format(var, 128, "Score=%i\n", PlayerScore);fwrite(hFile, var);
format(var, 128, "Money=%d\n", PlayerMoney);fwrite(hFile, var);
format(var, 128, "Airstrike=%i\n", airstrike[playerid]);fwrite(hFile, var);
format(var, 128, "Landmines=%i\n", LandMines[playerid]);fwrite(hFile, var);
format(var, 128, "Rank=%i\n", Rank[playerid]);fwrite(hFile, var);
fclose(hFile);
}
}
return 1;
}