16.08.2011, 16:56
I wrote this not tested. Uses sscanf2 plugin. (for getting initials)
It returns an array, and the first two chars are the initials.
EDIT: If you want them to be made capitals search for "ToUpper" function.
pawn Код:
ReturnInitials(playerid)
{
new
PName[MAX_PLAYER_NAME],
szSplitName1[MAX_PLAYER_NAME],
szSplitName2[MAX_PLAYER_NAME];//these sizes can be reduced but i think its safer this way
GetPlayerName(playerid, PName, MAX_PLAYER_NAME);
sscanf(PName, "p<_>s[24]s[24]", szSplitName1, szSplitName2);
strdel(PName, 0, MAX_PLAYER_NAME);
PName[0] = szSplitName1[0];
PName[1] = szSplitName2[0];
return PName;
}
EDIT: If you want them to be made capitals search for "ToUpper" function.