11.03.2013, 18:20
Pode-se fazer assim:
pawn Код:
CMD:cg(playerid,params[])
{
new
nome[MAX_PLAYER_NAME],
String[128],
Texto[120]
;
if(sscanf(params, "s[120]", texto)) return SendClientMessage(playerid, vermelho, "/cg [texto]");
GetPlayerName(playerid, nome, sizeof(nome));
format(String, sizeof(String), "[ChatGang] %s(%d): %s", nome, playerid, texto);
ChatGang(playerid, verdeescuro, String);
return 1;
}
forward ChatGang(playerid, color, string[]);
public ChatGang(playerid, color, string[])
{
for (new r = 0; r != MAX_PLAYERS; r++)
{
if (IsPlayerConnected(r))
{
if(gTeam[r] == gTeam[playerid])
{
SendClientMessage(r, color, string);
}
}
}
return 1;
}