Script warning unreachable code

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
  • Hey liebe community ich habe da ein problem ich habe ein Warning im script den ich nicht weg bekomme das teil des scriptes wo der ist :


    Der warning : C:\Dokumente und Einstellungen\Justin.JU\Desktop\test\gamemodes\prohetzer.pwn(6260) : warning 225: unreachable code






    if(gPlayerAccount[playerid] == 1)
    {
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 0);
    }
    else if(gPlayerAccount[playerid] == 0)
    {
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 0);
    }
    return 1;

    MineCraft 1.7.10 Flans Mod Server in Plaung!


    Weitere Details per PN oder in Skype... Dennoch Suche ich daher noch Teamler!

  • der code genau :




    Function OnPlayerSpawn(playerid)
    {
    StopAudioStreamForPlayer(playerid);
    M_OnPlayerSpawn(playerid);
    TextDrawShowForPlayer(playerid,Copyright);
    TextDrawShowForPlayer(playerid,Datum);

    if(PlayerInfo[playerid][pDonateRank] > 0)
    {
    GivePlayerWeapon(playerid,24,50);
    }

    GW_OnPlayerSpawn(playerid);
    if(PlayerInfo[playerid][pTot] == 1 && PlayerInfo[playerid][pLevel] > 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_YELLOW, "|________ Krankenhaus ________|");
    SendClientMessage(playerid, COLOR_ORANGE, "Du bist gestorben , deswegen bist du im Krankenhaus");
    SendClientMessage(playerid, COLOR_ORANGE, "Warte 60 Sekunden bis deine Behandlung fertig ist!");
    SetPlayerSpawn(playerid);
    if(IsPlayerInFrac(playerid, 1))
    {
    SetPlayerColor(playerid,NAMECOLOR_LSCOP);
    }
    else if(IsPlayerInFrac(playerid, 4))
    {
    SetPlayerColor(playerid, NAMECOLOR_MEDIC);
    }
    else
    {
    SetPlayerColor(playerid,TEAM_HIT_COLOR);
    }
    ResetPlayerWeapons(playerid);
    return 1;
    }
    STDPlayer[playerid] = 0;
    gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
    if (gTeam[playerid] == 4) //medic / criminal reset team
    {
    gTeam[playerid] = 3;
    }
    if(gPlayerLogged[playerid] == 0)
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, "** Du musst dich vorher einloggen oder dir einen Account erstellen! ***");
    Kick(playerid);
    return 1;


    if(gPlayerAccount[playerid] == 1) <-------------------- der warning
    {
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 0);
    }
    else if(gPlayerAccount[playerid] == 0)
    {
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 0);
    }
    return 1;

    MineCraft 1.7.10 Flans Mod Server in Plaung!


    Weitere Details per PN oder in Skype... Dennoch Suche ich daher noch Teamler!

  • Das heißt des öfteren das ein Return falsch gesetzt wurde sprich falsch returnt wird, zeig mal am besten den ganzen Code.


    //Edit
    Absicht oder fehlt da eine Klammer. Du meintest das ist der ganze Code

    KleineHilfe 2.0

  • if(gPlayerLogged[playerid] == 0)
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, "** Du musst dich vorher einloggen oder dir einen Account erstellen! ***");
    Kick(playerid);
    return 1;
    if(gPlayerAccount[playerid] == 1)
    {
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 0);
    }
    else if(gPlayerAccount[playerid] == 0)
    {
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 0);
    }
    return 1;
    }


    was soll das denn!?
    Function OnPlayerSpawn(playerid)
    {
    StopAudioStreamForPlayer(playerid);
    M_OnPlayerSpawn(playerid);
    TextDrawShowForPlayer(playerid,Copyright);
    TextDrawShowForPlayer(playerid,Datum);


    if(PlayerInfo[playerid][pDonateRank] > 0)
    {
    GivePlayerWeapon(playerid,24,50);
    }
    GW_OnPlayerSpawn(playerid);
    if(PlayerInfo[playerid][pTot] == 1 && PlayerInfo[playerid][pLevel] > 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_YELLOW, "|________ Krankenhaus ________|");
    SendClientMessage(playerid, COLOR_ORANGE, "Du bist gestorben , deswegen bist du im Krankenhaus");
    SendClientMessage(playerid, COLOR_ORANGE, "Warte 60 Sekunden bis deine Behandlung fertig ist!");
    SetPlayerSpawn(playerid);
    if(IsPlayerInFrac(playerid, 1))
    {
    SetPlayerColor(playerid,NAMECOLOR_LSCOP);
    }
    else if(IsPlayerInFrac(playerid, 4))
    {
    SetPlayerColor(playerid, NAMECOLOR_MEDIC);
    }
    else
    {
    SetPlayerColor(playerid,TEAM_HIT_COLOR);
    }
    ResetPlayerWeapons(playerid);
    return 1;
    }
    STDPlayer[playerid] = 0;
    gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
    if (gTeam[playerid] == 4) //medic / criminal reset team
    {
    gTeam[playerid] = 3;
    }
    if(gPlayerLogged[playerid] == 0)
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, "** Du musst dich vorher einloggen oder dir einen Account erstellen! ***");
    Kick(playerid);
    }
    if(gPlayerAccount[playerid] == 1)
    {
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 0);
    }
    else if(gPlayerAccount[playerid] == 0)
    {
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 0);
    }
    return 1;
    }

    KleineHilfe 2.0

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Function OnPlayerSpawn(playerid)
    {
    StopAudioStreamForPlayer(playerid);
    M_OnPlayerSpawn(playerid);
    TextDrawShowForPlayer(playerid,Copyright);
    TextDrawShowForPlayer(playerid,Datum);


    if(PlayerInfo[playerid][pDonateRank] > 0)
    {
    GivePlayerWeapon(playerid,24,50);
    }
    GW_OnPlayerSpawn(playerid);
    if(PlayerInfo[playerid][pTot] == 1 && PlayerInfo[playerid][pLevel] > 1)
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_LIGHTRED, " ");
    SendClientMessage(playerid, COLOR_YELLOW, "|________ Krankenhaus ________|");
    SendClientMessage(playerid, COLOR_ORANGE, "Du bist gestorben , deswegen bist du im Krankenhaus");
    SendClientMessage(playerid, COLOR_ORANGE, "Warte 60 Sekunden bis deine Behandlung fertig ist!");
    SetPlayerSpawn(playerid);
    if(IsPlayerInFrac(playerid, 1))
    {
    SetPlayerColor(playerid,NAMECOLOR_LSCOP);
    }
    else if(IsPlayerInFrac(playerid, 4))
    {
    SetPlayerColor(playerid, NAMECOLOR_MEDIC);
    }
    else
    {
    SetPlayerColor(playerid,TEAM_HIT_COLOR);
    }
    ResetPlayerWeapons(playerid);
    }
    STDPlayer[playerid] = 0;
    gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
    if (gTeam[playerid] == 4) //medic / criminal reset team
    {
    gTeam[playerid] = 3;
    }
    if(gPlayerLogged[playerid] == 0)
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, "** Du musst dich vorher einloggen oder dir einen Account erstellen! ***");
    Kick(playerid);
    return 1;
    }
    if(gPlayerAccount[playerid] == 1)
    {
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 0);
    }
    else if(gPlayerAccount[playerid] == 0)
    {
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 0);
    }
    return 1;
    }


    Ja was soll das hier ->
    if(gPlayerLogged[playerid] == 0)
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, "** Du musst dich vorher einloggen oder dir einen Account erstellen! ***");
    Kick(playerid);
    return 1;
    if(gPlayerAccount[playerid] == 1)

    KleineHilfe 2.0

  • Das script hat ein alter scripter vonem server genommen / gemacht ka und daer kz mehr hatte habe ichs übernommen ich weiß auch ncih was der da getan hat





    //EDIT: jetzt is kein warning nichts mehr ;




    SendClientMessage(playerid, COLOR_LIGHTRED, "** Du musst dich vorher einloggen oder dir einen Account erstellen! ***");
    Kick(playerid);
    <--- habe dort das return 1; weg gemacht aber muss da nich ne -> } <- hin?


    if(gPlayerAccount[playerid] == 1)
    {
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 0);
    }
    else if(gPlayerAccount[playerid] == 0)
    {
    ForceClassSelection(playerid);
    TogglePlayerSpectating(playerid, 0);
    }
    return 1;

    MineCraft 1.7.10 Flans Mod Server in Plaung!


    Weitere Details per PN oder in Skype... Dennoch Suche ich daher noch Teamler!