Posts: 386
Threads: 55
Joined: Nov 2013
Reputation:
0
Hi, i am editing PPC Trucking. When players are chatting, the player id isn't displaying with their name on chat box, how can i make the id shows up in this gamemode? Can anyone please help me?
Posts: 386
Threads: 55
Joined: Nov 2013
Reputation:
0
I tried putting this code at public OnPlayerText callback:
public OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "[%d] %s",playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}
But when player is chatting, there are double messages like this
PlayerName[0]: hi
PlayerName: hi
One with id and another without id, the one with id is made by me. So i want to disable the one without id, but can't find its location.
Posts: 1,177
Threads: 27
Joined: Sep 2011
Reputation:
0
You have to make sure that at the end of OnPlayerText, it says return 0; and not return 1;. Returning 0 prevents the default built-in message from being sent.
If it still gets sent, then an include or a plugin you're using may be the cause of this problem.