SA-MP Forums Archive
Name - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Name (/showthread.php?tid=330564)



Name - 3RoR - 01.04.2012

how to create a When a player uses /me /b or talk to show Name Name, not to show Name_Name ?


Re: Name - iGetty - 01.04.2012

Hope this helps.

pawn Код:
stock RemoveUnderScore(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        if(name[i] == '_') name[i] = ' ';
    }
    return name;
}
Edit:

Add this under your #include's

Preferably at the bottom of the script

When you want to format a name to a string, do it like this.

pawn Код:
command(b, playerid, params[])
{
    new message[128], string[256];
    if(sscanf(params, "s[128]", message)) return SendClientMessage(playerid, 0xFFFFFFF, "Server: /b [message]");
    {
        format(string, sizeof(string), "(( %s says: %s ))", RemoveUnderScore(playerid), message);
        SendClientMessage(playerid, COLOR, string);
    }
    return 1;
}