12.12.2009, 20:25
By putting it under OnPlayerDisconnect it dident save when I got the money ingame or at Disconnect...
Код:
public OnPlayerDisconnect(playerid, reason) { gPlayerLogged[playerid] = 0; if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid]) { new string3[32]; new pname3[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname3, sizeof(pname3)); format(string3, sizeof(string3), "%s.ini", pname3); new File: pFile = fopen(string3, io_write); if (pFile) { new var[32]; format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(pFile, var); fclose(pFile); new File: hFile = fopen(string3, io_append); PlayerInfo[playerid][pMoney] = GetPlayerMoney(playerid); format(var, 32, "Money:%d\n",PlayerInfo[playerid][pMoney]);fwrite(hFile, var); format(var, 32, "Bank:%d\n",PlayerInfo[playerid][pBank]);fwrite(hFile, var); fclose(hFile); } } } return 1; }