OnPlayerText :(
#1

i want to make that when players sends a message it should be displayed as

[ID:2]BlaBla: Bla bla.....

instead of

BlaBla: [ID:2] how?
Reply
#2

pawn Код:
public OnPlayerText(playerid, text[])
{
    new Msg[128], Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, sizeof(Name));
    format(Msg, sizeof(Msg), "[ID: %d] %s: %s", playerid, Name, text);
    SendClientMessageToAll(GetPlayerColor(playerid), Msg);
    return 0;
}
Reply
#3

pawn Код:
public OnPlayerText(playerid, text[])
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    new msg[128];
    format(msg, sizeof(msg), "{323299}[ID: %d]{FFFFFF}%s:{FFFFFF} %s",playerid,pname, text);
    SendPlayerMessageToAll(playerid, msg);
    return 0;
}
I tried this but sends message as

Blabla:[ID: 5]Blabla: this is what it is comming.
Reply
#4

You have placed this "SendPlayerMessageToAll(playerid, msg);"
remove it and put SendClientMessageToAll(GetPlayerColor(playerid), msg);
Reply
#5

Now Player messages are not even displayed
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)