20.11.2010, 14:35
Is there any way to show the ID of the player in chat before his message?
Ex: PLAYERNAME (ID: ): MESSAGE.
Ex: PLAYERNAME (ID: ): MESSAGE.
new name[24], txt[256];
GetPlayerName(playerid, name);
format(txt, 256, "%s (%d): %s", name, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), txt);
return 0; //this is important, or the message will be sent twice
//OnPlayerText
format(text, sizeof(text), "[%d] %s", playerid, text);
C:\Documents and Settings\k\Desktop\COD5.pwn(5266) : warning 202: number of arguments does not match definition C:\Documents and Settings\k\Desktop\COD5.pwn(5272) : warning 225: unreachable code Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings.
I tried mauzen code but i get this.
Код:
C:\Documents and Settings\k\Desktop\COD5.pwn(5266) : warning 202: number of arguments does not match definition C:\Documents and Settings\k\Desktop\COD5.pwn(5272) : warning 225: unreachable code Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings. |
new name[24], txt[256]; GetPlayerName(playerid, name, 24); format(txt, 256, "%s (%d): {FFFFFF}%s", name, playerid, text); SendClientMessageToAll(GetPlayerColor(playerid), txt);