[ WARNING FEHLER ] BITTE UM HILFE

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
  • Guten Tag,
    ich habe bei mir mysql eingebaut und habe jetzt eine Warnung beim Compilen kann mir einer helfen ?


    Zitat

    (5485) : warning 225: unreachable code
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    1 Warning.


    Hier die zeile:



    // Die zeile unter mir ist die zeile wo der fehler angeblich ist.
    new sqlaccountstatus = MySQLCheckAccount(plname);
    if(sqlaccountstatus != 0)
    {
    if (MySQLCheckAccountLocked(sqlaccountstatus) != 0)
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, "This account has been locked and cannot be accessed. Please contact an admin.");
    Kick(playerid);
    return 0;
    }
    gPlayerAccount[playerid] = 1;
    PlayerInfo[playerid][pSQLID] = sqlaccountstatus;
    }
    else
    {
    gPlayerAccount[playerid] = 0;
    }
    return 1;
    }

  • Multivan warum? Es ist eine Forenregel die zu beachten ist, wenn sowas nicht geschieht hab ich echt wenig Lust daran zu helfen..

    Why do programmers always mix up Halloween and Christmas?
    Oct 31 == Dec 25

  • forward MySQLCheckAccount(sqlplayersname[]);


    public MySQLCheckAccount(sqlplayersname[]) // by FlaxXx
    {
    new query[128];
    new escstr[MAX_PLAYER_NAME];
    samp_mysql_real_escape_string(sqlplayersname, escstr);
    format(query, sizeof(query), "SELECT id FROM players WHERE LOWER(Name) = LOWER('%s') LIMIT 1", escstr);
    samp_mysql_query(query);
    samp_mysql_store_result();
    if (samp_mysql_num_rows()==0)
    {
    return 0;
    }
    else
    {
    new strid[32];
    new intid;
    samp_mysql_fetch_row(strid);
    intid = strval(strid);
    return intid;
    }
    }


    public MySQLCreateAccount(newplayersname[], newpassword[]) // by FlaxXx
    {
    new query[128];
    new sqlplyname[64];
    new sqlpassword[64];
    samp_mysql_real_escape_string(newplayersname, sqlplyname);
    samp_mysql_real_escape_string(newpassword, sqlpassword);
    format(query, sizeof(query), "INSERT INTO players (Name, Password) VALUES ('%s', '%s')", sqlplyname, sqlpassword);
    samp_mysql_query(query);
    new newplayersid = MySQLCheckAccount(newplayersname);
    if (newplayersid != 0)
    {
    return newplayersid;
    }
    return 0;
    }


    new sqlaccountstatus = MySQLCheckAccount(plname);
    if(sqlaccountstatus != 0)
    {
    // Check if the account is locked
    if (MySQLCheckAccountLocked(sqlaccountstatus) != 0)
    {
    SendClientMessage(playerid, COLOR_LIGHTRED, "This account has been locked and cannot be accessed. Please contact an admin.");
    Kick(playerid);
    return 0;
    }
    gPlayerAccount[playerid] = 1;
    PlayerInfo[playerid][pSQLID] = sqlaccountstatus;
    }
    else
    {
    gPlayerAccount[playerid] = 0;
    }
    return 1;
    }

  • public OnPlayerConnect(playerid)
    {
    new string[100];
    new plname[MAX_PLAYER_NAME];
    new playersip[64];
    new zone[MAX_ZONE_NAME];
    GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
    GetPlayerName(playerid, plname, sizeof(plname));
    GetPlayerIp(playerid,playersip,sizeof(playersip));
    new namestring = strfind(plname, "_", true);
    format(string, sizeof(string),"%s",playersip);
    gPlayerUsingLoopingAnim[playerid] = 0;
    gPlayerAnimLibsPreloaded[playerid] = 0;
    format(string, sizeof(string), "Users/%s.ini", plname);
    SendClientMessage(playerid, COLOR_YELLOW2, "Please wait...");
    new File: hFile = fopen(string, io_read);
    if (hFile)
    {
    gPlayerAccount[playerid] = 1;
    return 1;
    }
    else
    {
    gPlayerAccount[playerid] = 0;
    return 1;
    }

    // Check if the account exists