Geting Player's Name
#1

How can I make command that will get players name .

If player has a name: Tony_Montana.

How can I get only Tony from his name..?

EDIT: Solved!
Lock!
Reply
#2

pawn Код:
stock GetPlayerFirstName(playerid)
{
    new namestring[2][MAX_PLAYER_NAME];
    new 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];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    split(name, namestring, '_');
    return namestring[1];
}
You're welcome!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)