09.04.2013, 20:21
pawn Код:
new name[MAX_PLAYER_NAME], letters[2][2];
//Get the first letter as we already know whats the position
format(letters[0], 2, "%s", name[0]);
//Loop through all of the letters in the name
for (new i = 0; i < MAX_PLAYER_NAME; i++) {
//Check if this is the underscore we are looking for first
if (name[i] == '_') {
//Its the underscore, meaning the next letter will be +1 index ahead
format(letters[1], 2, "%s", name[i+1]);
// We dont need to search anything anymore as we found our letters already
break;
}
}
printf("%s %s", letters[0], letters[1]);