How to remove "_" from names in RP servers?
#2

Use this:

pawn Code:
stock UnderscoreToSpaceName(playerid)
{
    new Name[MAX_PLAYER_NAME];
    if(IsPlayerConnected(playerid))
    {
        GetPlayerName(playerid, Name, sizeof(Name));
    }
    else
    {
        Name = "Disconnected/Nothing";
    }
    for(new name = 0; name < MAX_PLAYER_NAME; name++) if(Name[name] == '_') Name[name] = ' ';
    return Name;
}
So the command will look like this:


pawn Code:
new msg[256];
        if (sscanf(params, "s", msg)) SendClientMessage(playerid, COLOR_RED, "USAGE: /ann [text]");
        else {
            format(msg, sizeof(msg), "Announcement from %s: %s", UnderscoreToSpaceName(playerid), msg);
            SendClientMessageToAll(COLOR_LOCALMSG, msg);
            }
            }
    return 1;
}
Reply


Messages In This Thread
How to remove "_" from names in RP servers? - by Injector - 07.01.2011, 12:59
Re: How to remove "_" from names in RP servers? - by Alex_Valde - 07.01.2011, 13:05
Re: How to remove "_" from names in RP servers? - by Injector - 07.01.2011, 13:09
Re: How to remove "_" from names in RP servers? - by Alex_Valde - 07.01.2011, 13:10

Forum Jump:


Users browsing this thread: 1 Guest(s)