Habe ein 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
  • hallo breadfish,
    ich habe ein duty dingens da für lspd und sfpd aber wenn sfpd duty geht geht er duty und sofort wieder unduty


    hier script:
    if(strcmp(cmd, "/duty", true) == 0)
    {
    if(OnDuty[playerid]==0)
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
    if (PlayerToPoint(6, playerid,253.9974,78.0809,1003.6406) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234)|| PlayerInfo[playerid][pLocal] != 255)
    {
    PreviousSkin[playerid] = GetPlayerSkin(playerid);
    format(string, sizeof(string), "* %s begibt sich nun als Polizist in den Dienst.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    if(PlayerInfo[playerid][pSex] == 1)
    {
    if(PlayerInfo[playerid][pRank] == 1) { SetPlayerSkin(playerid, 71); }
    else if(PlayerInfo[playerid][pRank] == 2) { SetPlayerSkin(playerid, 280); }
    else if(PlayerInfo[playerid][pRank] == 3) { SetPlayerSkin(playerid, 266); }
    else if(PlayerInfo[playerid][pRank] == 4) { SetPlayerSkin(playerid, 266); }
    else if(PlayerInfo[playerid][pRank] == 5) { SetPlayerSkin(playerid, 267); }
    else if(PlayerInfo[playerid][pRank] == 6) { SetPlayerSkin(playerid, 281); }
    else if(PlayerInfo[playerid][pRank] == 7) { SetPlayerSkin(playerid, 265); }
    else if(PlayerInfo[playerid][pRank] == 8) { SetPlayerSkin(playerid, 282); }
    else if(PlayerInfo[playerid][pRank] == 9) { SetPlayerSkin(playerid, 282); }
    else if(PlayerInfo[playerid][pRank] == 10) { SetPlayerSkin(playerid, 288); }
    else if(PlayerInfo[playerid][pRank] == 11) { SetPlayerSkin(playerid, 288); }
    else if(PlayerInfo[playerid][pRank] == 12) { SetPlayerSkin(playerid, 288); }
    }
    else if(PlayerInfo[playerid][pSex] == 2)
    {
    SetPlayerSkin(playerid, 192);
    }
    GivePlayerWeapon(playerid, 3, 1);
    GivePlayerWeapon(playerid, 22, 500);
    GivePlayerWeapon(playerid, 29, 700);
    GivePlayerWeapon(playerid, 25, 250);
    GivePlayerWeapon(playerid, 41, 1500);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    SetPlayerColor(playerid, COLOR_LIGHTBLUE);
    OnDuty[playerid] = 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist kein Beamter!");
    }
    }
    }
    else if(OnDuty[playerid] == 1)
    {


    if (PlayerToPoint(3, playerid,255.3,77.4,1003.6) || PlayerToPoint(3,playerid,-1616.1294,681.1594,7.1875) || PlayerToPoint(10,playerid,234.8921,111.8931,1003.2257) || PlayerInfo[playerid][pLocal] != 255)
    {
    GetPlayerName(playerid, sendername, sizeof(plname));
    format(string, sizeof(string), "* Beamter %s legt Uniform in seinen Spint.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    SetPlayerSkin(playerid, PreviousSkin[playerid]);
    ResetPlayerWeapons(playerid);
    SetPlayerToTeamColor(playerid);
    SetPlayerArmour(playerid, 0);
    OnDuty[playerid] = 0;
    }
    }
    }


    danke im vorraus


    mfg
    hüseyin

  • Hallo


    Versuch es mal so, schaus mir grad nochmals an.


    if(strcmp(cmd, "/duty", true) == 0)
    {
    if(OnDuty[playerid] == 0)
    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
    if(IsPlayerInRangeOfPoint(playerid,, 6,253.9974,78.0809,1003.6406) || IsPlayerInRangeOfPoint(playerid,3,199.4482,168.2397,1003.0234) || IsPlayerInRangeOfPoint(playerid,3,199.4482,168.2397,1003.0234)|| PlayerInfo[playerid][pLocal] != 255)
    {
    PreviousSkin[playerid] = GetPlayerSkin(playerid);
    format(string, sizeof(string), "* %s begibt sich nun als Polizist in den Dienst.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    if(PlayerInfo[playerid][pSex] == 1)
    {
    if(PlayerInfo[playerid][pRank] == 1) { SetPlayerSkin(playerid, 71); }
    else if(PlayerInfo[playerid][pRank] == 2) { SetPlayerSkin(playerid, 280); }
    else if(PlayerInfo[playerid][pRank] == 3) { SetPlayerSkin(playerid, 266); }
    else if(PlayerInfo[playerid][pRank] == 4) { SetPlayerSkin(playerid, 266); }
    else if(PlayerInfo[playerid][pRank] == 5) { SetPlayerSkin(playerid, 267); }
    else if(PlayerInfo[playerid][pRank] == 6) { SetPlayerSkin(playerid, 281); }
    else if(PlayerInfo[playerid][pRank] == 7) { SetPlayerSkin(playerid, 265); }
    else if(PlayerInfo[playerid][pRank] == 8) { SetPlayerSkin(playerid, 282); }
    else if(PlayerInfo[playerid][pRank] == 9) { SetPlayerSkin(playerid, 282); }
    else if(PlayerInfo[playerid][pRank] == 10) { SetPlayerSkin(playerid, 288); }
    else if(PlayerInfo[playerid][pRank] == 11) { SetPlayerSkin(playerid, 288); }
    else if(PlayerInfo[playerid][pRank] == 12) { SetPlayerSkin(playerid, 288); }
    }
    else if(PlayerInfo[playerid][pSex] == 2)
    {
    SetPlayerSkin(playerid, 192);
    }
    GivePlayerWeapon(playerid, 3, 1);
    GivePlayerWeapon(playerid, 22, 500);
    GivePlayerWeapon(playerid, 29, 700);
    GivePlayerWeapon(playerid, 25, 250);
    GivePlayerWeapon(playerid, 41, 1500);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    SetPlayerColor(playerid, COLOR_LIGHTBLUE);
    OnDuty[playerid] = 1;
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "Du bist kein Beamter!");
    }
    }
    return 1;
    }
    if(OnDuty[playerid] == 1)
    {
    if (IsPlayerInRangeOfPoint(playerid,3,255.3,77.4,1003.6) || IsPlayerInRangeOfPoint(playerid,3,-1616.1294,681.1594,7.1875) || IsPlayerInRangeOfPoint(playerid,10,234.8921,111.8931,1003.2257) || PlayerInfo[playerid][pLocal] != 255)
    {
    GetPlayerName(playerid, sendername, sizeof(plname));
    format(string, sizeof(string), "* Beamter %s legt Uniform in seinen Spint.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    SetPlayerSkin(playerid, PreviousSkin[playerid]);
    ResetPlayerWeapons(playerid);
    SetPlayerToTeamColor(playerid);
    SetPlayerArmour(playerid, 0);
    OnDuty[playerid] = 0;
    return 1;
    }
    }
    }


    MfG dUDA