Irgendein Denkfehler beim /swat Command

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. Ich wollte grade einen SWAT Command Scripten, mit dem Leute, die über Rang 4 Sind eine besondere Ausrüstung bekommen. Irgendwo ist dort ein gewaltiger Denkfehler, denn ich bekomme immer eine Windows Fehlermeldung beim Compilen...
    if(strcmp(cmd, "/swat", true) == 0)
    {
    if(OnDuty[playerid] == 0)
    {
    GetPlayerName(playerid, pname, sizeof(pname));
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    if(PlayerInfo[playerid][pRank] == 12)
    else if(PlayerInfo[playerid][pRank] == 11)
    else if(PlayerInfo[playerid][pRank] == 10)
    else if(PlayerInfo[playerid][pRank] == 9)
    else if(PlayerInfo[playerid][pRank] == 8)
    else if(PlayerInfo[playerid][pRank] == 7)
    else if(PlayerInfo[playerid][pRank] == 6)
    else if(PlayerInfo[playerid][pRank] == 5)
    else if(PlayerInfo[playerid][pRank] == 4)
    }
    if(PlayerToPoint(6, playerid,253.9974,78.0809,1003.6406) || PlayerToPoint(6,playerid,325.9385,306.9067,999.1484) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234)|| PlayerToPoint(3,playerid,-1256.3896,447.9114,7.1875) || PlayerToPoint(3,playerid,217.5392,184.4155,1003.0313) || PlayerInfo[playerid][pLocal] != 255)
    {
    format(string, sizeof(string), "*Officer %s holt seine SWAT Ausrüstung aus dem Spint.", pname);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 3, 500);
    GivePlayerWeapon(playerid, 22, 500);
    GivePlayerWeapon(playerid, 25, 250);
    GivePlayerWeapon(playerid, 41, 1500);
    GivePlayerWeapon(playerid, 24, 500);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    //SetPlayerColor(playerid, COLOR_LIGHTBLUE);
    SetPlayerSkin(playerid, 285);
    OnDuty[playerid] = 1;
    }
    }
    }
    }
    else if(OnDuty[playerid] == 1 && IsACop(playerid))
    {
    if (PlayerToPoint(6, playerid,253.9974,78.0809,1003.6406) || PlayerToPoint(6,playerid,325.9385,306.9067,999.1484) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234)|| PlayerToPoint(3,playerid,217.5392,184.4155,1003.0313) || PlayerInfo[playerid][pLocal] != 255)
    {
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "*Officer %s legt seine SWAT Ausrüstung in den Spint.", pname);
    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;
    }


    Ich kann mir fast denken, dass es an den Rang Abfragen liegt...
    Edit: Hm.. kann's nicht richtig Einrücken.. liegt am Forum D:
    Edit: Robdeflop meint, es sei ein Klammerfehler...

  • else if(PlayerInfo[playerid][pRank] == 4)


    zu


    if(PlayerInfo[playerid][pRank] == 4)



  • if(strcmp(cmd, "/swat", true) == 0)
    {
    if(OnDuty[playerid] == 0)
    {
    GetPlayerName(playerid, pname, sizeof(pname));
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    if(PlayerInfo[playerid][pRank] == 12)
    else if(PlayerInfo[playerid][pRank] == 11)
    else if(PlayerInfo[playerid][pRank] == 10)
    else if(PlayerInfo[playerid][pRank] == 9)
    else if(PlayerInfo[playerid][pRank] == 8)
    else if(PlayerInfo[playerid][pRank] == 7)
    else if(PlayerInfo[playerid][pRank] == 6)
    else if(PlayerInfo[playerid][pRank] == 5)
    else if(PlayerInfo[playerid][pRank] == 4)
    }
    if(PlayerToPoint(6, playerid,253.9974,78.0809,1003.6406) || PlayerToPoint(6,playerid,325.9385,306.9067,999.1484) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234)|| PlayerToPoint(3,playerid,-1256.3896,447.9114,7.1875) || PlayerToPoint(3,playerid,217.5392,184.4155,1003.0313) || PlayerInfo[playerid][pLocal] != 255)
    {
    format(string, sizeof(string), "*Officer %s holt seine SWAT Ausrüstung aus dem Spint.", pname);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 3, 500);
    GivePlayerWeapon(playerid, 22, 500);
    GivePlayerWeapon(playerid, 25, 250);
    GivePlayerWeapon(playerid, 41, 1500);
    GivePlayerWeapon(playerid, 24, 500);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    //SetPlayerColor(playerid, COLOR_LIGHTBLUE);
    SetPlayerSkin(playerid, 285);
    OnDuty[playerid] = 1;
    }
    }
    else if(OnDuty[playerid] == 1 && IsACop(playerid))
    {
    if (PlayerToPoint(6, playerid,253.9974,78.0809,1003.6406) || PlayerToPoint(6,playerid,325.9385,306.9067,999.1484) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234)|| PlayerToPoint(3,playerid,217.5392,184.4155,1003.0313) || PlayerInfo[playerid][pLocal] != 255)
    {
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "*Officer %s legt seine SWAT Ausrüstung in den Spint.", pname);
    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;
    }
    So müsste es eigentlich gehen

    MfG: -Thunder-

  • Jup, hier



    Sobald ich den /swat Command Ausklammere mit /* und */ sind diese Errord weg

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • if(strcmp(cmd, "/swat", true) == 0)
    {
    if(OnDuty[playerid] == 0)
    {
    GetPlayerName(playerid, pname, sizeof(pname));
    if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
    if(PlayerInfo[playerid][pRank] > 3)
    {
    if(PlayerToPoint(6, playerid,253.9974,78.0809,1003.6406) || PlayerToPoint(6,playerid,325.9385,306.9067,999.1484) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234)|| PlayerToPoint(3,playerid,-1256.3896,447.9114,7.1875) || PlayerToPoint(3,playerid,217.5392,184.4155,1003.0313) || PlayerInfo[playerid][pLocal] != 255)
    {
    format(string, sizeof(string), "*Officer %s holt seine SWAT Ausrüstung aus dem Spint.", pname);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    GivePlayerWeapon(playerid, 3, 500);
    GivePlayerWeapon(playerid, 22, 500);
    GivePlayerWeapon(playerid, 25, 250);
    GivePlayerWeapon(playerid, 41, 1500);
    GivePlayerWeapon(playerid, 24, 500);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    //SetPlayerColor(playerid, COLOR_LIGHTBLUE);
    SetPlayerSkin(playerid, 285);
    OnDuty[playerid] = 1;
    }
    }
    }
    }
    if(OnDuty[playerid] == 1 && IsACop(playerid))
    {
    if (PlayerToPoint(6, playerid,253.9974,78.0809,1003.6406) || PlayerToPoint(6,playerid,325.9385,306.9067,999.1484) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234) || PlayerToPoint(3,playerid,199.4482,168.2397,1003.0234)|| PlayerToPoint(3,playerid,217.5392,184.4155,1003.0313) || PlayerInfo[playerid][pLocal] != 255)
    {
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "*Officer %s legt seine SWAT Ausrüstung in den Spint.", pname);
    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;
    }