03.06.2016, 17:21
Howdy,
I'm trying to fix a public chat where the players color are the player of their nickname when they chat in the public chat. However when i try to fix this with SendPlayerMessageToAll, the message comes up x times as how many players are online. So if two players are online, the message comes up two times..
Code:
I've tried to format it and some other ways, but it comes always out with the same output or errors. However this code does not give error, but i have the problem mentioned above.
I'm trying to fix a public chat where the players color are the player of their nickname when they chat in the public chat. However when i try to fix this with SendPlayerMessageToAll, the message comes up x times as how many players are online. So if two players are online, the message comes up two times..
Code:
Код:
CMD:o(playerid, params[]) { if (g_StatusOOC && PlayerData[playerid][pAdmin] < 2) return SendErrorMessage(playerid, "An administrator has disabled global OOC chat."); if (isnull(params)) return SendSyntaxMessage(playerid, "/o [global OOC]"); if (PlayerData[playerid][pDisableOOC]) return SendErrorMessage(playerid, "You must enable OOC chat first."); if (strlen(params) < 128) { foreach (new i : Player) if (!PlayerData[i][pDisableOOC] && PlayerData[i][pCreated]) { SendPlayerMessageToAll(playerid, params); } } return 1; }