04.08.2016, 00:33
You don't have to set the player's name. Use the 'UsernameToLower' function when checking the user's file:
The function above is then used in for example the following situations:
This line:
Will turn the user's name into lowercase without actually changing their names. It then returns the path of the user's file in lowercase.
PHP Code:
#define USER_PATH "/users/%s.ini"
UserPath(playerid) {
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(path, sizeof(path), USER_PATH, UsernameToLower(name));
return path;
}
PHP Code:
if(fexist(UserPath(playerid)))
PHP Code:
INI_ParseFile(UserPath(playerid), "LoadUser_data", .bExtra = true, .extra = playerid);
// Change 'LoadUser_data' to whatever your function is called.
// And _'data' to whatever your filetag is.
PHP Code:
format(path, sizeof(path), USER_PATH, UsernameToLower(name));