Warning - warning 202: number of arguments does not match definition - Was kann ich nun tun?

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 Leute,
    ich habe ein Problem undzwar wollte ich meine Health speichern aber irgendwie geht es nicht! Ich bitte um Hilfe!



    savePlayer(playerid){if(pInfo[playerid][eingeloggt]==0)return 1;new query[128];format(query,sizeof(query),"UPDATE user SET level='%i',money='%i', alevel='%i', health='%i' WHERE id='%i'",pInfo[playerid][level],GetPlayerMoney(playerid),pInfo[playerid][alevel],GetPlayerHealth(playerid),pInfo[playerid][id]);mysql_function_query(dbhandle,query,false,"","");return 1;}



    Fehler in der 3 Zeile! Bei Format!

  • Ou!!!! Stimmt danke! Ich probiers mal schnell aus!



    //edit : Tag mismatch


    savePlayer(playerid){ if(pInfo[playerid][eingeloggt]==0)return 1; new query[128], float:healt; format(query,sizeof(query),"UPDATE user SET level='%i',money='%i', alevel='%i', health='%f' WHERE id='%i'",pInfo[playerid][level],GetPlayerMoney(playerid),pInfo[playerid][alevel],GetPlayerHealth(playerid, healt),pInfo[playerid][id]); mysql_function_query(dbhandle,query,false,"",""); return 1;}



    Bin ich zu doof?

  • savePlayer(playerid)
    {
    if(pInfo[playerid][eingeloggt] == 0)return 1;
    new query[200],Float:health;
    GetPlayerHealth(playerid,health);
    format(query,sizeof query,"UPDATE `user` SET `level`=%i,`money`=%i,`alevel`=%i,`health`='%f' WHERE `id`=%i",pInfo[playerid][level],GetPlayerMoney(playerid),pInfo[playerid][alevel],health,pInfo[playerid][id]);
    mysql_function_query(dbhandle,query,false,"","");
    return 1;
    }
    Nimm das mal so, denn bei mir klappt das.


    EDIT:
    Du hattest float kleingeschrieben ;)

    Einmal editiert, zuletzt von AirM4X () aus folgendem Grund: Kleine Änderung - Dachte man kann GetPlayerHealth auch im Format verwenden :)

  • Ich versuchs!


    Immernoch 0!


    Log: (GANZ SCHÖN VIEL!!!)



    [00:02:21] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "samp", password: "****", port: 3306, autoreconnect: true
    [00:02:21] [DEBUG] CMySQLHandle::Create - creating new connection..
    [00:02:21] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
    [00:02:21] [DEBUG] CMySQLHandle::Create - connection created with ID = 1
    [00:02:21] [DEBUG] CMySQLConnection::Connect - connection was successful
    [00:02:21] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
    [00:02:21] [DEBUG] CMySQLConnection::Connect - connection was successful
    [00:02:21] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
    [00:02:29] [DEBUG] mysql_tquery - connection: 1, query: "SELECT id FROM user WHERE username='Ilyas'", callback: "OnUserCheck", format: "i"
    [00:02:29] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
    [00:02:29] [DEBUG] mysql_tquery - scheduling query "SELECT id FROM user WHERE username='Ilyas'"..
    [00:02:29] [DEBUG] CMySQLQuery::Execute[OnUserCheck(i)] - starting query execution
    [00:02:29] [DEBUG] CMySQLQuery::Execute[OnUserCheck(i)] - query was successful
    [00:02:29] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
    [00:02:29] [DEBUG] CMySQLQuery::Execute[OnUserCheck(i)] - data being passed to ProcessCallbacks()
    [00:02:29] [DEBUG] Calling callback "OnUserCheck"..
    [00:02:29] [DEBUG] cache_get_data - connection: 1
    [00:02:29] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
    [00:02:29] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
    [00:02:32] [DEBUG] mysql_escape_string - source: "qrahq9ds", connection: 1, max_len: 35
    [00:02:32] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM user WHERE username='Ilyas' AND passwort=MD5('qrah", callback: "OnPasswordResponse", format: "i"
    [00:02:32] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
    [00:02:32] [DEBUG] mysql_tquery - scheduling query "SELECT * FROM user WHERE username='Ilyas' AND passwort=MD5('qrahq9ds')"..
    [00:02:32] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse(i)] - starting query execution
    [00:02:32] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse(i)] - query was successful
    [00:02:32] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
    [00:02:32] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse(i)] - data being passed to ProcessCallbacks()
    [00:02:32] [DEBUG] Calling callback "OnPasswordResponse"..
    [00:02:32] [DEBUG] cache_get_data - connection: 1
    [00:02:32] [DEBUG] cache_get_field_content_int - row: 0, field_name: "level", connection: 1
    [00:02:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "level", data: "10"
    [00:02:32] [DEBUG] cache_get_field_content_int - row: 0, field_name: "id", connection: 1
    [00:02:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "id", data: "10"
    [00:02:32] [DEBUG] cache_get_field_content_int - row: 0, field_name: "money", connection: 1
    [00:02:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "money", data: "14600"
    [00:02:32] [DEBUG] cache_get_field_content_int - row: 0, field_name: "alevel", connection: 1
    [00:02:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "alevel", data: "3"
    [00:02:32] [DEBUG] cache_get_field_content_int - row: 0, field_name: "health", connection: 1
    [00:02:32] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "health", data: "0"
    [00:02:32] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
    [00:02:32] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
    [00:02:55] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE user SET level='10',money='14500', alevel='3', health='0.", callback: "(null)", format: "(null)"
    [00:02:55] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
    [00:02:55] [DEBUG] mysql_tquery - scheduling query "UPDATE user SET level='10',money='14500', alevel='3', health='0.000000' WHERE id='10'"..
    [00:02:55] [DEBUG] CMySQLQuery::Execute[()] - starting query execution
    [00:02:55] [DEBUG] CMySQLQuery::Execute[()] - query was successful
    [00:02:55] [DEBUG] CMySQLQuery::Execute[()] - no callback specified, skipping result saving
    [00:02:55] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks()
    [00:02:55] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called

    Einmal editiert, zuletzt von KillerTyp ()

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • Wahrscheinlich fehlt immernoch was , was ihr jetzt wahrscheinlich schon 10 mal geschrieben habt ich aber zu doof bin!



    savePlayer(playerid){ if(pInfo[playerid][eingeloggt]==0)return 1; new query[128], Float:healt; format(query,sizeof(query),"UPDATE user SET level='%i',money='%i', alevel='%i', health='%f' WHERE id='%i'",pInfo[playerid][level],GetPlayerMoney(playerid),pInfo[playerid][alevel],GetPlayerHealth(playerid, healt),pInfo[playerid][id]); mysql_function_query(dbhandle,query,false,"",""); return 1;}


    Wieso is das immer nur eine Zeile? -.-





    [00:19:05] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "samp", password: "****", port: 3306, autoreconnect: true
    [00:19:05] [DEBUG] CMySQLHandle::Create - creating new connection..
    [00:19:05] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
    [00:19:05] [DEBUG] CMySQLHandle::Create - connection created with ID = 1
    [00:19:05] [DEBUG] CMySQLConnection::Connect - connection was successful
    [00:19:05] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
    [00:19:05] [DEBUG] CMySQLConnection::Connect - connection was successful
    [00:19:05] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
    [00:19:12] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "samp", password: "****", port: 3306, autoreconnect: true
    [00:19:12] [DEBUG] CMySQLHandle::Create - creating new connection..
    [00:19:12] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called
    [00:19:12] [DEBUG] CMySQLHandle::Create - connection created with ID = 1
    [00:19:12] [DEBUG] CMySQLConnection::Connect - connection was successful
    [00:19:12] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
    [00:19:12] [DEBUG] CMySQLConnection::Connect - connection was successful
    [00:19:12] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
    [00:19:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT id FROM user WHERE username='Ilyas'", callback: "OnUserCheck", format: "i"
    [00:19:21] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
    [00:19:21] [DEBUG] mysql_tquery - scheduling query "SELECT id FROM user WHERE username='Ilyas'"..
    [00:19:21] [DEBUG] CMySQLQuery::Execute[OnUserCheck(i)] - starting query execution
    [00:19:21] [DEBUG] CMySQLQuery::Execute[OnUserCheck(i)] - query was successful
    [00:19:21] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
    [00:19:21] [DEBUG] CMySQLQuery::Execute[OnUserCheck(i)] - data being passed to ProcessCallbacks()
    [00:19:21] [DEBUG] Calling callback "OnUserCheck"..
    [00:19:21] [DEBUG] cache_get_data - connection: 1
    [00:19:21] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
    [00:19:21] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
    [00:19:24] [DEBUG] mysql_escape_string - source: "qrahq9ds", connection: 1, max_len: 35
    [00:19:24] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM user WHERE username='Ilyas' AND passwort=MD5('qrah", callback: "OnPasswordResponse", format: "i"
    [00:19:24] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
    [00:19:24] [DEBUG] mysql_tquery - scheduling query "SELECT * FROM user WHERE username='Ilyas' AND passwort=MD5('qrahq9ds')"..
    [00:19:24] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse(i)] - starting query execution
    [00:19:24] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse(i)] - query was successful
    [00:19:24] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
    [00:19:24] [DEBUG] CMySQLQuery::Execute[OnPasswordResponse(i)] - data being passed to ProcessCallbacks()
    [00:19:24] [DEBUG] Calling callback "OnPasswordResponse"..
    [00:19:24] [DEBUG] cache_get_data - connection: 1
    [00:19:24] [DEBUG] cache_get_field_content_int - row: 0, field_name: "level", connection: 1
    [00:19:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "level", data: "10"
    [00:19:24] [DEBUG] cache_get_field_content_int - row: 0, field_name: "id", connection: 1
    [00:19:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "id", data: "10"
    [00:19:24] [DEBUG] cache_get_field_content_int - row: 0, field_name: "money", connection: 1
    [00:19:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "money", data: "14500"
    [00:19:24] [DEBUG] cache_get_field_content_int - row: 0, field_name: "alevel", connection: 1
    [00:19:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "alevel", data: "3"
    [00:19:24] [DEBUG] cache_get_field_content_float - row: 0, field_name: "health", connection: 1
    [00:19:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "health", data: "0"
    [00:19:24] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
    [00:19:24] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
    [00:19:56] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE user SET level='10',money='14400', alevel='3', health='0.", callback: "(null)", format: "(null)"
    [00:19:56] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
    [00:19:56] [DEBUG] mysql_tquery - scheduling query "UPDATE user SET level='10',money='14400', alevel='3', health='0.000000' WHERE id='10'"..
    [00:19:56] [DEBUG] CMySQLQuery::Execute[()] - starting query execution
    [00:19:56] [DEBUG] CMySQLQuery::Execute[()] - query was successful
    [00:19:56] [DEBUG] CMySQLQuery::Execute[()] - no callback specified, skipping result saving
    [00:19:56] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks()
    [00:19:56] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called