08.01.2018, 21:51
PHP Code:
//autor: AndySedeyn
FixUsername(name[]) {
new
tmp[MAX_PLAYER_NAME];
for(new i = 0, j = strlen(name); i <= j; i++) {
tmp[i] = name[i];
if(i == 0 && (name[i] <= 'A' || name[i] >= 'Z')) {
tmp[i] = toupper(name[i]);
}
else if(name[i-1] == '_' && (name[i] <= 'A' || name[i] >= 'Z')) {
tmp[i] = toupper(name[i]);
}
else if(name[i-1] != '_' && (name[i] >= 'A' || name[i] <= 'Z')) {
tmp[i] = tolower(name[i]);
}
}
return tmp;
}