SA-MP Forums Archive
OnPlayerText :( - 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)
+--- Thread: OnPlayerText :( (/showthread.php?tid=519851)



OnPlayerText :( - kesarthakur - 16.06.2014

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?


Re: OnPlayerText :( - iOxide - 16.06.2014

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



Re: OnPlayerText :( - kesarthakur - 16.06.2014

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.


Re: OnPlayerText :( - iOxide - 16.06.2014

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


Re: OnPlayerText :( - kesarthakur - 16.06.2014

Now Player messages are not even displayed