SA-MP Forums Archive
Little help needed with player ID's - 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: Little help needed with player ID's (/showthread.php?tid=316804)



Little help needed with player ID's - Da' J' - 08.02.2012

So i'm going to add there player ID's shown when they're writing in the normal chat. (Global)

Now when someone says something, it's only showing their name's. For an example:

Код:
Michell: Testing the chat
When i want it to be:
Код:
Michell (0): Testing the chat
How should i proceed? GetPlayerID? Or? :S


Re: Little help needed with player ID's - Nonameman - 08.02.2012

It's easy:

pawn Код:
public OnPlayerText(playerid, text[])
{
    new pName[MAX_PLAYER_NAME], msg[256];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(msg, sizeof(msg), "%s (%d): %s", pName, playerid, text);
    SendPlayerMessageToAll(playerid, msg);
    return 0;
}