ID in chat
#1

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

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
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)