/department chat

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
  • Moin aso mein /department chat geht für jeden ausser rang 6 SAPD (mitleader rechten)


    hier ist der scrip ^^


    if(strcmp(cmd, "/department", 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)
    {
    if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Chief %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Captain %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Leutnant %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Sergeant %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Officer %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Cadet %s: %s, over. **", sendername, result); }
    else
    {
    format(string, sizeof(string), "** Officer %s: %s, over. **", sendername, result);
    }
    SendTeamMessage(2, COLOR_ALLDEPT, string);
    SendTeamMessage(1, COLOR_ALLDEPT, string);
    printf("%s", string);
    return 1;
    }


    /EDIT aso /Gov geht auch ab rank 5 ! und 6 Aber es geht nicht mit leader rechte helft mir bitte


    if(strcmp(cmd, "/government", true) == 0 || strcmp(cmd, "/gov", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(gTeam[playerid] != 1)
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist kein Polizist!");
    return 1;
    }
    if(PlayerInfo[playerid][pRank] < 6)
    {
    SendClientMessage(playerid, COLOR_GREY, "Du musst mindestens Rank 5 sein, um das zu benutzen!");
    return 1;
    }
    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: (/gov)ernment [text]");
    return 1;
    }
    SendClientMessageToAll(COLOR_WHITE, "|___________ Government News Meldung ___________|");
    format(string, sizeof(string), "Officer %s: %s", sendername, result);
    SendClientMessageToAll(COLOR_DBLUE, string);
    }
    return 1;
    }

  • Das ist ein Bug, Scriptseitig.. hatte ich darmals auch mal...


    Ich musste von einem Leader einer anderen Fraktion invitet und dann uninvitet.. dannach wieder Leader machen und es klappt wieder... kA wieso das nicht ging^^

    Die deutsche Rechtschreibung ist Freeware, sprich du darfst sie kostenlos nutzen...
    Sie ist aber nicht Open Source, somit darfst du sie nicht verändern oder in veränderter Form veröffentlichen!


  • das hilft mir aber nich tweiter <.< xD in anderen scripts geht es ja auch o.0



    HELFT MIR PLS !

    Einmal editiert, zuletzt von GabbaFreaK ()


  • if(PlayerInfo[playerid][pRank] < 6)
    {
    SendClientMessage(playerid, COLOR_GREY, "Du musst mindestens Rank 5 sein, um das zu benutzen!");
    return 1;
    }

    < heißt kleiner als, kleiner als 6 heißt 5,4,3,2,1,0 etc. das schließt rang 5 mit ein somit ist die nachricht dahinter fehlerhaft da man laut code mind. Rang 6 sein muss!
    Richtig, ab rang 5 würde es also < 5 lauten.
    Zum ersten liegt es wohl daran das derjenige nicht rang 6 ist,andernfalls müsstest du wenn dann dein problem nochmal erläutern

  • Hier vieleicht hilft dir das weiter:
    Mein /gov Befehl:
    if(strcmp(cmd, "/gov", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(gTeam[playerid] != 2)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du bist kein Beamter !");
    return 1;
    }
    if(PlayerInfo[playerid][pRank] < 5)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du brauchst Rang 5 !");
    return 1;
    }
    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, "Benutze: /gov [text]");
    return 1;
    }
    SendClientMessageToAll(COLOR_WHITE, "|___________Government Server Meldung___________|");
    format(string, sizeof(string), "Meldung von %s: %s", sendername, result);
    SendClientMessageToAll(COLOR_DBLUE, string);
    }
    return 1;
    }


    Und mein /department befehl:
    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, "Benutze: (/d)epartments [department chat]");
    return 1;
    }
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** LS-Chief %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** LS-Captain %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** LS-Lieutenant %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** LS-Sergeant %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** LS-Officer %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** LS-Cadet %s: %s, over. **", sendername, result); }
    else
    {
    format(string, sizeof(string), "** LS-Praktikant %s: %s, over. **", sendername, result);
    }
    SendTeamMessage(2, COLOR_ALLDEPT, string);
    SendTeamMessage(1, COLOR_ALLDEPT, string);
    printf("%s", string);
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du bist in keinem Team !");
    return 1;
    }
    }
    return 1;
    }


    MFG Picaso

  • GEht immer nocht nicht kann es sein das es an /makeleader liegt? CODE


    if(strcmp(cmd, "/makeleader", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Verwendung: /makeleader [spielerid/teildesnamens] [Nummer(1-13)]");
    return 1;
    }
    new para1;
    new level;
    para1 = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    level = strval(tmp);
    if(level > 14 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "Die Nummer darf nicht unter 0 und über 13 sein!"); return 1; }
    if (PlayerInfo[playerid][pAdmin] >= 1337)
    {
    if(IsPlayerConnected(para1))
    {
    if(para1 != INVALID_PLAYER_ID)
    {
    if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255)
    {
    SendClientMessage(playerid, COLOR_GREY, "Dieser Spieler ist in einer Organisation / Familie!");
    return 1;
    }
    GetPlayerName(para1, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    PlayerInfo[para1][pLeader] = level;
    format(string, sizeof(string), "Du wurdest von %s zum Leader gemacht.", sendername);
    SendClientMessage(para1, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Du hast %s zum Leader Level %d gemacht.", giveplayer,level);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    if(level == 0) { PlayerInfo[para1][pChar] = 299; }
    else if(level == 1) { PlayerInfo[para1][pChar] = 288; } //Police Force
    else if(level == 2) { PlayerInfo[para1][pChar] = 286; } //FBI/ATF
    else if(level == 3) { PlayerInfo[para1][pChar] = 287; } //National Guard
    else if(level == 4) { PlayerInfo[para1][pChar] = 228; } //Fire/Ambulance
    else if(level == 5) { PlayerInfo[para1][pChar] = 113; } //Russische Mafia
    else if(level == 6) { PlayerInfo[para1][pChar] = 120; } //Triaden
    else if(level == 7) { PlayerInfo[para1][pChar] = 147; } //Mayor
    else if(level == 8) { PlayerInfo[para1][pChar] = 294; } //Hitmans
    else if(level == 9) { PlayerInfo[para1][pChar] = 227; } //News Reporters
    else if(level == 10) { PlayerInfo[para1][pChar] = 61; } //Taxi Cab Company
    else if(level == 11) { PlayerInfo[para1][pChar] = 171; } //Driving/Flying School
    else if(level == 12) { PlayerInfo[para1][pChar] = 123; } //DaNang Boyz
    else if(level == 13) { PlayerInfo[para1][pChar] = 68; } //Orcus Clan
    else if(level == 14) { PlayerInfo[para1][pChar] = 275; } //Ordnungsamt
    gTeam[para1] = 14;
    PlayerInfo[para1][pTeam] = 14;
    SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
    }
    }//not connected
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Dir ist es nicht erlaubt, diesen Befehl zu benutzen!");
    }
    }
    return 1;
    }

  • ja, da fehlt das:


    PlayerInfo[para1][pRank] = 6;


    mach es so:



    f(strcmp(cmd, "/makeleader", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Verwendung: /makeleader [spielerid/teildesnamens] [Nummer(1-13)]");
    return 1;
    }
    new para1;
    new level;
    para1 = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    level = strval(tmp);
    if(level > 14 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "Die Nummer darf nicht unter 0 und über 13 sein!"); return 1; }
    if (PlayerInfo[playerid][pAdmin] >= 1337)
    {
    if(IsPlayerConnected(para1))
    {
    if(para1 != INVALID_PLAYER_ID)
    {
    if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255)
    {
    SendClientMessage(playerid, COLOR_GREY, "Dieser Spieler ist in einer Organisation / Familie!");
    return 1;
    }
    GetPlayerName(para1, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    PlayerInfo[para1][pLeader] = level;
    PlayerInfo[para1][pRank] = 6;
    format(string, sizeof(string), "Du wurdest von %s zum Leader gemacht.", sendername);
    SendClientMessage(para1, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "Du hast %s zum Leader Level %d gemacht.", giveplayer,level);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    if(level == 0) { PlayerInfo[para1][pChar] = 299; }
    else if(level == 1) { PlayerInfo[para1][pChar] = 288; } //Police Force
    else if(level == 2) { PlayerInfo[para1][pChar] = 286; } //FBI/ATF
    else if(level == 3) { PlayerInfo[para1][pChar] = 287; } //National Guard
    else if(level == 4) { PlayerInfo[para1][pChar] = 228; } //Fire/Ambulance
    else if(level == 5) { PlayerInfo[para1][pChar] = 113; } //Russische Mafia
    else if(level == 6) { PlayerInfo[para1][pChar] = 120; } //Triaden
    else if(level == 7) { PlayerInfo[para1][pChar] = 147; } //Mayor
    else if(level == 8) { PlayerInfo[para1][pChar] = 294; } //Hitmans
    else if(level == 9) { PlayerInfo[para1][pChar] = 227; } //News Reporters
    else if(level == 10) { PlayerInfo[para1][pChar] = 61; } //Taxi Cab Company
    else if(level == 11) { PlayerInfo[para1][pChar] = 171; } //Driving/Flying School
    else if(level == 12) { PlayerInfo[para1][pChar] = 123; } //DaNang Boyz
    else if(level == 13) { PlayerInfo[para1][pChar] = 68; } //Orcus Clan
    else if(level == 14) { PlayerInfo[para1][pChar] = 275; } //Ordnungsamt
    gTeam[para1] = 14;
    PlayerInfo[para1][pTeam] = 14;
    SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
    }
    }//not connected
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Dir ist es nicht erlaubt, diesen Befehl zu benutzen!");
    }
    }
    return 1;
    }

  • GEht immer nocht nicht da steht immer "Du bist kein Beamter" -.- und /d chat geht auch nicht Für SAPD Leader

  • mach das mal so:


    if(strcmp(cmd, "/gov", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new leader = PlayerInfo[playerid][pLeader];
    new member = PlayerInfo[playerid][pMember];
    if(leader == 1 || leader == 2 || leader == 3 || member == 1 || member == 2 || member == 3)
    {
    SendClientMessage(playerid, COLOR_GREY, " Du bist kein Beamter !");
    return 1;
    }


    das mit gteam is eh völliger mist..

  • Don't Work..Bei jeden steht "Du bist kein Beamter" Bei FBI Army & SAPD bin mir aber nicht sicher vllt hab ich hier was falsch gemacht :D:D


    if(strcmp(cmd, "/gov", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new leader = PlayerInfo[playerid][pLeader];
    new member = PlayerInfo[playerid][pMember];
    if(leader == 1 || leader == 2 || leader == 3 || member == 1 || member == 2 || member == 3)
    {


    SendClientMessage(playerid, COLOR_GREY, " Du brauchst Rang 5 !");
    return 1;
    }
    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, "Benutze: /gov [text]");
    return 1;
    }
    SendClientMessageToAll(COLOR_WHITE, "|___________Government Server Meldung___________|");
    format(string, sizeof(string), "Meldung von %s: %s", sendername, result);
    SendClientMessageToAll(COLOR_DBLUE, string);
    }
    return 1;
    }

  • uuupppss sry, mein fehler :D

    if(strcmp(cmd, "/gov", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new leader = PlayerInfo[playerid][pLeader];
    new member = PlayerInfo[playerid][pMember];
    if(leader == 1 || leader == 2 || leader == 3 || member == 1 || member == 2 || member == 3)
    {
    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, "Benutze: /gov [text]");
    return 1;
    }
    SendClientMessageToAll(COLOR_WHITE, "|___________Government Server Meldung___________|");
    format(string, sizeof(string), "Meldung von %s: %s", sendername, result);
    SendClientMessageToAll(COLOR_DBLUE, string);
    }
    else
    {
    return SendClientMessage(playerid, COLOR_GREY, " Du brauchst Rang 5 !");
    }
    }
    return 1;
    }

  • Super! :thumbup: Danke dir :love: aber jetzt noch /d chat ...genau das selbe Aso bei der samp-server.exe da in den schwarzen fenster zeigt der mir an das ich was geschrieben habe aber nicht imgame und andere können das auch nicht lesen! kannst du mir auch helfen ? :P


    /Edit hier guckst du

  • aso das sind jetzt alle Army/fbi/cops


    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Chief %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Captain %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Lieutenant %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Sergeant %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Officer %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Cadet %s: %s, over. **", sendername, result); }
    else
    {
    format(string, sizeof(string), "** Officer %s: %s, over. **", sendername, result);
    }
    SendTeamMessage(2, COLOR_ALLDEPT, string);
    SendTeamMessage(1, 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), "** Director %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Assistant Director in Charge %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Special Agent in Charge %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Special Agent %s: %s, over. **", sendername, result); }
    else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Special Agent Trainee %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);
    }
    SendTeamMessage(2, COLOR_ALLDEPT, string);
    SendTeamMessage(1, 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), "** Lieutenant %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), "** Private %s: %s, over. **", sendername, result); }
    else
    {
    format(string, sizeof(string), "** Private %s: %s, over. **", sendername, result);
    }
    SendTeamMessage(2, COLOR_ALLDEPT, string);
    SendTeamMessage(1, COLOR_ALLDEPT, string);
    printf("%s", string);
    return 1;
    }