SA-MP Forums Archive
Chat System Help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Chat System Help (/showthread.php?tid=155158)



Chat System Help - ||.Rier.|| - 17.06.2010

Hello There...
I got a question to ask. Here it is

In RP Servers if we talk without any commands it will be:
i.e
John_Smith: Hello There Sir
Tyler_Ran: Hello Sir.

But I wanted that the"_" is gone.
How to do it?
i.e.
John Smith: Hello There Sir
Tyler Ran: Hello Sir.

See the "_" is gone. How do I do it in my script?

Thanks


Re: Chat System Help - ||.Rier.|| - 17.06.2010

Little Bump..

I need help really. Thanks


Re: Chat System Help - RyDeR` - 17.06.2010

pawn Код:
new
    pName[MAX_PLAYER_NAME]
;
GetPlayerName(playerid, pName, sizeof(pName));
pName[strfind(pName, "_", true)] = ' ';



Re: Chat System Help - ||.Rier.|| - 17.06.2010

Thx but..

It's not working


Re: Chat System Help - Niixie - 17.06.2010

Here the function i use, you can have it.

Код:
stock Name(playerid)
{
  	new name[MAX_PLAYER_NAME], stri[24];
  	GetPlayerName(playerid,name,24);
  	strmid(stri,name,0,strlen(name),24);
  	for(new i = 0; i < MAX_PLAYER_NAME; i++) { if (stri[i] == '_') stri[i] = ' '; }
  	return stri;
}
E.g.

Код:
OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "%s: %s", Name(playerid), text);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 0;
}