[SOLVED] ID beside name on 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: [SOLVED] ID beside name on chat (
/showthread.php?tid=98976)
[SOLVED] ID beside name on chat -
BP13 - 24.09.2009
how do you make it so it shows their playerID next to their name on the chat?
Re: ID beside name on chat -
Correlli - 24.09.2009
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;
}
Re: ID beside name on chat -
ded - 24.09.2009
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?
Re: ID beside name on chat -
Peter_Corneile - 24.09.2009
This code will show
playername playerid : Message(chat)
Re: ID beside name on chat -
ded - 24.09.2009
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.
Re: ID beside name on chat -
Correlli - 24.09.2009
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.
Re: ID beside name on chat -
ded - 24.09.2009
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?
Re: ID beside name on chat -
BMUK - 24.09.2009
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
Re: ID beside name on chat -
ded - 24.09.2009
So ... if I return 0 ... in OnPlayerText ... I can still use OnPlayerText as normal? So what does return 0 do then
Re: ID beside name on chat -
BMUK - 24.09.2009
It only stops the text being sent to player clients I guess..