18.06.2012, 03:00
Hope it will Help You !
Код:
public OnPlayerText(playerid, text[])
{
if(text[0] == ',') // : can be changed to whatever symbol u wanna use for player to enable the teamchat.
{
new string[128]; GetPlayerName(playerid, string, sizeof(string)); // Making the new's
format(string, sizeof(string), "[Team Radio] %s: %s", string, text[1]); // Formatted the message
printf("%s", string); // Printed it BOTH ingame + the server log
for(new i = 0; i < MAX_PLAYERS; i++) // Getting the player team and color, required for formatting the msg.
{
if(IsPlayerConnected(i) && GetPlayerTeam(i) == GetPlayerTeam(playerid)) SendClientMessage(i, GetPlayerColor(playerid), string);
}
return 0;
}
