SA-MP Forums Archive
Remove "_" from playernames. - 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: Remove "_" from playernames. (/showthread.php?tid=557684)



Remove "_" from playernames. - xX4m4zingXx - 14.01.2015

Hello,
I want to remove the underscores "_" from the player names.
How would I do that?
I have added this into my commands.pwn
Код:
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;
}
How would I add that to my command?
Код:
if(!strcmp(cmdtext, "/me", true, 3))
	{
	    if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [action]");
	    new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
        SendClientMessageToAll(0xFFFF00AA, str);
		return 1;
	}
greets


Re: Remove "_" from playernames. - CodyHawkins - 14.01.2015

Read this: https://sampforum.blast.hk/showthread.php?tid=336052
Removing "_" from names and /me cmd included in the link above.