04.07.2014, 11:03
Hi all. can someone help me with team chat command? /f i mean.
i don't know how it works. i use zcmd.
have a good day
i don't know how it works. i use zcmd.
have a good day
CMD:f(playerid,params[])
{
new str[200],name[24];
GetPlayeName(playerid, name, 24);
format(str, sizeof(str), "{f0f000}[TEAM CHAT] {00cc00}%s : {ffffff}%s",name,params);
for(new i=0; i<=MAX_PLAYERS; i++)
{
If(!IsPlayerConnected(i))continue;
if(gteam[playerid] != gteam[i])continue;
SendClientMessage(i, -1, str);
}
return 1;
}
enum pInfo
{
pTeam
}
new PlayerInfo[MAX_PLAYERS][pInfo];
CMD:f(playerid, params[])
{
new text[128], Team, playername[32];
Team = PlayerInfo[playerid][pTeam];
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /f [text]");
foreach(Player, i)
{
if(PlayerInfo[i][pTeam] == Team)
{
new string[128];
format(string, sizeof(string), "[TEAM CHAT] %s (%d): %s", GetPlayerName(playerid,playername,sizeof(playername)), playerid, Text);
SendClientMessage(i, COLOR_RED, string);
}
}
return 1;
}