mein selfmate hat errors

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 ihr breadfisch team.


    ich habe veruch ein script zu scripen der datenbank zumachen aber das hatte nicht geklabt .


    das sind die errors:



    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(33) : warning 217: loose indentation
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(33) : error 029: invalid expression, assumed zero
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(33) : error 017: undefined symbol "ConnectMySQL"
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(34) : error 029: invalid expression, assumed zero
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(34) : error 017: undefined symbol "ConnectMySQL"
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(38) : warning 217: loose indentation
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(38) : error 017: undefined symbol "mysql_ping"
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(40) : warning 206: redundant test: constant expression is non-zero
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(40) : warning 215: expression has no effect
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(41) : warning 217: loose indentation
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(43) : warning 217: loose indentation
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(48) : warning 217: loose indentation
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(48) : error 035: argument type mismatch (argument 1)
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(50) : error 035: argument type mismatch (argument 1)
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(57) : warning 225: unreachable code
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(57) : error 029: invalid expression, assumed zero
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(57) : error 004: function "OnGameModeExit" is not implemented
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(62) : warning 225: unreachable code
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(62) : error 029: invalid expression, assumed zero
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(62) : error 004: function "OnPlayerRequestClass" is not implemented
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(64) : error 017: undefined symbol "playerid"
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(65) : error 017: undefined symbol "playerid"
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(66) : error 017: undefined symbol "playerid"
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(70) : warning 225: unreachable code
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(70) : error 029: invalid expression, assumed zero
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(70) : error 004: function "OnPlayerConnect" is not implemented
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(75) : warning 225: unreachable code
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(75) : error 029: invalid expression, assumed zero
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(75) : error 004: function "OnPlayerDisconnect" is not implemented
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(77) : error 035: argument type mismatch (argument 1)
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(77) : error 017: undefined symbol "to"
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(77) : error 017: undefined symbol "update"
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(77) : fatal error 107: too many error messages on one line



    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase




    22 Errors.



    und das ist mein script
    #include <a_samp>
    #include <a_mysql>
    #include <md5>





    #define SQL_HOST "localhost"
    #define SQL_USER "root"
    #define SQL_PASS ""
    #define SQL_DB "test"









    main()
    {
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
    }





    public OnGameModeInit()
    {

    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);



    forward ConnectMySQL();
    public ConnectMySQL()
    {
    mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);



    if(mysql_ping() == 1)
    {
    mysql_debug(1);
    printf("[MYSQL]: Connection to `%s` succesful!", SQL_DB);
    }
    else
    {
    printf("[MYSQL]: [ERROR]: Connection to `%s` failed!", SQL_DB);
    }

    mysql_query("INSERT INTO `users` (`username`, `password`) VALUES ('%s', MD5('%s'))", PlayerName, password);

    mysql_query("SELECT `password` FROM `users` WHERE `username` = '%s'", PlayerName);
    return 1;
    }






    public OnGameModeExit()
    {
    return 1;
    }



    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
    }



    public OnPlayerConnect(playerid)
    {
    return 1;
    }



    public OnPlayerDisconnect(playerid, reason)
    {
    mysql_query("UPDATE `users` SET `fieldname` = '%s' WHERE `username` = '%s'", string to update);
    mysql_query("SELECT * FROM `users`");
    return 1;
    }



    public OnPlayerSpawn(playerid)
    {
    return 1;
    }



    public OnPlayerDeath(playerid, killerid, reason)
    {
    return 1;
    }



    public OnVehicleSpawn(vehicleid)
    {
    return 1;
    }



    public OnVehicleDeath(vehicleid, killerid)
    {
    return 1;
    }



    public OnPlayerText(playerid, text[])
    {
    return 1;
    }



    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
    // Do something here
    return 1;
    }
    return 0;
    }



    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    return 1;
    }



    public OnPlayerExitVehicle(playerid, vehicleid)
    {
    return 1;
    }



    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    return 1;
    }



    public OnPlayerEnterCheckpoint(playerid)
    {
    return 1;
    }



    public OnPlayerLeaveCheckpoint(playerid)
    {
    return 1;
    }



    public OnPlayerEnterRaceCheckpoint(playerid)
    {
    return 1;
    }



    public OnPlayerLeaveRaceCheckpoint(playerid)
    {
    return 1;
    }



    public OnRconCommand(cmd[])
    {
    return 1;
    }



    public OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }



    public OnObjectMoved(objectid)
    {
    return 1;
    }



    public OnPlayerObjectMoved(playerid, objectid)
    {
    return 1;
    }



    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    return 1;
    }



    public OnVehicleMod(playerid, vehicleid, componentid)
    {
    return 1;
    }



    public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
    {
    return 1;
    }



    public OnVehicleRespray(playerid, vehicleid, color1, color2)
    {
    return 1;
    }



    public OnPlayerSelectedMenuRow(playerid, row)
    {
    return 1;
    }



    public OnPlayerExitedMenu(playerid)
    {
    return 1;
    }



    public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
    {
    return 1;
    }



    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
    return 1;
    }



    public OnRconLoginAttempt(ip[], password[], success)
    {
    return 1;
    }



    public OnPlayerUpdate(playerid)
    {
    return 1;
    }



    public OnPlayerStreamIn(playerid, forplayerid)
    {
    return 1;
    }



    public OnPlayerStreamOut(playerid, forplayerid)
    {
    return 1;
    }



    public OnVehicleStreamIn(vehicleid, forplayerid)
    {
    return 1;
    }



    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }




    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    return 1;
    }



    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }



    und dar ist der forum wo ist das gemacht habe.


    http://wiki.sa-mp.com/wiki/MySQL_Tutorial



    ich höffe ihr kann mich dabei helfen.



    MFG [RSS]kevin7372

  • Du hast bei
    OnGameModeInit
    die "}" gelöscht es müsste so sein.



    public OnGameModeInit()
    {
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    }
    forward ConnectMySQL();.............


    Jedoch machen diese Zwei Zeilen in dem Public keinen sinn.



    mysql_query("INSERT INTO `users` (`username`, `password`) VALUES ('%s', MD5('%s'))", PlayerName, password);
    mysql_query("SELECT `password` FROM `users` WHERE `username` = '%s'", PlayerName);

    Da keine playerid übergeben wird bzw. du nicht wirklich etwas in die Tabelle reinschreiben oder rausholen kannst außer von dem was du evt. vorher definierst also um auf den Punkt zu kommen.
    Diese 2 Zeilen musst du anders wo nutzen z.b bei der Registration oder dem Login aber in diesem Public wird nur die Connection geladen.

  • Beitrag von Makaniz ()

    Dieser Beitrag wurde von Eddy aus folgendem Grund gelöscht: Spam -> Danke, aber er wird das schon noch können ().
  • guten morgen ich habe das gemacht aber es sind immer noch fehler.
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(33) : warning 217: loose indentation
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(33) : error 029: invalid expression, assumed zero
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(34) : error 001: expected token: ";", but found "{"
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(38) : error 029: invalid expression, assumed zero
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(38) : error 017: undefined symbol "ConnectMySQL"
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(38) : error 029: invalid expression, assumed zero
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(38) : fatal error 107: too many error messages on one line



    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase




    6 Errors.



    #include <a_samp>
    #include <a_mysql>
    #include <md5>





    #define SQL_HOST "localhost"
    #define SQL_USER "root"
    #define SQL_PASS ""
    #define SQL_DB "test"









    main()
    {
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
    }





    public OnGameModeInit()
    {

    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);



    public OnGameModeInit()
    {
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    }
    forward ConnectMySQL();.............






    public OnGameModeExit()
    {
    return 1;
    }



    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
    }



    public OnPlayerConnect(playerid)
    {
    return 1;
    }



    public OnPlayerDisconnect(playerid, reason)
    {
    mysql_query("UPDATE `users` SET `fieldname` = '%s' WHERE `username` = '%s'", string to update);
    mysql_query("SELECT * FROM `users`");
    return 1;
    }



    public OnPlayerSpawn(playerid)
    {
    return 1;
    }



    public OnPlayerDeath(playerid, killerid, reason)
    {
    return 1;
    }



    public OnVehicleSpawn(vehicleid)
    {
    return 1;
    }



    public OnVehicleDeath(vehicleid, killerid)
    {
    return 1;
    }



    public OnPlayerText(playerid, text[])
    {
    return 1;
    }



    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
    // Do something here
    return 1;
    }
    return 0;
    }



    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    return 1;
    }



    public OnPlayerExitVehicle(playerid, vehicleid)
    {
    return 1;
    }



    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    return 1;
    }



    public OnPlayerEnterCheckpoint(playerid)
    {
    return 1;
    }



    public OnPlayerLeaveCheckpoint(playerid)
    {
    return 1;
    }



    public OnPlayerEnterRaceCheckpoint(playerid)
    {
    return 1;
    }



    public OnPlayerLeaveRaceCheckpoint(playerid)
    {
    return 1;
    }



    public OnRconCommand(cmd[])
    {
    return 1;
    }



    public OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }



    public OnObjectMoved(objectid)
    {
    return 1;
    }



    public OnPlayerObjectMoved(playerid, objectid)
    {
    return 1;
    }



    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    return 1;
    }



    public OnVehicleMod(playerid, vehicleid, componentid)
    {
    return 1;
    }



    public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
    {
    return 1;
    }



    public OnVehicleRespray(playerid, vehicleid, color1, color2)
    {
    return 1;
    }



    public OnPlayerSelectedMenuRow(playerid, row)
    {
    return 1;
    }



    public OnPlayerExitedMenu(playerid)
    {
    return 1;
    }



    public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
    {
    return 1;
    }



    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
    return 1;
    }



    public OnRconLoginAttempt(ip[], password[], success)
    {
    return 1;
    }



    public OnPlayerUpdate(playerid)
    {
    return 1;
    }



    public OnPlayerStreamIn(playerid, forplayerid)
    {
    return 1;
    }



    public OnPlayerStreamOut(playerid, forplayerid)
    {
    return 1;
    }



    public OnVehicleStreamIn(vehicleid, forplayerid)
    {
    return 1;
    }



    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }




    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    return 1;
    }



    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }

  • habe weg gemacht nd die error sind jetzt
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(33) : error 010: invalid function or declaration
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(58) : error 035: argument type mismatch (argument 1)
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(58) : error 017: undefined symbol "to"
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(58) : error 017: undefined symbol "update"
    C:\Users\kevin\Desktop\samp neu\gamemodes\GRG-Script.pwn(58) : fatal error 107: too many error messages on one line



    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase




    5 Errors.


    das sit der code
    #include <a_samp>
    #include <a_mysql>
    #include <md5>





    #define SQL_HOST "localhost"
    #define SQL_USER "root"
    #define SQL_PASS ""
    #define SQL_DB "test"









    main()
    {
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
    }






    public OnGameModeInit()
    {
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    }
    forward ConnectMySQL();.............






    public OnGameModeExit()
    {
    return 1;
    }



    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
    }



    public OnPlayerConnect(playerid)
    {
    return 1;
    }



    public OnPlayerDisconnect(playerid, reason)
    {
    mysql_query("UPDATE `users` SET `fieldname` = '%s' WHERE `username` = '%s'", string to update);
    mysql_query("SELECT * FROM `users`");
    return 1;
    }



    public OnPlayerSpawn(playerid)
    {
    return 1;
    }



    public OnPlayerDeath(playerid, killerid, reason)
    {
    return 1;
    }



    public OnVehicleSpawn(vehicleid)
    {
    return 1;
    }



    public OnVehicleDeath(vehicleid, killerid)
    {
    return 1;
    }



    public OnPlayerText(playerid, text[])
    {
    return 1;
    }



    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
    // Do something here
    return 1;
    }
    return 0;
    }



    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
    {
    return 1;
    }



    public OnPlayerExitVehicle(playerid, vehicleid)
    {
    return 1;
    }



    public OnPlayerStateChange(playerid, newstate, oldstate)
    {
    return 1;
    }



    public OnPlayerEnterCheckpoint(playerid)
    {
    return 1;
    }



    public OnPlayerLeaveCheckpoint(playerid)
    {
    return 1;
    }



    public OnPlayerEnterRaceCheckpoint(playerid)
    {
    return 1;
    }



    public OnPlayerLeaveRaceCheckpoint(playerid)
    {
    return 1;
    }



    public OnRconCommand(cmd[])
    {
    return 1;
    }



    public OnPlayerRequestSpawn(playerid)
    {
    return 1;
    }



    public OnObjectMoved(objectid)
    {
    return 1;
    }



    public OnPlayerObjectMoved(playerid, objectid)
    {
    return 1;
    }



    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    return 1;
    }



    public OnVehicleMod(playerid, vehicleid, componentid)
    {
    return 1;
    }



    public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
    {
    return 1;
    }



    public OnVehicleRespray(playerid, vehicleid, color1, color2)
    {
    return 1;
    }



    public OnPlayerSelectedMenuRow(playerid, row)
    {
    return 1;
    }



    public OnPlayerExitedMenu(playerid)
    {
    return 1;
    }



    public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
    {
    return 1;
    }



    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
    {
    return 1;
    }



    public OnRconLoginAttempt(ip[], password[], success)
    {
    return 1;
    }



    public OnPlayerUpdate(playerid)
    {
    return 1;
    }



    public OnPlayerStreamIn(playerid, forplayerid)
    {
    return 1;
    }



    public OnPlayerStreamOut(playerid, forplayerid)
    {
    return 1;
    }



    public OnVehicleStreamIn(vehicleid, forplayerid)
    {
    return 1;
    }



    public OnVehicleStreamOut(vehicleid, forplayerid)
    {
    return 1;
    }




    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    {
    return 1;
    }



    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }

  • Ich würde dir raten, dass gesamte Script zu löschen und dir mal ein vernünftiges Tutorial anzugucken. Beispielsweise das von Jeffry.


    Das kann so nichts werden, wie du es oben tust.

  • Beitrag von ShadowKev1999 ()

    Dieser Beitrag wurde von Eddy aus folgendem Grund gelöscht: Spam ().
  • Beitrag von Maho ()

    Dieser Beitrag wurde von Eddy aus folgendem Grund gelöscht: Spam ().