Problem with OnPlayerText
#1

Code I use
pawn Код:
public OnPlayerText(playerid, text[])
{
    new name[256],string[256];
    GetPlayerName(playerid,name,255);
    format(string,255,"%s(%d):%s",name,playerid,text);
    SendClientMessageToAll(GetPlayerColor(playerid),string);
    return 0;
}
Well I want to make it so whenever player writes something, it makes PlayerName(id): text, and this code works... It gives whole messsage with player team color...
But I want it to make PlayerName with team color, and text with white color...

I tried using SendPlayerMessageToAll, and deleting name from the format string, it actually works.. except it gives outcome PlayerNameid): text (is there way I can remove

Anyone can help please?
Reply
#2

pawn Код:
SendPlayerMessageToAll(playerid, string);
Reply
#3

I said I tried that, but it gives outcome with PlayerNameid): text , is there way of removing : after Playername and before (id)
Reply
#4

Код:
public OnPlayerText(playerid, text[])
{
	new string[128];
	format(string, sizeof(string), "[%d]: %s", playerid, text[0]);
	SendPlayerMessageToAll(playerid, string);
	return 0;
}
Reply
#5

Now it will give PlayerName:[id]: text....
There is still :
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)