Insert a name before your name when using a command?
#10

I
Think
You
Can.

Something like this might work.
pawn Код:
RemoveUnderscoreFromName(playerid)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
   
    for(new i=0; i < MAX_PLAYER_NAME; ++i)
    {
        if(pName[i] == EOS)break;
        if(pName[i] == '_') pName[i] = ' ';
    }
    SetPlayerName(playerid, pName);
}
EDIT: Or if you don't want to change the players name for any reason.

pawn Код:
GetPlayerRpName(playerid)//couldn't think of a better name that is shorter than this.
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
   
    for(new i=0; i < MAX_PLAYER_NAME; ++i)
    {
        if(pName[i] == EOS)break;
        if(pName[i] == '_') pName[i] = ' ';
    }
    return pName;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)