Problem mit /duty

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
  • Wir haben das Problem wenn ein Polizist On Duty geht dann verliert der User mit der ID 0 alle Waffen .


    Zeilen von /duty :


    //----------------------------------[offduty]-----------------------------------------------
    if(strcmp(cmd, "/duty", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(IsACop(playerid))
    {
    if (IsPlayerInRangeOfPoint(playerid,3.0,227.6519,111.8072,1003.2188) ||IsPlayerInRangeOfPoint(playerid,3.0,255.3,77.4,1003.6)
    || IsPlayerInRangeOfPoint(playerid,3.0,-1616.1294,681.1594,7.1875) || IsPlayerInRangeOfPoint(playerid,3.0, 217.5230,184.4352,1003.0313)
    || IsPlayerInRangeOfPoint(playerid,3.0, 217.8921,78.9727,1005.0391) || IsPlayerInRangeOfPoint(playerid,3.0,295.3134,183.2881,1007.1719)
    || PlayerInfo[playerid][pLocal] != 255)
    {
    if(OnDuty[playerid]==0)
    {
    format(string, sizeof(string), "* Officer %s holt seine Ausrüstung und meldet sich zum Beamten Dienst.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 41, 5000); //spray
    GivePlayerWeapon(playerid, 3, 1); //Nightstick
    // GivePlayerWeapon(playerid, 25, 5000); //Shotgun
    GivePlayerWeapon(playerid, 24, 8000); //Desert Eagle
    GivePlayerWeapon(playerid, 29, 4000); //MP5
    GivePlayerWeapon(playerid, 31, 6500); //M4
    GivePlayerWeapon(playerid, 34, 3000); //Sniper
    // GivePlayerWeapon(playerid, 17, 1000); //Tränengas
    OnDuty[playerid] = 1;
    }
    else if(OnDuty[playerid]==1)
    {
    format(string, sizeof(string), "* Officer %s geht nach einem langen Tag in den Feierabend.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ResetPlayerWeapons(giveplayerid);
    PlayerInfo[giveplayerid][pGun1] = 0; PlayerInfo[giveplayerid][pAmmo1] = 0;
    PlayerInfo[giveplayerid][pGun2] = 0; PlayerInfo[giveplayerid][pAmmo2] = 0;
    PlayerInfo[giveplayerid][pGun3] = 0; PlayerInfo[giveplayerid][pAmmo3] = 0;
    PlayerInfo[giveplayerid][pGun4] = 0; PlayerInfo[giveplayerid][pAmmo4] = 0;
    OnDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du bist nicht am PD Duty Punkt !");
    return 1;
    }
    }
    else if(PlayerInfo[playerid][pMember] == 21||PlayerInfo[playerid][pLeader] == 21)
    {
    if (IsPlayerInRangeOfPoint(playerid,3.0,2282.1790,2424.6235,3.4766))
    {
    if(OnDuty[playerid]==0)
    {
    format(string, sizeof(string), "* FBI Agent %s holt seine Ausrüstung und meldet sich zum Beamten Dienst.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 41, 99999); //spray
    GivePlayerWeapon(playerid, 3, 0); //Nightstick
    GivePlayerWeapon(playerid, 25, 99999); //Shotgun
    GivePlayerWeapon(playerid, 24, 99999); //Desert Eagle
    GivePlayerWeapon(playerid, 29, 99999); //MP5
    GivePlayerWeapon(playerid, 33, 99999); //County Rifle
    OnDuty[playerid] = 1;
    }
    else if(OnDuty[playerid]==1)
    {
    format(string, sizeof(string), "* FBI Agent %s geht nach einem langen Tag in den Feierabend.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    ResetPlayerWeapons(giveplayerid);
    PlayerInfo[giveplayerid][pGun1] = 0; PlayerInfo[giveplayerid][pAmmo1] = 0;
    PlayerInfo[giveplayerid][pGun2] = 0; PlayerInfo[giveplayerid][pAmmo2] = 0;
    PlayerInfo[giveplayerid][pGun3] = 0; PlayerInfo[giveplayerid][pAmmo3] = 0;
    PlayerInfo[giveplayerid][pGun4] = 0; PlayerInfo[giveplayerid][pAmmo4] = 0;
    OnDuty[playerid] = 0;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD2, " Du bist nicht am FBI Duty Punkt !");
    return 1;
    }
    }
    else if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
    {
    if(JobDuty[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun ausser Dienst und empfängst keine Notrufe mehr.");
    JobDuty[playerid] = 0;
    Medics -= 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun im Dienst und wirst Notrufe empfangen.");
    JobDuty[playerid] = 1;
    Medics += 1;
    }
    }
    else if(PlayerInfo[playerid][pMember] == 22 || PlayerInfo[playerid][pLeader] == 22)
    {
    if(JobDuty[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun ausser Dienst und empfängst keine Notrufe mehr.");
    JobDuty[playerid] = 0;
    }
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun im Dienst und wirst Notrufe empfangen.");
    JobDuty[playerid] = 1;
    }
    }
    else if(PlayerInfo[playerid][pJob] == 7)
    {
    if(JobDuty[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun ausser Dienst als Automechaniker und empfängst keine Anrufe mehr.");
    JobDuty[playerid] = 0;
    Mechanics -= 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Du bist nun im Dienst als Automechaniker und wirst Notrufe empfangen..");
    JobDuty[playerid] = 1;
    Mechanics += 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, " Du kannst nicht in den Dienst gehen !");
    }
    }
    return 1;
    }