How to Make [playerid] before the name on the chatbox
#1

How to Make [playerid] before the name on the chatbox

Thank You
Reply
#2

maybe, OnPlayerText?? i dunno :P
Reply
#3

pawn Код:
public OnPlayerText(playerid,text[]){
new msg[150];
format(msg,sizeof(msg),"[%d] %s",playerid,text);
SentPlayerMessageToAll(playerid,msg);
return 0;
}
Should work
Reply
#4

Quote:
Originally Posted by Kurence
pawn Код:
public OnPlayerText(playerid,text[]){
new msg[150];
format(msg,sizeof(msg),"[%d] %s",playerid,text);
SentPlayerMessageToAll(playerid,msg);
return 0;
}
Should work
You did typo so incase he copies and pastes and gets errors:

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

And i would advise add the name too and reduce the string to 128 cells


pawn Код:
public OnPlayerText(playerid,text[]){
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
new msg[128];
format(msg,sizeof(msg),"[%d] %s: %s",playerid,name,text);
SendPlayerMessageToAll(0xFFFFFF,msg);
return 0;
}

Edit: And use a color which isn't playerid
Reply
#6

I'll test
Reply
#7

Quote:
Originally Posted by Noredine
I'll test
okey.
Reply
#8

Doesn't work
Reply
#9

Код:
	if( text[ 0 ] )
	{
		new idtext[ 128 ];
		format( idtext, 128, "(%d) %s", playerid, text );
		SendPlayerMessageToAll( playerid, idtext );
		return 0;
	}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)