View Single Post
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 03-18-2019 , 09:41   Re: INI File Reader/Writer AMXX 1.9
Reply With Quote #3

In a way yes, but I am not sure about the performance while working with a big number of data inside the file. You could save player's authid as section and organize the data between the keys.

Code:
new const FILENAME[] = "player_data.ini"; SavePlayerData(this) {     new szAuthId[MAX_AUTHID_LENGTH], iMoney;     get_user_authid(this, szAuthId, charsmax(szAuthId));     iMoney = cs_get_user_money(this); // e.g. 16000     ini_write_int(FILENAME, szAuthId, "Money", iMoney);     /* Result:     [STEAM_0:0:0000000]     Money = 16000     */ } LoadPlayerData(this) {     new szAuthId[MAX_AUTHID_LENGTH], iMoney;     get_user_authid(this, szAuthId, charsmax(szAuthId));     iMoney = cs_get_user_money(this);     ini_read_int(FILENAME, szAuthId, "Money", iMoney);     cs_set_user_money(this, iMoney); }

Update is already implemented. ini_write_* adds the key and value if the key does not already exists, otherwise it update.
__________________








CrazY. is offline