Problem mit Fraktionschat

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • hier der CMD:



    if(strcmp(cmdtext, "/family", true) == 0 || strcmp(cmdtext, "/f", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    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, Grau, "Benutze: (/f)amily [Text]");
    return 1;
    }
    new string[64];
    new leader = GetPVarInt(playerid,"Leader");
    new member = GetPVarInt(playerid,"Fraktion");
    if( (member >= 1 && member <= 2) || (leader >= 0 && leader <= 1) )
    /*if( member != 21 && leader != 21 && member != 7 && leader != 7)*/
    {
    if(member==1)
    {
    if(GetPVarInt(playerid,"frakrank") == 6) { format(string, sizeof(string), "Polizeipredisent %s: %s. )) **", sendername, result); }
    else if(GetPVarInt(playerid,"frakrank") == 5) { format(string, sizeof(string), "Lieutnant %s: %s. )) **", sendername, result); }
    else if(GetPVarInt(playerid,"frakrank") == 4) { format(string, sizeof(string), "Oberkommissar %s: %s. )) **", sendername, result); }
    else if(GetPVarInt(playerid,"frakrank") == 3) { format(string, sizeof(string), "Bewährungshelfer %s: %s. )) **", sendername, result); }
    else if(GetPVarInt(playerid,"frakrank") == 2) { format(string, sizeof(string), "Officer %s: %s. )) **", sendername, result); }
    else if(GetPVarInt(playerid,"frakrank") == 1) { format(string, sizeof(string), "Cadet %s: %s. )) **", sendername, result); }
    SendFamilyMessage(GetPVarInt(playerid,"Fraktion"), ChatGrün, string);
    }
    else if(leader==1)
    {
    format(string, sizeof(string), "Polizeipresident %s: %s. )) **", sendername, result);
    SendFamilyMessage(GetPVarInt(playerid,"Fraktion"), ChatGrün, string);
    }
    printf("%s", string);
    return 1;
    }
    return 1;
    }
    return 1;
    }