Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: zapisz/odczyt
1. Zapisz/Odczyt liczb
Witam, mam kod kt?ry zapisuje i odczytuje ilo?? score oli?? ilo?? pieni?dzy gracza z pliku.

Odczyt
[quote]
new pname[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "Konta/%s.ini", pname[playerid]);
PlayerInfo[playerid][pHajs] = GetPlayerMoney(playerid);
PlayerInfo[playerid][pExp] = GetPlayerScore(playerid);
if(dini_Exists(path))
{
dini_Int(path, "Exp", PlayerInfo[playerid][pExp]);
SendClientMessage(playerid, -1, "{00FF00}Twoja ilosc EXP'a to: {FF0000}%d", PlayerInfo[playerid][pExp]);
SetPlayerScore(playerid, PlayerInfo[playerid][pExp]);
dini_Int(path, "Hajs", PlayerInfo[playerid][pHajs]);
SendClientMessage(playerid, -1, "{00FF00}Twoja ilosc Hajsu to: {FF0000}%d", PlayerInfo[playerid][pHajs]);
SetPlayerMoney(playerid, PlayerInfo[playerid][pHajs]);
SendClientMessage(playerid, -1, "{FFFFFF}===========================================================================");
}[/quote]

Zapis
[quote]new pname[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "Konta/%s.ini", pname[playerid]);
PlayerInfo[playerid][pHajs] = GetPlayerMoney(playerid);
PlayerInfo[playerid][pExp] = GetPlayerScore(playerid);
if(dini_Exists(path))
{
dini_IntSet(path, "Exp", PlayerInfo[playerid][pExp]);
dini_IntSet(path, "Hajs", PlayerInfo[playerid][pHajs]);
}[/quote]

I wszys...