03.03.2013, 18:38
pawn Код:
CMD:t(playerid, params[])
{
if(isnull(params)) return SP COLOR_RED,"USAGE: /t < Text >");
new str[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
for(new i = 0; i < MAX_PLAYERS; i++) //This so it loops thru all the players
{ //notice the bracket here..
if(gTeam[i] == gTeam[playerid])//so the message playerid sends will be sent to only team members..
{
format(str,sizeof(str),"[TEAM]: %s[%i]: %s",pName,playerid,params);
SendClientMessage(i,-1,str);
}
}
return 1;
}