Leader Duty | FBI Army |

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
  • if(strcmp(cmd, "/duty", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
    {


    if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) || PlayerInfo[playerid][pLocal] != 255)
    {
    if(OnDuty[playerid]==0)
    {

    new name[MAX_PLAYER_NAME], string[124];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "* Du hast deine Waffe aus dem Spinnt genommen.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    format(string,sizeof(string),"* Der Beamte %s ist in den Dienst gegangen!", name);
    SendClientMessageToAll(COLOR_NEWS,string);
    SetPlayerHealth(playerid,100.0);
    SetPlayerColor(playerid,COLOR_LIGHTBLUE);
    SetPlayerArmour(playerid,100.00);
    GivePlayerWeapon(playerid, 29, 999);
    GivePlayerWeapon(playerid, 31, 999);
    GivePlayerWeapon(playerid, 25, 999);
    GivePlayerWeapon(playerid, 3, 0);
    OnDuty[playerid] = 1;
    }
    else if(OnDuty[playerid]==1)
    {
    new name[MAX_PLAYER_NAME], string[124];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "* Du hast deine Waffe in den Spinnt gelegt.", sendername);
    SetPlayerArmour(playerid,0.0);
    ResetPlayerWeapons(playerid);
    SetPlayerColor(playerid,COLOR_WHITE);
    format(string,sizeof(string),"* Der Beamte %s ist aus dem Dienst gegangen!", name);
    SendClientMessageToAll(COLOR_NEWS,string);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    OnDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du bist nicht im Umkleideraum !");
    return 1;
    }
    }
    else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
    {
    if(JobDuty[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun auser Dienst.");
    JobDuty[playerid] = 0;
    Medics -= 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun im Dienst.");
    JobDuty[playerid] = 1;
    Medics += 1;
    }
    }
    else if(PlayerInfo[playerid][pJob] == 7)
    {
    if(JobDuty[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun auser Dienst.");
    JobDuty[playerid] = 0;
    Mechanics -= 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun im Dienst.");
    JobDuty[playerid] = 1;
    Mechanics += 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " Du bist kein Bulle !");
    }
    }
    return 1;
    }


    Ich wollte das so machen aber da können aufeinmal alle duty gehen



    if(strcmp(cmd, "/duty", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(PlayerInfo[playerid][pMember] == 1,2,3||PlayerInfo[playerid][pLeader] == 1,2,3)
    {


    if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) || PlayerInfo[playerid][pLocal] != 255)
    {
    if(OnDuty[playerid]==0)
    {


    new name[MAX_PLAYER_NAME], string[124];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "* Du hast deine Waffe aus dem Spinnt genommen.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    format(string,sizeof(string),"* Der Beamte %s ist in den Dienst gegangen!", name);
    SendClientMessageToAll(COLOR_NEWS,string);
    SetPlayerHealth(playerid,100.0);
    SetPlayerColor(playerid,COLOR_LIGHTBLUE);
    SetPlayerArmour(playerid,100.00);
    GivePlayerWeapon(playerid, 29, 999);
    GivePlayerWeapon(playerid, 31, 999);
    GivePlayerWeapon(playerid, 25, 999);
    GivePlayerWeapon(playerid, 3, 0);
    OnDuty[playerid] = 1;
    }
    else if(OnDuty[playerid]==1)
    {
    new name[MAX_PLAYER_NAME], string[124];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "* Du hast deine Waffe in den Spinnt gelegt.", sendername);
    SetPlayerArmour(playerid,0.0);
    ResetPlayerWeapons(playerid);
    SetPlayerColor(playerid,COLOR_WHITE);
    format(string,sizeof(string),"* Der Beamte %s ist aus dem Dienst gegangen!", name);
    SendClientMessageToAll(COLOR_NEWS,string);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    OnDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du bist nicht im Umkleideraum !");
    return 1;
    }
    }
    else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
    {
    if(JobDuty[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun auser Dienst.");
    JobDuty[playerid] = 0;
    Medics -= 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun im Dienst.");
    JobDuty[playerid] = 1;
    Medics += 1;
    }
    }
    else if(PlayerInfo[playerid][pJob] == 7)
    {
    if(JobDuty[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun auser Dienst.");
    JobDuty[playerid] = 0;
    Mechanics -= 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun im Dienst.");
    JobDuty[playerid] = 1;
    Mechanics += 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " Du bist kein Bulle !");
    }
    }
    return 1;
    }


    Wie kann ich das hinbekommen ?

  • if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
    pMember und PLeader einfach erweitern


    Beispiel:
    if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1||PlayerInfo[playerid][pLeader] == 13)


    MfG Firer

  • if(strcmp(cmd, "/duty", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) || PlayerInfo[playerid][pLocal] != 255)
    {
    if(OnDuty[playerid]==0)
    {
    format(string, sizeof(string), "* Officer %s nimmt ein Abzeichen und eine Waffe aus seinem Spind.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 24, 70);
    GivePlayerWeapon(playerid, 3, 0);
    OnDuty[playerid] = 1;
    }
    else if(OnDuty[playerid]==1)
    {
    format(string, sizeof(string), "* Officer %s legt ein Abzeichen und eine Waffe in seinem Spind.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 23, 150);
    GivePlayerWeapon(playerid, 5, 0);
    OnDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Du bist nicht in einem Spindzimmer!");
    return 1;
    }
    }
    else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
    {
    if(JobDuty[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist gerade nicht im Dienst und wirst keine Anrufe mehr erhalten.");
    JobDuty[playerid] = 0;
    Medics -= 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist im Dienst und wirst Anrufe von Leuten in Not erhalten.");
    JobDuty[playerid] = 1;
    Medics += 1;
    }
    }
    else if(PlayerInfo[playerid][pJob] == 7)
    {
    if(JobDuty[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist gerade nicht im Dienst und wirst keine Anrufe mehr erhalten.");
    JobDuty[playerid] = 0;
    Mechanics -= 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist im Dienst und wirst Anrufe erhalten.");
    JobDuty[playerid] = 1;
    Mechanics += 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "Du bist kein Polizist!");
    }
    }
    return 1;
    }


    nimm das da musste nur playtopoint änder also x,y,z und das passt es schon