11.02.2018, 16:19
Код:
#define USER_PATH "/Users/%s.ini"
Код:
UserPath(playerid){
// Declare our variables used in this function
new
str[36], // 'str' will be our variable used to format a string, the size of that string will never exceed 36 characters.
name[MAX_PLAYER_NAME]; // 'name' will be our variable used to store the player's name in the scope of this function. MAX_PLAYER_NAME is defined as 24.
// Get the player's name.
GetPlayerName(playerid, name, sizeof(name));
// Format USER_PATH with the name that we got with GetPlayerName.
format(str, sizeof(str), USER_PATH, name); // USER_PATH has been defined as: "/Users/%s.ini", %s will be replaced the player's name.
return str;
}
Код:
new INI:file = INI_Open(UserPath(playerid));
INI_SetTag(file, "PlayerData");
INI_WriteString(file, "Password", PlayerInfo[playerid][Password]);
INI_Close(file);

