Derpartmentchat problem

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
  • Hi Leute
    und zwar hab ich ein Problem ich hab SWAT hinzugefügt und bekomm es aber nicht hin das SWAT mit im /d chat schreiben kann.
    FBI, LSPD, Army sehen zwar was SWAT schreibt aber SWAT sieht es nicht selbst wie LSPD.. es sieht und SWAT kann auch nicht das lesen was LSPD... geschrieben haben.
    Kann mir da jemand helfen?
    Hier ma so wie ich`s bis jetzt habe:
    //----------------------------------[departments]-----------------------------------------------
    if(strcmp(cmd, "/departments", true) == 0 || strcmp(cmd, "/d", 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, COLOR_GRAD2, "Verwendung: (/d)epartments [text]");
    return 1;
    }
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
    {
    if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Polizeidirektor %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Polizeioberrat %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Polizeirat %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Polizeikommisar %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Polizei Officer %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Polizei Azubi %s: %s, over. **", sendername, result); }
    else
    {
    format(string, sizeof(string), "** Officer %s: %s, over. **", sendername, result);
    }
    SendMemberMessage(playerid, COLOR_ALLDEPT, string);
    SendLeaderMessage(playerid, COLOR_ALLDEPT, string);
    printf("%s", string);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
    if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Direktor %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Assistentdirektor %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Spezialagent 3 %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Spezialagent 2 %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Spezialagent 1 %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Professional Staff %s: %s, over. **", sendername, result); }
    else
    {
    format(string, sizeof(string), "** Intern %s: %s, over. **", sendername, result);
    }
    SendMemberMessage(playerid, COLOR_ALLDEPT, string);
    SendLeaderMessage(playerid, COLOR_ALLDEPT, string);
    printf("%s", string);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
    {
    if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** SWAT Direktor %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** SWAT Co-Direktor %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** SWAT Spezial-Agent %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** SWAT Agent %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** SWAT Member %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** SWAT Azubi %s: %s, over. **", sendername, result); }
    else
    {
    format(string, sizeof(string), "** Intern %s: %s, over. **", sendername, result);
    }
    SendMemberMessage(playerid, COLOR_ALLDEPT, string); SendLeaderMessage(playerid, COLOR_ALLDEPT, string); printf("%s", string); return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
    {
    if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** General %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Leutnant %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Captain %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Major %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Sergeant %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Privat %s: %s, over. **", sendername, result); }
    else
    {
    format(string, sizeof(string), "** Privat %s: %s, over. **", sendername, result);
    }
    SendMemberMessage(playerid, COLOR_ALLDEPT, string);
    SendLeaderMessage(playerid, COLOR_ALLDEPT, string);
    printf("%s", string);
    return 1;
    }
    else if(gTeam[playerid] == 1||PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4)
    {
    format(string, sizeof(string), "** Sanitäter %s: %s, over. **", sendername, result);
    SendMemberMessage(playerid, COLOR_ALLDEPT, string);
    SendLeaderMessage(playerid, COLOR_ALLDEPT, string);
    printf("%s", string);
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist kein Teil des Teams!");
    return 1;
    }
    }
    return 1;
    }

    Einmal editiert, zuletzt von [Gott] ()

  • mach bei sendmembermessage und leadermessage swat noch rein

  • könntest du mir das eventuell korigiert schreiben hitman wäre nett

  • //----------------------------------[departments]-----------------------------------------------
    if(strcmp(cmd, "/departments", true) == 0 || strcmp(cmd, "/d", 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))
    {
    SendClientMessageSwat(playerid, COLOR_GRAD2, "Verwendung: (/d)epartments [text]");
    return 1;
    }
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
    {
    if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Polizeidirektor %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Polizeioberrat %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Polizeirat %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Polizeikommisar %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Polizei Officer %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Polizei Azubi %s: %s, over. **", sendername, result); }
    else
    {
    format(string, sizeof(string), "** Officer %s: %s, over. **", sendername, result);
    }
    SendMemberMessageSwat(playerid, COLOR_ALLDEPT, string);
    SendLeaderMessageSwat(playerid, COLOR_ALLDEPT, string);
    printf("%s", string);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
    if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Direktor %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Assistentdirektor %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Spezialagent 3 %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Spezialagent 2 %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Spezialagent 1 %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Professional Staff %s: %s, over. **", sendername, result); }
    else
    {
    format(string, sizeof(string), "** Intern %s: %s, over. **", sendername, result);
    }
    SendMemberMessageSwat(playerid, COLOR_ALLDEPT, string);
    SendLeaderMessageSwat(playerid, COLOR_ALLDEPT, string);
    printf("%s", string);
    return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15)
    {
    if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** SWAT Direktor %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** SWAT Co-Direktor %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** SWAT Spezial-Agent %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** SWAT Agent %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** SWAT Member %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** SWAT Azubi %s: %s, over. **", sendername, result); }
    else
    {
    format(string, sizeof(string), "** Intern %s: %s, over. **", sendername, result);
    }
    SendMemberMessageSwat(playerid, COLOR_ALLDEPT, string); SendLeaderMessage(playerid, COLOR_ALLDEPT, string); printf("%s", string); return 1;
    }
    else if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
    {
    if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** General %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Leutnant %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Captain %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Major %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Sergeant %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Privat %s: %s, over. **", sendername, result); }
    else
    {
    format(string, sizeof(string), "** Privat %s: %s, over. **", sendername, result);
    }
    SendMemberMessageSwat(playerid, COLOR_ALLDEPT, string);
    SendLeaderMessageSwat(playerid, COLOR_ALLDEPT, string);
    printf("%s", string);
    return 1;
    }
    else if(gTeam[playerid] == 1||PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4)
    {
    format(string, sizeof(string), "** Sanitäter %s: %s, over. **", sendername, result);
    SendMemberMessageSwat(playerid, COLOR_ALLDEPT, string);
    SendLeaderMessageSwat(playerid, COLOR_ALLDEPT, string);
    printf("%s", string);
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist kein Teil des Teams!");
    return 1;
    }
    }
    return 1;
    }