showing the id of the player in chat?
#1

Is there any way to show the ID of the player in chat before his message?

Ex: PLAYERNAME (ID: ): MESSAGE.
Reply
#2

Takes just a few lines in OnPlayerText:

pawn Код:
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
Reply
#3

pawn Код:
//OnPlayerText
format(text, sizeof(text), "[%d] %s", playerid, text);
even easier, is it?
Reply
#4

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.
Reply
#5

Logitech90, try Cank's code.
Reply
#6

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
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.
what's about that
Код:
new name[24], txt[256];
	GetPlayerName(playerid, name, 24);
	format(txt, 256, "%s (%d): {FFFFFF}%s", name, playerid, text);
	SendClientMessageToAll(GetPlayerColor(playerid), txt);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)