SA-MP Forums Archive
ID beside the name in the chatbox - 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 beside the name in the chatbox (/showthread.php?tid=146737)



ID beside the name in the chatbox - Jokerstyle - 08.05.2010

I have a big (noobish) problem.

I want the playerid to appear next to the playername in the chatbox, like: Razor[MM] (0): textdsfsgsgfdgh

I tried this:
Код:
new string[255];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s [%d]: %s", playername, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid),string);



Re: ID beside the name in the chatbox - Jochemd - 08.05.2010

That should work?


Re: ID beside the name in the chatbox - Jokerstyle - 09.05.2010

Yea, it should, but it is like:
Код:
Razor: (0) test
Razor: test
So, it sends the message two times, is there anyway to fix it?


Re: ID beside the name in the chatbox - RyDeR` - 09.05.2010

You have to return false, otherwise your normal chat will send also.

So we got this: >.>
Код:
new string[255];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s [%d]: %s", playername, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 0;