[SOLVED] ID beside name on chat
#1

how do you make it so it shows their playerID next to their name on the chat?
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
  new string[128], playername[MAX_PLAYER_NAME];
  GetPlayerName(playerid, playername, sizeof(playername));
  format(string, sizeof(string), "%s (%i): %s", playername, playerid, text);
  SendClientMessageToAll(0xFFFFFFAA, string);
  return 0;
}
Reply
#3

Quote:
Originally Posted by Don Correlli
pawn Код:
public OnPlayerText(playerid, text[])
{
  new string[128], playername[MAX_PLAYER_NAME];
  GetPlayerName(playerid, playername, sizeof(playername));
  format(string, sizeof(string), "%s (%i): %s", playername, playerid, text);
  SendClientMessageToAll(0xFFFFFFAA, string);
  return 1;
}
How will that work? It'll just say things twice won't it?
Reply
#4

This code will show

playername playerid : Message(chat)
Reply
#5

No, it'll show the default SA:MP message "Playername: message" then it'll show "playername playerid : Message" directly underneath afaik. Correct me if I'm wrong.
Reply
#6

Quote:
Originally Posted by » Pawnst★r «
No, it'll show the default SA:MP message "Playername: message" then it'll show "playername playerid : Message" directly underneath afaik. Correct me if I'm wrong.
Well, return 0 at OnPlayerText and it won't.
Reply
#7

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by » Pawnst★r «
No, it'll show the default SA:MP message "Playername: message" then it'll show "playername playerid : Message" directly underneath afaik. Correct me if I'm wrong.

Well, return 0 at OnPlayerText and it won't.
If you return 0 ... that'll make OnPlayerText unusable will it not?
Reply
#8

Quote:
Originally Posted by » Pawnst★r «
Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by » Pawnst★r «
No, it'll show the default SA:MP message "Playername: message" then it'll show "playername playerid : Message" directly underneath afaik. Correct me if I'm wrong.

Well, return 0 at OnPlayerText and it won't.
If you return 0 ... that'll make OnPlayerText unusable will it not?
No, it wont
Reply
#9

So ... if I return 0 ... in OnPlayerText ... I can still use OnPlayerText as normal? So what does return 0 do then
Reply
#10

It only stops the text being sent to player clients I guess..

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)