// CHAT ADMIN
CMD:a(playerid, params[])
{
new text[128];
if(PlayerInfo[playerid][pAdmin]>=1)
if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /a(dmin) [Text]");
format(text,sizeof(text),"[Admin]%s: %s",GetName(playerid),params);
foreach(Player, i)
{
if(PlayerInfo[playerid][pAdmin]>=1)
{
SendClientMessage(i,COLOR_RED,text);
}
}
return 1;
}
if(PlayerInfo[playerid][pAdmin]>=1)
if(PlayerInfo[i][pAdmin]>=1)
CMD:t(playerid, params[])
{
new text[128];
if (gTeam[playerid] == TEAM_CT)
if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /t(eam) [Text]");
format(text,sizeof(text),"[TEAM]%s: %s",GetName(playerid),params);
foreach(Player, i)
{
if (gTeam[i] == TEAM_CT)
{
SendClientMessage(i,COLOR_LIGHTBLUE,text);
}
}
new text1[128];
if (gTeam[playerid] == TEAM_TE)
if(sscanf(params, "s[128]",text1)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /t(eam) [Text]");
format(text1,sizeof(text1),"[TEAM]%s: %s",GetName(playerid),params);
foreach(Player, i)
{
if (gTeam[i] == TEAM_TE)
{
SendClientMessage(i,COLOR_RED,text1);
}
}
return 1;
}
enum PlayerData{ InClan };
CMD:c(playerid, params[]) { format(userfile, 256, "/CLAN/%s.ini", GetName(playerid)); PlayerInfo[playerid][InClan] = dini_Int(userfile, "InClan"); if(PlayerInfo[playerid][InClan] < 1) return false; if(!strlen(params)) return SendClientMessage(playerid,RED,"Usage: /c [text]"); new name[24],string[256]; GetPlayerName(playerid,name,sizeof(name)); format(string,sizeof(string),"Clan Chat: %s (ID: %d): %s",name,playerid,params); SendClanMsg(LIGHTBLUE, string); return 1; }
stock SendClanMsg(color,string[]){ for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) == 1 && PlayerInfo[i][InClan] > 0) { SendClientMessage(i, color, string); } } return 1; }
CMD:setclanmember(playerid, params[]) { new player1, string[128], string2[128]; sscanf(params,"d",player1); if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "You must be RCON admin to set people to the clan!"); if(sscanf(params,"u",player1)) return SendClientMessage(playerid,RED,"Usage: /setclanmember [PlayerID/PartOfName]"); format(userfile, 128, "/CLAN/%s.ini", GetName(player1)); if(dini_Int(userfile, "InClan")==1) return SendClientMessage(playerid,RED,"That player is already in a clan!"); if(!IsPlayerConnected(player1) || player1 == INVALID_PLAYER_ID) return SendClientMessage(playerid,RED,"Invalid ID"); format(string, sizeof(string), "You are now in the clan!"); format(string2, sizeof(string2), "%s (ID: %d) is now in the clan!", GetName(player1), player1); if(!dini_Exists(userfile)) { SendClientMessage(player1, GREEN, string); SendClientMessage(playerid, GREEN, string2); dini_Create(userfile); dini_IntSet(userfile, "InClan",1); } return 1; }
gTeam[playerid] = GetPlayerTeam(playerid);
CMD:t(playerid, params[])
{
if(!isnull(params))
{
new string[128];
format(string,sizeof(string),"[TEAM]%s: %s",GetName(playerid),params);
foreach(Player, i)
{
if(gTeam[i] == gTeam[playerid]) SendClientMessage(i,COLOR_RED, string);
}
}
else return SendClientMessage(playerid, COLOR_WHITE, "Usage: /t(eam) [Text]");
return 1;
}
Try adding
pawn Код:
I think you have to redefine gTeam in every different callback/command/whatever |
new gTeam[MAX_PLAYERS];
new gTeam[MAX_PLAYERS];