ID beside the name in the chatbox
#1

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);
Reply
#2

That should work?
Reply
#3

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?
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)