id in chat
#1

Hello guys

I'm trying to put the id of the players next to their name in the chat but all I'm getting is an empty line
in the chatlog. Any idea what I'm doing wrong here?

Код:
public OnPlayerText(playerid, text[])
{
	new Pname[MAX_PLAYER_NAME];
	new string[162];
	GetPlayerName(playerid,"Pname",sizeof(Pname));
	format(string,sizeof(string),"[%d][%s]: %s",playerid, Pname, text);
	SendClientMessageToAll(GetPlayerColor(playerid),string);
	return 0;
}
Reply
#2

Copied from my GameMode

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[128], playername[MAX_PLAYER_NAME];
    new PlayerColor = GetPlayerColor(playerid);
    GetPlayerName(playerid, playername, sizeof(playername));
    format(string, sizeof(string), "[%s][%d]: {FFFFFF}%s", playername, playerid, text);
    SendClientMessageToAll(PlayerColor, string);
    return 0;
}
It will be like...:
[Unknown][0]: Hello There!

Hello There! Will be White (FFFFFF)
Reply
#3

Hm, still not working for me seems like I have a bug somewhere else.

EDIT: Nvm, seems like a filterscript was causing the trouble. Ty anyways .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)