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=76704)



ID in chat - Magie[CZ] - 05.05.2009

I want to in chat picture
Name [ID]: text

I have only this:
public OnPlayerText(playerid, text[])
{
new name[MAX_PLAYER_NAME];
name[playerid] = GetPlayerName(playerid, name[playerid], MAX_PLAYER_NAME);
SetPlayerName(playerid, name[playerid]);
if(text[0] != '!' || text[0] != '.')
SendPlayerMessageToAll(playerid, text);

And sorry for my bad English


Re: ID in chat - Danut - 05.05.2009

pawn Код:
new name[24];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"[%d]%s: %s",playerid,name,text);
ProxDetector(30.0,playerid,string,0xFF,0xFF,0xFF,0xFF,0xFF);
If you don't have ProxtDetector , just search it


Re: ID in chat - shitbird - 05.05.2009

Quote:
Originally Posted by MoroJr™
pawn Код:
new name[24];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"[%d]%s: %s",playerid,name,text);
ProxDetector(30.0,playerid,string,0xFF,0xFF,0xFF,0xFF,0xFF);
If you don't have ProxtDetector , just search it
Why use ProxtDetector? all he wants is the NAME [ID] : to display when someone is typing...

Anyways, to do that you should use this code.

pawn Код:
public OnPlayerText(playerid, text[])
{
    new pName[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, pName,sizeof(pName));
    format(string,sizeof(string),"%s[%i]: %s",pName,playerid,text);
    printf(string);
    // ircSay(EchoConnection, EchoChan,string); ONLY USE THIS IF YOU HAVE AN IRC CHANNEL.
    SendClientMessageToAll(COLOR_WHITE,string);
    return 0;
}