Hallo Breadfish,
also ich habe ein Problem und zwar,ich habe 2 Chat´s für zwei verschiedene Teams:
//Chat´s-----------------------------------------------------------------------------------------------------------------------------------
if(strcmp(cmd, "/r", true) == 0 || strcmp(cmd, "/radio", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Verwendung: (/r)adio [Army Chat]");
return 1;
}
format(string, sizeof(string), "**Army %s: %s", sendername, result);
if(gTeam[playerid] == TEAM_ARMY)
{
SendArmyMessage(COLOR_ARMY, string);
}
printf("Army %s: %s", sendername, result);
}
return 1;
}
if(strcmp(cmd, "/t", true) == 0 || strcmp(cmd, "/terror", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Verwendung: (/t)error [Terror Chat]");
return 1;
}
format(string, sizeof(string), "**Terrorist %s: %s", sendername, result);
if(gTeam[playerid] == TEAM_TERROR)
{
SendTerrorMessage(COLOR_TERRORCHAT, string);
}
printf("Terrorist%s: %s", sendername, result);
}
return 1;
}
Nur jetzt wenn ich z.B "/t lol" eingebe(Als Team_TERROR) steht dann bei den Army´s " Army Bullet2010: lol"
Ich kriege es einfach nicht hin das es nur bei Team Terror steht-.-
Mit freundlichen Grüßen
Bullet2010