15.08.2013, 16:15
simple team chat try if works
pawn Код:
forward TeamChat(playerid,string[]);
public TeamChat(playerid,string[])
{
foreach(Player,i)
{
if(GetPlayerTeam(i) == GetPlayerTeam(playerid))
{
SendClientMessage(i,-1,string);
}
}
return 1;
}
CMD:tc(playerid,params[])
{
new text[128],pName[MAX_PLAYER_NAME],formatted[156];
if(sscanf(params,"s[128]",text)) return SendClientMessage(playerid,-1,"Usage: /tc [teamchat text]");
GetPlayerName(playerid,pName,sizeof(pName));
format(formatted,sizeof(formatted),"[Team Chat]: %s(%d): %s",pName,playerid,text);
TeamChat(playerid,formatted);
return 1;
}