SA-MP Forums Archive
id in chat - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: id in chat (/showthread.php?tid=222659)



id in chat - per~fectionist - 07.02.2011

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;
}



Re: id in chat - Unknown123 - 07.02.2011

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)


Re: id in chat - per~fectionist - 07.02.2011

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 .