Stripping a GetPlayerName to only the last name?
#1

Hi guys.

I have a question.
In my script, the players' name must be stripped down to only his last name.
Example: Robin_Smith>Smith
That's how it should happen. But I have no idea how.
Anyone got an idea or code? Thanks in advance.

EDIT: Nvm already found it.
pawn Код:
stock GetPlayerFirstName(playerid)
{
    new
        namestring[2][MAX_PLAYER_NAME],
        name[MAX_PLAYER_NAME];

    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    split(name, namestring, '_');
    return namestring[0];
}

stock GetPlayerLastName(playerid)
{
    new
        namestring[2][MAX_PLAYER_NAME],
        name[MAX_PLAYER_NAME];

    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    split(name, namestring, '_');
    return namestring[1];
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)