Hilfe bei Warnings

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
  • C:\Users\Maurice\Desktop\Server\gamemodes\gmlssf.pwn(2536) : warning 225: unreachable code
    C:\Users\Maurice\Desktop\Server\gamemodes\gmlssf.pwn(2536) : warning 217: loose indentation
    C:\Users\Maurice\Desktop\Server\gamemodes\gmlssf.pwn(2939) : warning 219: local variable "string" shadows a variable at a preceding level
    C:\Users\Maurice\Desktop\Server\gamemodes\gmlssf.pwn(16250) : warning 204: symbol is assigned a value that is never used: "house"
    C:\Users\Maurice\Desktop\Server\gamemodes\gmlssf.pwn(17666) : warning 217: loose indentation
    C:\Users\Maurice\Desktop\Server\gamemodes\gmlssf.pwn(21334) : warning 211: possibly unintended assignment
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    6 Warnings.


    Wie bekomm ich die weg ?


    }
    else
    {
    gPlayerAccount[playerid] = 0;
    SendClientMessage(playerid, COLOR_WHITE,"Wie ich sehe bist du neu auf unserem Server.");
    SendClientMessage(playerid, COLOR_WHITE,"Drücke 'T' und tippe /register [Dein Passwort] ein.");
    SendClientMessage(playerid, COLOR_WHITE,"Bitte behalte dein Passwort nur für dich!");
    SendClientMessage(playerid, COLOR_WHITE,"Die Admin´s werden dich nie danach fragen!");
    return 1;
    }
    pBombStatus[playerid] = 0;
    pPlacedBomb[playerid] = 0;
    PlaceBombFunc[playerid] = 0;
    return 1;
    }

    {
    if(IsPlayerConnected(GettingCK[playerid]))
    {
    SendClientMessage(GettingCK[playerid], taxi, "Dein Kunde hat dem Server verelassen, versuche es später erneut!");
    OnCK[GettingCK[playerid]] = 999;
    }
    }
    if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
    {
    if(IsPlayerConnected(TransportDriver[playerid]))
    {
    new string[64];
    TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
    TransportTime[TransportDriver[playerid]] = 0;
    TransportCost[TransportDriver[playerid]] = 0;
    format(string, sizeof(string), "~w~Passenger left~n~~g~Earned %d$",TransportCost[playerid]);
    GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
    }
    }
    }
    new hkey = PlayerInfo[playerid][pPhousekey];
    new house = PlayerInfo[playerid][pLocal];
    if(Spectate[playerid] == 255 && PlayerInfo[playerid][pLocal] != 255 || Spectate[playerid] == 255 && PlayerInfo[playerid][pAdmin] > 0)
    {
    GetPlayerPos(playerid, Unspec[playerid][sPx], Unspec[playerid][sPy], Unspec[playerid][sPz]);
    Unspec[playerid][sPint] = PlayerInfo[playerid][pInt];
    Unspec[playerid][sLocal] = PlayerInfo[playerid][pLocal];
    PlayerInfo[playerid][pLocal] = 255;
    gTeam[playerid] = 0;
    }
    tmp = strtok(cmdtext, idx);
    if(strcmp("off", tmp, true, strlen(tmp)) == 0)
    {
    if(WatchingTV[playerid] > 0)
    {
    WatchingTV[playerid] = 0;
    Spectate[playerid] = 253;
    GameTextForPlayer(playerid, "~w~TV~n~~r~Off", 5000, 6);
    PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "Du beobachtest den Spieler!");
    return 1;
    }
    }
    if(PlayerInfo[playerid][pAdmin] > 1 || PlayerToPoint(12.0, playerid, HouseInfo[hkey][hExitx], HouseInfo[hkey][hExity],HouseInfo[hkey][hExitz]))
    {
    if(HouseInfo[hkey][hHealthx] != 1)
    {
    GameTextForPlayer(playerid, "~r~This upgrade isn't installed", 5000, 1);
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    Spectate[playerid] = giveplayerid;
    new Float:health;
    GetPlayerHealth(Spectate[playerid], health);
    GetPlayerName(Spectate[playerid], giveplayer, sizeof(giveplayer));
    new cash = GetPlayerMoney(Spectate[playerid]);
    if (PlayerInfo[playerid][pAdmin] >= 1)
    {
    format(string, sizeof(string), "Recon: (%d) %s %d$ H:%.0f",Spectate[playerid],giveplayer,cash,health);
    }
    else
    {
    format(string, sizeof(string), "UAV: (%d) %s",Spectate[playerid],giveplayer);
    }
    SendClientMessage(playerid, COLOR_GREEN, string);
    WatchingTV[playerid] = 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREEN, "Target is not available.");
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREEN, "Du bist nicht im Haus!");
    return 1;
    }
    }
    return 1;
    }
    if(strcmp(cmd, "/uncon", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    SetCamBack(playerid);
    }
    return 1;
    }
    if(strcmp(cmd, "/scripter", true) == 0 || strcmp(cmd, "/scr", 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, adac, "Verwende: /scr [scripter chat]");
    return 1;
    }
    format(string, sizeof(string), "Scripter %s: %s", PlayerInfo[playerid][pScripter], sendername, result);
    if (PlayerInfo[playerid][pScripter] >= 1)
    {
    SendScripterMessage(scripter1, string);
    }
    printf("Scripter %s: %s", sendername, result);
    }
    return 1;
    }
    if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", 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, adac, "Verwende: /a [chat]");
    return 1;
    }
    format(string, sizeof(string), "%d Scripter %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
    if (PlayerInfo[playerid][pAdmin] == 1341)
    {
    SendAdminMessage(scripter1, string);
    }
    printf("Admin %s: %s", sendername, result);
    format(string, sizeof(string), "%d Projektleiter %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
    if (PlayerInfo[playerid][pAdmin] == 1340)
    {
    SendAdminMessage(medic2, string);
    }
    printf("Admin %s: %s", sendername, result);
    format(string, sizeof(string), "%d Designer %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
    if (PlayerInfo[playerid][pAdmin] == 1339)
    {
    SendAdminMessage(cnncolor, string);
    }
    printf("Admin %s: %s", sendername, result);
    format(string, sizeof(string), "%d Vorstand %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
    if (PlayerInfo[playerid][pAdmin] == 1338)
    {
    SendAdminMessage(medic2, string);
    }
    printf("Admin %s: %s", sendername, result);
    format(string, sizeof(string), "%d SuperMod %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
    if (PlayerInfo[playerid][pAdmin] == 1337)
    {
    SendAdminMessage(info, string);
    }
    printf("Admin %s: %s", sendername, result);
    format(string, sizeof(string), "%d SuperMod %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
    if (PlayerInfo[playerid][pAdmin] == 4)
    {
    SendAdminMessage(info, string);
    }
    printf("Admin %s: %s", sendername, result);
    format(string, sizeof(string), "%d Moderator %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
    if (PlayerInfo[playerid][pAdmin] == 3)
    {
    SendAdminMessage(adac, string);
    }
    printf("Admin %s: %s", sendername, result);
    format(string, sizeof(string), "%d Moderator %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
    if (PlayerInfo[playerid][pAdmin] == 2)
    {
    SendAdminMessage(adac, string);
    }
    printf("Admin %s: %s", sendername, result);
    format(string, sizeof(string), "%d Moderator %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
    if (PlayerInfo[playerid][pAdmin] == 1)
    {
    SendAdminMessage(adac, string);
    }
    printf("Admin %s: %s", sendername, result);
    }
    return 1;
    }
    if(strcmp(cmd, "/leader", true) == 0 || strcmp(cmd, "/lc", 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, adac, "Verwende: /lc [chat]");
    return 1;
    }
    format(string, sizeof(string), "%d Cop-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 1)
    {
    SendLeaderMessage(cop, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d FBI-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 2)
    {
    SendLeaderMessage(fbi, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d Army-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 3)
    {
    SendLeaderMessage(army, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d Medic-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 4)
    {
    SendLeaderMessage(medic2, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d LCN-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 5)
    {
    SendLeaderMessage(lcn, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d Yakuza-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 6)
    {
    SendLeaderMessage(yakuza, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d Präsident %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 7)
    {
    SendLeaderMessage(bürgermeister, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d Hitman-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 8)
    {
    SendLeaderMessage(hitman, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d New´s Reporter-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 9)
    {
    SendLeaderMessage(newsreporter, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d Transporter-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 10)
    {
    SendLeaderMessage(moneycolor, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d Fahrschul-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 11)
    {
    SendLeaderMessage(fahrlehrer, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d Transport-GmbH-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 12)
    {
    SendLeaderMessage(tgmbh, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d Müllabfuhr-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 13)
    {
    SendLeaderMessage(mülli, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d Grove-Street-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 14)
    {
    SendLeaderMessage(grove, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d Ballas-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 15)
    {
    SendLeaderMessage(ballas, string);
    }
    printf("Leader %s: %s", sendername, result);
    format(string, sizeof(string), "%d Varios-Los-Aztecas-Leader %s: %s", PlayerInfo[playerid][pLeader], sendername, result);
    if (PlayerInfo[playerid][pLeader] == 16)
    {
    SendLeaderMessage(vagos, string);
    }

  • C:\Users\Maurice\Desktop\Server\gamemodes\gmlssf.pwn(2536) : warning 225: unreachable code
    C:\Users\Maurice\Desktop\Server\gamemodes\gmlssf.pwn(2536) : warning 217: loose indentation
    C:\Users\Maurice\Desktop\Server\gamemodes\gmlssf.pwn(2939) : warning 219: local variable "string" shadows a variable at a preceding level
    C:\Users\Maurice\Desktop\Server\gamemodes\gmlssf.pwn(16250) : warning 204: symbol is assigned a value that is never used: "house"
    C:\Users\Maurice\Desktop\Server\gamemodes\gmlssf.pwn(17666) : warning 217: loose indentation
    C:\Users\Maurice\Desktop\Server\gamemodes\gmlssf.pwn(21334) : warning 211: possibly unintended assignment


    Warning 1: Unreachable Code: Unerreichbarer Code, das heißt, du hast irgendwo falsch returnt, sodass der Code nicht mehr zu ereichen ist.


    Warning 2: Loose Identitation: Identität verloren, das heißt, dass Du irgendwo falsch eingerückt hast. Einfach mit TAB korrigieren.


    Warning 3: Local Variable "string" shados a variable at a .......: Das heißt, dass der string in dem Callback mehrfach erstellt wurde.


    Warning 4: symbol is assigned a value that is never used: "house": Das heißt, dass die Variable "house" nie im Script benutzt wurde.


    Warning 5: Loose Identitation: siehe oben


    Warning 6: possibly unintended assignment: Du hast wahrscheinlich bei einer if-Abfrage "=" anstatt "==" benutzt.


    Jetzt dürfte dir die Suche und das Entbuggen leichter fallen. :)

    Let the party begin - turn all the lights on!

  • Bei dem ersten hast du in dem ''else''-Zweig ein ''return 1;'' drin. Ich nehme an, bei dem ''if'' da drüber auch.
    D.h. er kann die nächsten Zeilen nicht erreichen.
    Mach es so:

    }
    else
    {
    gPlayerAccount[playerid] = 0;
    SendClientMessage(playerid, COLOR_WHITE,"Wie ich sehe bist du neu auf unserem Server.");
    SendClientMessage(playerid, COLOR_WHITE,"Drücke 'T' und tippe /register [Dein Passwort] ein.");
    SendClientMessage(playerid, COLOR_WHITE,"Bitte behalte dein Passwort nur für dich!");
    SendClientMessage(playerid, COLOR_WHITE,"Die Admin´s werden dich nie danach fragen!");
    }
    pBombStatus[playerid] = 0;
    pPlacedBomb[playerid] = 0;
    PlaceBombFunc[playerid] = 0;
    return 1;
    }Und nimm bei dem ''if'' da drüber ebenfalls das ''return 1;'' weg!


    Zweiter Kasten: richtig einrücken. Ob der Fehler dort liegt weiß ich nicht, wir sehen ja nicht welche Zeilen deine Codes haben. Fakt ist, bei dir war es 'komisch' eingerückt.

    {
    if(IsPlayerConnected(GettingCK[playerid]))
    {
    SendClientMessage(GettingCK[playerid], taxi, "Dein Kunde hat dem Server verelassen, versuche es später erneut!");
    OnCK[GettingCK[playerid]] = 999;
    }
    }
    if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
    {
    if(IsPlayerConnected(TransportDriver[playerid]))
    {
    new string[64];
    TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
    TransportTime[TransportDriver[playerid]] = 0;
    TransportCost[TransportDriver[playerid]] = 0;
    format(string, sizeof(string), "~w~Passenger left~n~~g~Earned %d$",TransportCost[playerid]);
    GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
    }
    }


    Ändere dir beiden mal und schreibe als Antwort:
    - Die restlichen Warnings
    - Den dazugehörigen Code
    - Kennzeichne die Zeilen wo die Warnings kommen!! Einfach hinter die Zeile//Zeile xy