[PLUGINS~MYSQL] FEHLER

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 Morgen,
    ich habe grade mein Server starten wollen aber irgend wie möchte der nicht das Script laden bei mir steht "Unknown" ?


    Hier mal Server Status:

    Zitat

    HostName: [TEST-SERVER]by Tor
    Address:
    Players: 0 / 20
    Ping: 14
    Mode: Unknown
    Map: San Andreas


    Hier mal die server.log:

    Und hier mal die Include im Script
    #include <a_samp> //
    #include <a_mysql>
    #include <zcmd>
    #include <sscanf2>


    Weiss einer woran das liegt ?

  • Also ich komme aufen Server bei Mode: Unknown
    Und befehle gehen aufen Server aber die ganzen sachen sind nicht geladen vehicles icons etc. ?
    Und in der mysql.log steht das drin

    Zitat

    [11:40:11]
    [11:40:11] ---------------------------
    [11:40:11] MySQL Debugging activated (02/01/11)
    [11:40:11] ---------------------------
    [11:40:11]

    Und die DB Tabellen sind alle erstellt in der db.
    Was ist der fehler wieso mysql nicht geht ?

  • Script Mysql:
    //=====================================[MySQL defines]=====================================
    #define MYSQL_LOAD_VEHICLES 1
    #define MYSQL_SAVE_VEHICLES 2
    #define MYSQL_SAVE_USERS 3
    #define MYSQL_LOAD_ICONS 4
    #define MYSQL_LOAD_OOC_ROOMS 5
    #define MYSQL_LOAD_GAS_STATIONS 6
    #define MYSQL_LOAD_HOUSES 7
    #define MYSQL_LOAD_BIZ 8
    #define MYSQL_LOAD_BUILDINGS 9
    #define MYSQL_LOAD_FACTIONS 10
    #define MYSQL_LOAD_DORMS 11
    #define MYSQL_LOAD_NEWSPAPERS 12
    #define MYSQL_LOAD_GANEZONES 13


    Mein Mysql DB:



    Edit: Mysql DB eingefügt

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Hallo


    Von nix kommt nix...wir können ohne Code schlichtweg raten. Was wäre von Nutzen:


    -Connecting zum MySQL Server
    -Ladecode
    -Speichercode
    -Vollständige mysql.log


    -Infos zum Problem
    -Beobachtungen/Wissenswertes


    Ein solches Gebiet kann durch einen einzelnen Fehler bereits nicht mehr funktionieren, deshalb sollte es in deinem Interesse sein, uns aufzuklären, damit wir dir vernünftig und rasch helfen können.


    MfG dUDALUS

  • function ConnectServer() {
    print(" Connecting to the database please wait.");
    mysql_connect(SERVER_HOST, SERVER_USER, SERVER_DB, SERVER_PASSWORD);
    mysql_debug(1);
    if(mysql_ping() == -1) {
    print(" You're not connected!");
    }
    else {
    print(" You're connected!");
    }
    SMFConnection = mysql_connect(SMF_HOST, SMF_USER, SMF_DB, SMF_PASSWORD);
    if(mysql_ping(SMFConnection) != 1) {
    print("Unable to connect");
    }
    else {
    print("Connected to the CSMF");
    }
    }


    OngameModeInit:
    public OnGameModeInit() {
    mysql_debug(1);
    CreateServerTextDraws();
    ConnectServer();
    for(new i = 0; i < MAX_VEHICLES; i ++ ) {
    strmid(CarData[i][Owner], "None", 0, strlen("None"), 255);
    CarData[i][Engine] = false;
    LightsToggled[i] = false;
    CarData[i][Rented] = false;
    }
    for(new i = 0; i < TOTAL_CELLS; i ++ ) {
    CellData[i][Open] = false;
    }
    for(new i = 0; i < TOTAL_GANGZONES; i ++ ) {
    GangZoneStructure[i] = -1;
    }
    for(new i = 0; i < sizeof(dharvcps); i ++ ) {
    CreateObject( 776, dharvcps[i][0], dharvcps[i][1], dharvcps[i][2]-15, 0, 0, 96 );
    }
    LoadVehicles();
    LoadMapicons();
    LoadOOCRooms();
    LoadGasStations();
    LoadBiz();
    LoadHouses();
    LoadBuildings();
    LoadFactions();
    LoadDorms();
    LoadNewsPapers();
    LoadGangZones();
    TimerData[CheatTimer] = SetTimer("CheatCheck", ANTICHEAT_TIMER, 1);
    TimerData[MapIconStream] = SetTimer("StreamerUpdate", FAST_TIMER, 1);
    TimerData[FuelTimer] = SetTimer("UpdateFuel", UPDATE_FUEL_TIMER, 1);
    TimerData[ClassTimer] = SetTimer("StartClass", START_CLASS_TIMER, 1);
    TimerData[PayDayTimer] = SetTimer("Payday", PAYDAY_TIMER, 1);

    Create3DTextLabel("[Bank]", COLOR_DO,593.5185,-1250.9753,18.2514, 200.0, 0, 1);
    Create3DTextLabel("[Advertisement]", COLOR_DO,1310.2059,-1366.7977,13.5066, 200.0, 0, 1);
    Create3DTextLabel("* There's a unknown man, sitting on the ground *", COLOR_DO,1410.0319,-1303.5917,9.3380, 200.0, 0, 1);
    //Create3DTextLabel("[Mechanic]\nJob - /applyjob", COLOR_DO,-62.9871,-1121.3834,1.1680, 200.0, 0, 1);
    SetGameModeText("QRP - Dev 0.5");
    EnableStuntBonusForAll(0);
    DisableInteriorEnterExits();
    AllowInteriorWeapons(1);
    ShowPlayerMarkers(0);
    // Pool
    CreateStreamedObject(974, 1259.8481445313, -769.83941650391, 1085.7926025391, 0.000000, 0.000000, 90.007049560547); //
    return 1;
    }


    function SaveAccount(playerid) {
    GetPlayerPos(playerid, AccountData[playerid][Spawn][0],AccountData[playerid][Spawn][1],AccountData[playerid][Spawn][2]);
    GetPlayerFacingAngle(playerid, AccountData[playerid][Spawn][3]);
    AccountData[playerid][InteriorSpawn] = GetPlayerInterior(playerid);
    AccountData[playerid][WorldSpawn] = GetPlayerVirtualWorld(playerid);
    format(string,sizeof(string), "UPDATE Accounts SET AdminLevel=%i,Money=%i,Bank=%i,Faction=%i,Rank=%i,HouseKey=%i,BizKey=%i,Skin=%i,Spawn1='%f',Spawn2='%f',Spawn3='%f',Spawn4='%f',Spawn5=%i,Reg=%i,Sex=%i,Wallet=%i,Renting=%i,Products=%i,PhoneNumber=%i,Minutes=%i,Spawn6=%i,Arrested=%i,Prisoned=%i,Jailed=%i,JailTime=%i, \
    Cell=%i,Towe=%i,License=%i,Linked=%i,ForumName='%s',ForumPassword='%s',wLicense=%i,Job=%i,Donator=%i,CarParts=%i,PlayingTime=%i,FightingStyle=%i WHERE Name = '%s'",
    AccountData[playerid][AdminLevel],GetPlayerCash(playerid),AccountData[playerid][Bank],
    AccountData[playerid][Faction],AccountData[playerid][Rank],AccountData[playerid][HouseKey],
    AccountData[playerid][BizKey],GetPlayerSkin(playerid),AccountData[playerid][Spawn][0],AccountData[playerid][Spawn][1],AccountData[playerid][Spawn][2],AccountData[playerid][Spawn][3],
    AccountData[playerid][InteriorSpawn],AccountData[playerid][Reg],AccountData[playerid][Sex],GetPlayerWalletCash(playerid),AccountData[playerid][Renting],AccountData[playerid][Products],
    AccountData[playerid][PhoneNumber],AccountData[playerid][Minutes],AccountData[playerid][WorldSpawn],AccountData[playerid][Arrested],AccountData[playerid][Prisoned],AccountData[playerid][Jailed],
    AccountData[playerid][JailTime],AccountData[playerid][Cell],AccountData[playerid][Towe],AccountData[playerid][License], AccountData[playerid][Linked], AccountData[playerid][ForumName],
    AccountData[playerid][ForumPassword],AccountData[playerid][wLicense],AccountData[playerid][pJob], AccountData[playerid][Donator], AccountData[playerid][CarParts], AccountData[playerid][PlayingTime],
    AccountData[playerid][FightingStyle],GetUserName(playerid));
    mysql_query(string, MYSQL_SAVE_USERS);

    format(string,sizeof(string), "UPDATE Accounts SET Materials=%i WHERE Name = '%s'",
    AccountData[playerid][Materials],GetUserName(playerid));
    mysql_query(string, MYSQL_SAVE_USERS);

    format(string, sizeof(string), "UPDATE enrolled SET Classes=%i WHERE Name = '%s'", AccountData[playerid][Classes],
    GetUserName(playerid));
    mysql_query(string);

    format(string, sizeof(string), "UPDATE scholarships SET Psychology=%i,Criminal_Justice=%i,Medicine=%i WHERE Name = '%s'", UniversityData[playerid][Psychology], UniversityData[playerid][Criminal_Justice],
    UniversityData[playerid][Medicine],GetUserName(playerid));
    mysql_query(string);

    format(string, sizeof(string), "UPDATE drugs SET Cocaine=%d,Crack=%d,Heroin=%d,Hydrocodone=%d,\
    Inhalants=%d,LSD=%d,Marijuana=%d,MDMA=%d,Methamphetamine=%d,Anabolic_Steroids=%d,Needles=%d,Blunts=%d WHERE Name = '%s'",
    PlayerDrugData[playerid][Cocaine],PlayerDrugData[playerid][Crack],PlayerDrugData[playerid][Heroin],PlayerDrugData[playerid][Hydrocodone],
    PlayerDrugData[playerid][Inhalants],PlayerDrugData[playerid][LSD],PlayerDrugData[playerid][Marijuana],PlayerDrugData[playerid][MDMA],
    PlayerDrugData[playerid][Methamphetamine],PlayerDrugData[playerid][Anabolic_Steroids],PlayerDrugData[playerid][Needles],PlayerDrugData[playerid][Blunts],GetUserName(playerid));
    mysql_query(string);

    format(string, sizeof(string), "UPDATE Settings SET Turfs=%i,SAN=%i,Phone=%i,Room=%i WHERE Name = '%s'", PlayerSettingsData[playerid][TurfTog], PlayerSettingsData[playerid][SANTog],
    PlayerSettingsData[playerid][PhoneTog], PlayerSettingsData[playerid][RoomTog],GetUserName(playerid));
    mysql_query(string);

    SavePlayerWeapons(playerid);
    SavePlayerWeaponsAmmo(playerid);
    }


    Und mal meine mysql_log.txt


  • Hallo


    Habe noch ein paar Fragen:


    1) Kannst Du dich einlogen und deine Daten werden geladen ?
    2) Spasst Du in Burberry, keine Pickup etc ?
    3.) Liest Du sonst Dateien mittels Non-MySQL Mitteln aus ? Werden diese gesittet, sofern vorhanden ?


    Werde es mir anschauen.
    MfG dUDALUS


    Edit
    Benutze bitte die Funktionen, um nach dem Schreiben das query zu leeren:


    mysql-store-result
    mysql-free-result
    Guck nach wie die Funktionen bei deinem Plugin heissen.

  • Ich habe mich mal aufen Server eingelogt also Register funktioniert und man wird auch gespawn aber der Account wird nicht gespeichert.
    Mein "mysql.inc"
    /**
    * SA:MP MySQL v2.1 Functions
    * (c) Copyright 2011, StrickenKid
    *
    **/


    #if defined __mysql_included
    #endinput
    #endif


    #define __mysql_included
    #pragma library mysql


    // plugin error id's


    #define P_ERROR_NONE 0
    #define P_ERROR_INCPARAMCNT 1
    #define P_ERROR_INCVALUE 2
    #define P_ERROR_MAXCONN 3
    #define P_ERROR_DBNOCONN 4
    #define P_ERROR_NORES 5
    #define P_ERROR_RES 6
    #define P_ERROR_NOFIELD 7
    #define P_ERROR_NOFIELDDATA 8
    #define P_ERROR_NOROWDATA 9
    #define P_ERROR_CANTALLOC 10
    #define P_ERROR_NOCALLBACK 11
    #define P_ERROR_NOQUERY 12


    // mysql headers defines


    #define REFRESH_GRANT 1
    #define REFRESH_LOG 2
    #define REFRESH_TABLES 4
    #define REFRESH_HOSTS 8
    #define REFRESH_STATUS 16
    #define REFRESH_THREADS 32
    #define REFRESH_SLAVE 64
    #define REFRESH_MASTER 128


    // mysql error id's


    #define CR_ERROR_FIRST 2000
    #define CR_UNKNOWN_ERROR 2000
    #define CR_SOCKET_CREATE_ERROR 2001
    #define CR_CONNECTION_ERROR 2002
    #define CR_CONN_HOST_ERROR 2003
    #define CR_IPSOCK_ERROR 2004
    #define CR_UNKNOWN_HOST 2005
    #define CR_SERVER_GONE_ERROR 2006
    #define CR_VERSION_ERROR 2007
    #define CR_OUT_OF_MEMORY 2008
    #define CR_WRONG_HOST_INFO 2009
    #define CR_LOCALHOST_CONNECTION 2010
    #define CR_TCP_CONNECTION 2011
    #define CR_SERVER_HANDSHAKE_ERR 2012
    #define CR_SERVER_LOST 2013
    #define CR_COMMANDS_OUT_OF_SYNC 2014
    #define CR_NAMEDPIPE_CONNECTION 2015
    #define CR_NAMEDPIPEWAIT_ERROR 2016
    #define CR_NAMEDPIPEOPEN_ERROR 2017
    #define CR_NAMEDPIPESETSTATE_ERROR 2018
    #define CR_CANT_READ_CHARSET 2019
    #define CR_NET_PACKET_TOO_LARGE 2020
    #define CR_EMBEDDED_CONNECTION 2021
    #define CR_PROBE_SLAVE_STATUS 2022
    #define CR_PROBE_SLAVE_HOSTS 2023
    #define CR_PROBE_SLAVE_CONNECT 2024
    #define CR_PROBE_MASTER_CONNECT 2025
    #define CR_SSL_CONNECTION_ERROR 2026
    #define CR_MALFORMED_PACKET 2027
    #define CR_WRONG_LICENSE 2028
    #define CR_NULL_POINTER 2029
    #define CR_NO_PREPARE_STMT 2030
    #define CR_PARAMS_NOT_BOUND 2031
    #define CR_DATA_TRUNCATED 2032
    #define CR_NO_PARAMETERS_EXISTS 2033
    #define CR_INVALID_PARAMETER_NO 2034
    #define CR_INVALID_BUFFER_USE 2035
    #define CR_UNSUPPORTED_PARAM_TYPE 2036
    #define CR_SHARED_MEMORY_CONNECTION 2037
    #define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038
    #define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039
    #define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
    #define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041
    #define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042
    #define CR_SHARED_MEMORY_MAP_ERROR 2043
    #define CR_SHARED_MEMORY_EVENT_ERROR 2044
    #define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
    #define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046
    #define CR_CONN_UNKNOW_PROTOCOL 2047
    #define CR_INVALID_CONN_HANDLE 2048
    #define CR_SECURE_AUTH 2049
    #define CR_FETCH_CANCELED 2050
    #define CR_NO_DATA 2051
    #define CR_NO_STMT_METADATA 2052
    #define CR_NO_RESULT_SET 2053
    #define CR_NOT_IMPLEMENTED 2054
    #define CR_SERVER_LOST_EXTENDED 2055
    #define CR_STMT_CLOSED 2056
    #define CR_NEW_STMT_METADATA 2057
    #define CR_ERROR_LAST 2057


    // logging types


    #define INVALID_MYSQL_ID (-1)
    #define LOG_OFF (0)
    #define LOG_ALL (1)
    #define LOG_ONLY_ERRORS (2)


    // function defines


    #define mysql_reload(%1) mysql_refresh(REFRESH_GRANT, %1)


    // plugin callbacks


    forward OnMysqlQueryArray(resultid, extravars[], MySQL:handle);
    forward OnMysqlQuery(resultid, spareid, MySQL:handle);
    forward OnMysqlError(error[], errorid, MySQL:handle);


    // plugin natives


    native MySQL:mysql_init(logtype = LOG_ONLY_ERRORS, printerrors = 1);
    native mysql_connect(const host[], const user[], const pass[], const db[], MySQL:handle = (MySQL:0), auto_reconnect = 0);
    native mysql_close(MySQL:handle = (MySQL:0));
    native mysql_refresh(options, MySQL:handle = (MySQL:0));
    native mysql_select_db(const db[], MySQL:handle = (MySQL:0));
    native mysql_query(const query[], resultid = (-1), spareid = (0), MySQL:handle = (MySQL:0));
    native mysql_query_array(const query[], resultid = (-1), {Float,_}:extravars[], MySQL:handle = (MySQL:0));
    native mysql_store_result(MySQL:handle = (MySQL:0));
    native mysql_free_result(MySQL:handle = (MySQL:0));
    native mysql_result_stored(MySQL:handle = (MySQL:0));
    native mysql_fetch_field(const fieldname[], dest[], MySQL:handle = (MySQL:0));
    native mysql_fetch_field_num(fieldnum, dest[], MySQL:handle = (MySQL:0));
    native mysql_fetch_row(dest[], const splitter[] = "|", MySQL:handle = (MySQL:0));
    native mysql_fetch_row_data(MySQL:handle = (MySQL:0));
    native mysql_real_escape_string(const string[], dest[], MySQL:handle = (MySQL:0));
    native mysql_num_rows(MySQL:handle = (MySQL:0));
    native mysql_num_fields(MySQL:handle = (MySQL:0));
    native mysql_affected_rows(MySQL:handle = (MySQL:0));
    native mysql_insert_id(MySQL:handle = (MySQL:0));
    native mysql_ping(MySQL:handle = (MySQL:0));
    native mysql_error(dest[], MySQL:handle = (MySQL:0));
    native mysql_errno(MySQL:handle = (MySQL:0));
    native mysql_warning_count(MySQL:handle = (MySQL:0));
    native mysql_info(dest[], MySQL:handle = (MySQL:0));
    native mysql_stat(dest[], MySQL:handle = (MySQL:0));
    native mysql_get_server_info(dest[], MySQL:handle = (MySQL:0));
    native mysql_get_host_info(dest[], MySQL:handle = (MySQL:0));
    native mysql_data_seek(rownum, MySQL:handle = (MySQL:0));
    native mysql_set_character_set(const csname[], MySQL:handle = (MySQL:0));
    native mysql_get_character_set(csname[], MySQL:handle = (MySQL:0));
    native mysql_fetch_int(MySQL:handle = (MySQL:0));
    native Float:mysql_fetch_float(MySQL:handle = (MySQL:0));
    native mysql_fetch_string(dest[], MySQL:handle = (MySQL:0));


    #if !defined split
    // split function - thanks to Blacklite
    stock split(const strsrc[], strdest[][], delimiter = '|')
    {
    new i, li, aNum, len, srclen = strlen(strsrc);
    while(i <= srclen)
    {
    if (strsrc[i] == delimiter || i == srclen)
    {
    len = strmid(strdest[aNum], strsrc, li, i, 128);
    strdest[aNum][len] = 0;
    li = i + 1;
    aNum++;
    }
    i++;
    }
    }
    #endif


    Und mein plugins sind die hier:
    HIER KLICKEN