help with number plates + another question
#10

I wrote this not tested. Uses sscanf2 plugin. (for getting initials)

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;
}
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.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)