04.12.2012, 17:28
How to make that when a People type what and he send it in the chat, that the ID is too screened? Like "Blackazur (0): test".
public OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "%s(%d): %s" GetName(playerid), playerid, text);
SendClientMessageToAll(-1, string);
return 0;
}
stock GetName(playerid) { new name[24]; GetPlayerName(playerid, name, sizeof(name)); return name; }
format(string, sizeof(string), "%s(%d): %s" GetName(playerid), playerid, text); |
public OnPlayerText(playerid,text[])
{
new string[256];
format(string, sizeof(string), "{FFFF00}(%i):{FFFFFF} %s",playerid, text);
SendPlayerMessageToAll(playerid,string);
return 0;
}
You forgot to include the name in the format string and to pass it.
|
pawn Код:
Код:
stock GetName(playerid) { new name[24]; GetPlayerName(playerid, name, sizeof(name)); return name; } |