Hallo, ich habe einen Teamchat gemacht
dcmd_tc(playerid,params[])
{
if(gTeam[playerid]==1 || gTeam[playerid]==2 || gTeam[playerid]==5 || gTeam[playerid]==7 || FreuSFPD[playerid] ==1 || FreuCOBRA[playerid] ==1 || FreuARMY[playerid] ==1 || FreuARZT[playerid] ==1)
{
new text[128];
if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid,COLOR_YELLOW,"Benutzung: /tc [Text]");
new aname[MAX_PLAYER_NAME], astr[256];
GetPlayerName(playerid, aname, sizeof(aname));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i]==1 ||gTeam[i]==2 ||gTeam[i]==5 ||gTeam[i]==7 || FreuSFPD[i] ==1 || FreuCOBRA[i] ==1 || FreuARMY[i] ==1 )
{
format(astr, sizeof(astr), "Team-Chat %s: %s ", aname, text);
SendClientMessage(i,COLOR_TOMATO, astr);
}
}
print(astr);
}
if(gTeam[playerid]==3|| FreuHITMAN[playerid] ==1)
{
new text[128];
if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid,COLOR_YELLOW,"Benutzung: /tc [Text]");
new aname[MAX_PLAYER_NAME], astr[256];
GetPlayerName(playerid, aname, sizeof(aname));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i]==3 || FreuHITMAN[i] ==1 )
{
format(astr, sizeof(astr), "Team-Chat %s: %s ", aname, text);
SendClientMessage(i,COLOR_TOMATO, astr);
}
}
print(astr);
}
if(gTeam[playerid]==4 || FreuOEATMC[playerid] ==1)
{
new text[128];
if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid,COLOR_YELLOW,"Benutzung: /tc [Text]");
new aname[MAX_PLAYER_NAME], astr[256];
GetPlayerName(playerid, aname, sizeof(aname));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i]==4 || FreuOEATMC[i] ==1 )
{
format(astr, sizeof(astr), "Team-Chat %s: %s ", aname, text);
SendClientMessage(i,COLOR_TOMATO, astr);
}
}
print(astr);
}
if(gTeam[playerid]==6|| FreuPCC[playerid] ==1)
{
new text[128];
if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid,COLOR_YELLOW,"Benutzung: /tc [Text]");
new aname[MAX_PLAYER_NAME], astr[256];
GetPlayerName(playerid, aname, sizeof(aname));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i]==6 || FreuPCC[i] ==1 )
{
format(astr, sizeof(astr), "Team-Chat %s: %s ", aname, text);
SendClientMessage(i,COLOR_TOMATO, astr);
}
}
print(astr);
}
if(gTeam[playerid]==8 || FreuLCN[playerid] ==1)
{
new text[128];
if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid,COLOR_YELLOW,"Benutzung: /tc [Text]");
new aname[MAX_PLAYER_NAME], astr[256];
GetPlayerName(playerid, aname, sizeof(aname));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i]==8 || FreuLCN[i] ==1 )
{
format(astr, sizeof(astr), "Team-Chat %s: %s ", aname, text);
SendClientMessage(i,COLOR_TOMATO, astr);
}
}
print(astr);
}
if(gTeam[playerid]==12 || FreuORF[playerid] ==1)
{
new text[128];
if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid,COLOR_YELLOW,"Benutzung: /tc [Text]");
new aname[MAX_PLAYER_NAME], astr[256];
GetPlayerName(playerid, aname, sizeof(aname));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i]==12 || FreuORF[i] ==1 )
{
format(astr, sizeof(astr), "Team-Chat %s: %s ", aname, text);
SendClientMessage(i,COLOR_TOMATO, astr);
}
}
print(astr);
}
return 1;
}
aber wenn ich was schreibe dann kommt der Text 2mal
aber wenn ich alle GTeams bis auf eines weg tut dann geht es
Bitte um Hilfe
MFG
runner23