SQLite makes server.exe crash when reading data.
#1

Hi

I decided to switch to SQLite for saving stats, because everyone says that along with MYSql it's the best option.

So I watched several tutorials, and finally tried it out myself.
The registering works fine, but when I reconnect to the server and try to login it crashes my server.exe and the server closes connection :/

So here's my code:

pawn Код:
public OnPlayerRequestClass(playerid, classid) //•••
{
    new  Query[135], DBResult:conclusion , PlayerName[MAX_PLAYER_NAME] ;
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    format(Query, sizeof(Query), "SELECT `NAME` FROM `USERS` WHERE `NAME` = '%s' COLLATE NOCASE", DB_Escape(PlayerName));
    conclusion = db_query(Admin, Query);
    if(db_num_rows(conclusion ))//if he is registered
    {
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Welcome back to the server! \nEnter your password:", "Login", "");
    }
    else
    {//else if not
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Enter your password:", "Register", "");
    }
    db_free_result(conclusion);
   
    if(PInfo[playerid][Logged] == 1) SpawnPlayer(playerid);

    return 1;
}//•••
OnDialogResponse:
pawn Код:
if(dialogid == DIALOG_REGISTER) //•••
    {
        if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,COLOR_WHITE,"You are already logged in!");//Checking if the player is logged in, if he is, it won't allow him to re-register
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Password invalid, Enter your password:", "Register", "");

        new Query[128];
        new PlayerName[MAX_PLAYER_NAME];

        GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
        format(Query, 128, "INSERT INTO `USERS` (`NAME`, `PASSWORD`) VALUES ('%s','%s')", DB_Escape(PlayerName), DB_Escape(inputtext));//we are saving the fields values inside our DataBase
        db_query(Admin, Query);

    }
   
    if(dialogid == DIALOG_LOGIN)
    {
        if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,COLOR_WHITE,"You are already logged in!");//Checking if the player is logged in, if he is, it won't allow him to login
        if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Password invalid, Enter your password:", "Login", "");
       
        //Login(playerid, inputtext);
        new Query[128];
        new PlayerName[MAX_PLAYER_NAME];
        new DBResult: Result;

        GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
        format(Query, sizeof(Query), "SELECT * FROM `USERS` WHERE `NAME` = '%s' COLLATE NOCASE AND `PASSWORD` = '%s'", DB_Escape(PlayerName), DB_Escape(inputtext));
        Result = db_query(Admin, Query);
        if(db_num_rows(Result))//if password is right
        {
               
            new money[30], level[2], score[30], kills[10], skin[5], rep[10], deaths[10], vortexPB[30], houses[5], racesWon[5], racesRaced[6];
           
            db_get_field_assoc(Result, "MONEY", money, 30);
            PInfo[playerid][Money] = strval(money);
               
            db_get_field_assoc(Result, "LEVEL", level, 2);
            PInfo[playerid][Level] = strval(level);
               
            db_get_field_assoc(Result, "SCORE", score, 30);
            PInfo[playerid][Score] = strval(score);
               
            db_get_field_assoc(Result, "KILLS", kills, 10);
            PInfo[playerid][Kills] = strval(kills);
               
            db_get_field_assoc(Result, "SKIN", skin, 5);
            PInfo[playerid][Skin] = strval(skin);
               
            db_get_field_assoc(Result, "REPUTATION", rep, 10);
            PInfo[playerid][Rep] = strval(rep);
               
            db_get_field_assoc(Result, "DEATHS", deaths, 10);
            PInfo[playerid][Deaths] = strval(deaths);
               
            db_get_field_assoc(Result, "VORTEXPB", vortexPB, 30);
            PInfo[playerid][VortexPB] = floatstr(vortexPB);
               
            db_get_field_assoc(Result, "HOUSES", houses, 5);
            PInfo[playerid][Houses] = strval(houses);
               
            db_get_field_assoc(Result, "RACESWON", racesWon, 5);
            PInfo[playerid][RacesWon] = strval(racesWon);
               
            db_get_field_assoc(Result, "RACESRACED", racesRaced, 6);
            PInfo[playerid][RacesRaced] = strval(racesRaced);
        }
       
        else
        {//else he entered a wrong password
            ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Password invalid, Enter your password:", "Login", "");//Checking if he inputted the correct password, if not, retrieve him a message and closing the file;
        }
        db_free_result(Result);
        //Other stuff

    } //•••
Custom function (which doesn't cause any trouble, but I'll post it here anyway, just in case:
pawn Код:
//•••
forward public UpdateData(playerid);
public UpdateData(playerid)
{
    new
        Query[200],
        name[MAX_PLAYER_NAME]
    ;
    GetPlayerName(playerid, name, sizeof(name));
   
    format(Query,sizeof(Query),"UPDATE `USERS` SET  MONEY = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  GetPlayerMoney(playerid), DB_Escape(name));
    db_free_result(db_query(Admin, Query));
   
    format(Query,sizeof(Query),"UPDATE `USERS` SET  SCORE = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  GetPlayerMoney(playerid), DB_Escape(name));
    db_free_result(db_query(Admin, Query));
   
    format(Query,sizeof(Query),"UPDATE `USERS` SET  SKIN = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  GetPlayerMoney(playerid), DB_Escape(name));
    db_free_result(db_query(Admin, Query));
   
    format(Query,sizeof(Query),"UPDATE `USERS` SET  COLOR = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  GetPlayerMoney(playerid), DB_Escape(name));
    db_free_result(db_query(Admin, Query));
   
    format(Query,sizeof(Query),"UPDATE `USERS` SET  KILLS = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  GetPlayerMoney(playerid), DB_Escape(name));
    db_free_result(db_query(Admin, Query));
   
    format(Query,sizeof(Query),"UPDATE `USERS` SET  REPUTATION = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  GetPlayerMoney(playerid), DB_Escape(name));
    db_free_result(db_query(Admin, Query));

    format(Query,sizeof(Query),"UPDATE `USERS` SET  DEATHS = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  GetPlayerMoney(playerid), DB_Escape(name));
    db_free_result(db_query(Admin, Query));

    format(Query,sizeof(Query),"UPDATE `USERS` SET  VORTEXPB = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  GetPlayerMoney(playerid), DB_Escape(name));
    db_free_result(db_query(Admin, Query));

    format(Query,sizeof(Query),"UPDATE `USERS` SET  HOUSES = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  GetPlayerMoney(playerid), DB_Escape(name));
    db_free_result(db_query(Admin, Query));

    format(Query,sizeof(Query),"UPDATE `USERS` SET  RACESWON = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  GetPlayerMoney(playerid), DB_Escape(name));
    db_free_result(db_query(Admin, Query));
   
    format(Query,sizeof(Query),"UPDATE `USERS` SET  RACESRACED = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  GetPlayerMoney(playerid), DB_Escape(name));
    db_free_result(db_query(Admin, Query));
   
    return 1;
}
Does anybody know what could be wrong?
Thanks in advance
Rep ++
Reply
#2

Use crashdetect plugin, it will print you out in server log what caused server to crash
Reply
#3

I know but I couldn't make anything out of it...

Код:
[15:00:40]  Blank Gamemode by your name here
[15:00:40] ----------------------------------

[15:00:40] Number of vehicle models: 3
[15:00:47] New version of CrashDetect is available for download (4.12)
[15:01:20] Incoming connection: 192.168.1.3:60015
[15:01:20] [join] [AS]knackworst has joined the server (0:192.168.1.3)
[15:01:47] [debug] Server crashed while executing TerribleStuntsYINI.amx
[15:01:47] [debug] AMX backtrace:
[15:01:47] [debug] #0 native db_get_field_assoc () [0044de30] from samp-server.exe
[15:01:47] [debug] #1 000266cc in public OnDialogResponse (0x00000000, 0x00000007, 0x00000001, 0xffffffff, 0x001e6f4c) from TerribleStuntsYINI.amx
[15:01:47] [debug] Native backtrace:
[15:01:47] [debug] #0 0044dad1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #1 004010b6 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #2 672e60ba in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\plugins\crashdetect.dll
[15:01:47] [debug] #3 672e7fee in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\plugins\crashdetect.dll
[15:01:47] [debug] #4 672e0091 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\plugins\crashdetect.dll
[15:01:47] [debug] #5 672e610a in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\plugins\crashdetect.dll
[15:01:47] [debug] #6 0046dac1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #7 00452850 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #8 00498cc9 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #9 00020003 in ?? ()
[15:01:47] [debug] #10 00030004 in ?? ()
[15:01:47] [debug] #11 00040005 in ?? ()
[15:01:47] [debug] #12 00050006 in ?? ()
[15:01:47] [debug] #13 00060007 in ?? ()
[15:01:47] [debug] #14 00070008 in ?? ()
[15:01:47] [debug] #15 00080009 in ?? ()
[15:01:47] [debug] #16 0009000a in ?? ()
[15:01:47] [debug] #17 000a000b in ?? ()
[15:01:47] [debug] #18 000b000c in ?? ()
[15:01:47] [debug] #19 000c000d in ?? ()
[15:01:47] [debug] #20 000d000e in ?? ()
[15:01:47] [debug] #21 000e000f in ?? ()
[15:01:47] [debug] #22 000f0010 in ?? ()
[15:01:47] [debug] #23 00100011 in ?? ()
[15:01:47] [debug] #24 00110012 in ?? ()
[15:01:47] [debug] #25 00120013 in ?? ()
[15:01:47] [debug] #26 00130014 in ?? ()
[15:01:47] [debug] #27 00140015 in ?? ()
[15:01:47] [debug] #28 00150016 in ?? ()
[15:01:47] [debug] #29 00160017 in ?? ()
[15:01:47] [debug] #30 00170018 in ?? ()
[15:01:47] [debug] #31 00180019 in ?? ()
[15:01:47] [debug] #32 0019001a in ?? ()
[15:01:47] [debug] #33 001a001b in ?? ()
[15:01:47] [debug] #34 001b001c in ?? ()
[15:01:47] [debug] #35 001c001d in ?? ()
[15:01:47] [debug] #36 001d001e in ?? ()
[15:01:47] [debug] #37 001e001f in ?? ()
[15:01:47] [debug] #38 001f0020 in ?? ()
[15:01:47] [debug] #39 00200021 in ?? ()
[15:01:47] [debug] #40 00210023 in ?? ()
[15:01:47] [debug] #41 00220025 in ?? ()
[15:01:47] [debug] #42 00230027 in ?? ()
[15:01:47] [debug] #43 00240029 in ?? ()
[15:01:47] [debug] #44 0025002b in ?? ()
[15:01:47] [debug] #45 0026002d in ?? ()
[15:01:47] [debug] #46 0027002f in ?? ()
[15:01:47] [debug] #47 00280031 in ?? ()
[15:01:47] [debug] #48 00290033 in ?? ()
[15:01:47] [debug] #49 002a0035 in ?? ()
[15:01:47] [debug] #50 002b0037 in ?? ()
[15:01:47] [debug] #51 002c0039 in ?? ()
[15:01:47] [debug] #52 002d003b in ?? ()
[15:01:47] [debug] #53 002e003d in ?? ()
[15:01:47] [debug] #54 002f003f in ?? ()
[15:01:47] [debug] #55 00300041 in ?? ()
[15:01:47] [debug] #56 00310045 in ?? ()
[15:01:47] [debug] #57 00320049 in ?? ()
[15:01:47] [debug] #58 0033004d in ?? ()
[15:01:47] [debug] #59 00340051 in ?? ()
[15:01:47] [debug] #60 00350055 in ?? ()
[15:01:47] [debug] #61 00360059 in ?? ()
[15:01:47] [debug] #62 0037005d in ?? ()
[15:01:47] [debug] #63 00380061 in ?? ()
[15:01:47] [debug] #64 00390065 in ?? ()
[15:01:47] [debug] #65 003a0069 in ?? ()
[15:01:47] [debug] #66 003b006d in ?? ()
[15:01:47] [debug] #67 003c0071 in ?? ()
[15:01:47] [debug] #68 003d0075 in ?? ()
[15:01:47] [debug] #69 003e0079 in ?? ()
[15:01:47] [debug] #70 003f007d in ?? ()
[15:01:47] [debug] #71 00400081 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #72 00410089 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #73 00420091 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #74 00430099 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #75 004400a1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #76 004500a9 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #77 004600b1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #78 004700b9 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #79 004800c1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #80 004900c9 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #81 004a00d1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #82 004b00d9 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #83 004c00e1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #84 004d00e9 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #85 004e00f1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #86 004f00f9 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[15:01:47] [debug] #87 00500101 in ?? ()
[15:01:47] [debug] #88 00510111 in ?? ()
[15:01:47] [debug] #89 00520121 in ?? ()
[15:01:47] [debug] #90 00530131 in ?? ()
[15:01:47] [debug] #91 00540141 in ?? ()
[15:01:47] [debug] #92 00550151 in ?? ()
[15:01:47] [debug] #93 00560161 in ?? ()
[15:01:47] [debug] #94 00570171 in ?? ()
[15:01:47] [debug] #95 00580181 in ?? ()
[15:01:47] [debug] #96 00590191 in ?? ()
[15:01:47] [debug] #97 005a01a1 in ?? ()
[15:01:47] [debug] #98 005b01b1 in ?? ()
[15:01:47] [debug] #99 005c01c1 in ?? ()
[15:01:47] [debug] #100 005d01d1 in ?? ()
[15:01:47] [debug] #101 005e01e1 in ?? ()
[15:01:47] [debug] #102 005f01f1 in ?? ()
[15:01:47] [debug] #103 00600201 in ?? ()
[15:01:47] [debug] #104 00610221 in ?? ()
[15:01:47] [debug] #105 00620241 in ?? ()
[15:01:47] [debug] #106 00630261 in ?? ()
[15:01:47] [debug] #107 00640281 in ?? ()
[15:01:47] [debug] #108 006502a1 in ?? ()
[15:01:47] [debug] #109 006602c1 in ?? ()
[15:01:47] [debug] #110 006702e1 in ?? ()
[15:01:47] [debug] #111 00680301 in ?? ()
[15:01:47] [debug] #112 00690321 in ?? ()
[15:01:47] [debug] #113 006a0341 in ?? ()
[15:01:47] [debug] #114 006b0361 in ?? ()
[15:01:47] [debug] #115 006c0381 in ?? ()
[15:01:47] [debug] #116 006d03a1 in ?? ()
[15:01:47] [debug] #117 006e03c1 in ?? ()
[15:01:47] [debug] #118 006f03e1 in ?? ()
[15:01:47] [debug] #119 00700401 in ?? ()
[15:01:47] [debug] #120 00710441 in ?? ()
[15:01:47] [debug] #121 00720481 in ?? ()
[15:01:47] [debug] #122 007304c1 in ?? ()
[15:01:47] [debug] #123 00740501 in ?? ()
[15:01:47] [debug] #124 00750541 in ?? ()
[15:01:47] [debug] #125 00760581 in ?? ()
[15:01:47] [debug] #126 007705c1 in ?? ()
[15:01:47] [debug] #127 00780601 in ?? ()
[15:01:47] [debug] #128 00790641 in ?? ()
[15:01:47] [debug] #129 007a0681 in ?? ()
[15:01:47] [debug] #130 007b06c1 in ?? ()
[15:01:47] [debug] #131 007c0701 in ?? ()
[15:01:47] [debug] #132 007d0741 in ?? ()
[15:01:47] [debug] #133 007e0781 in ?? ()
[15:01:47] [debug] #134 007f07c1 in ?? ()
[15:01:47] [debug] #135 01d01310 in ?? ()
[15:01:47] [debug] #136 00010001 in ?? ()
That's the log with crashdetect.
Reply
#4

Using db_get_field_assoc to get the data of a field when it's NULL, it crashes the server. When you create the table, use "NOT NULL" in the fields and/or add default values.

Compiling with debug info (in most cases) prints the line the crash was caused at. To do so, goto pawno folder and create a file pawn.cfg
Open it and write it in:
pawn Код:
-d3
Save it and re-compile your scripts. Run the server and try to login again. It should say the line so you can prevent the crash from reading the NULL value.
Reply
#5

Код:
[21:30:47]  Blank Gamemode by your name here
[21:30:47] ----------------------------------

[21:30:47] Number of vehicle models: 3
[21:30:57] New version of CrashDetect is available for download (4.12)
[21:31:29] Incoming connection: 192.168.1.3:65251
[21:31:29] [join] [AS]knackworst has joined the server (0:192.168.1.3)
[21:31:34] [debug] Server crashed while executing TerribleStuntsYINI.amx
[21:31:34] [debug] AMX backtrace:
[21:31:34] [debug] #0 native db_get_field_assoc () [0044de30] from samp-server.exe
[21:31:34] [debug] #1 0002fe94 in public OnDialogResponse (playerid=0, dialogid=7, response=1, listitem=-1, inputtext[]=@0x001e6f08 "CHANGED") at C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\gamemodes\TerribleStuntsYINI.pwn:2701
[21:31:34] [debug] Native backtrace:
[21:31:34] [debug] #0 0044dad1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #1 004010b6 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #2 60fd60ba in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\plugins\crashdetect.dll
[21:31:34] [debug] #3 60fd7fee in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\plugins\crashdetect.dll
[21:31:34] [debug] #4 60fd0091 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\plugins\crashdetect.dll
[21:31:34] [debug] #5 60fd610a in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\plugins\crashdetect.dll
[21:31:34] [debug] #6 0046dac1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #7 00452850 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #8 00498cc9 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #9 00060007 in ?? ()
[21:31:34] [debug] #10 00070008 in ?? ()
[21:31:34] [debug] #11 00080009 in ?? ()
[21:31:34] [debug] #12 0009000a in ?? ()
[21:31:34] [debug] #13 000a000b in ?? ()
[21:31:34] [debug] #14 000b000c in ?? ()
[21:31:34] [debug] #15 000c000d in ?? ()
[21:31:34] [debug] #16 000d000e in ?? ()
[21:31:34] [debug] #17 000e000f in ?? ()
[21:31:34] [debug] #18 000f0010 in ?? ()
[21:31:34] [debug] #19 00100011 in ?? ()
[21:31:34] [debug] #20 00110012 in ?? ()
[21:31:34] [debug] #21 00120013 in ?? ()
[21:31:34] [debug] #22 00130014 in ?? ()
[21:31:34] [debug] #23 00140015 in ?? ()
[21:31:34] [debug] #24 00150016 in ?? ()
[21:31:34] [debug] #25 00160017 in ?? ()
[21:31:34] [debug] #26 00170018 in ?? ()
[21:31:34] [debug] #27 00180019 in ?? ()
[21:31:34] [debug] #28 0019001a in ?? ()
[21:31:34] [debug] #29 001a001b in ?? ()
[21:31:34] [debug] #30 001b001c in ?? ()
[21:31:34] [debug] #31 001c001d in ?? ()
[21:31:34] [debug] #32 001d001e in ?? ()
[21:31:34] [debug] #33 001e001f in ?? ()
[21:31:34] [debug] #34 001f0020 in ?? ()
[21:31:34] [debug] #35 00200021 in ?? ()
[21:31:34] [debug] #36 00210023 in ?? ()
[21:31:34] [debug] #37 00220025 in ?? ()
[21:31:34] [debug] #38 00230027 in ?? ()
[21:31:34] [debug] #39 00240029 in ?? ()
[21:31:34] [debug] #40 0025002b in ?? ()
[21:31:34] [debug] #41 0026002d in ?? ()
[21:31:34] [debug] #42 0027002f in ?? ()
[21:31:34] [debug] #43 00280031 in ?? ()
[21:31:34] [debug] #44 00290033 in ?? ()
[21:31:34] [debug] #45 002a0035 in ?? ()
[21:31:34] [debug] #46 002b0037 in ?? ()
[21:31:34] [debug] #47 002c0039 in ?? ()
[21:31:34] [debug] #48 002d003b in ?? ()
[21:31:34] [debug] #49 002e003d in ?? ()
[21:31:34] [debug] #50 002f003f in ?? ()
[21:31:34] [debug] #51 00300041 in ?? ()
[21:31:34] [debug] #52 00310045 in ?? ()
[21:31:34] [debug] #53 00320049 in ?? ()
[21:31:34] [debug] #54 0033004d in ?? ()
[21:31:34] [debug] #55 00340051 in ?? ()
[21:31:34] [debug] #56 00350055 in ?? ()
[21:31:34] [debug] #57 00360059 in ?? ()
[21:31:34] [debug] #58 0037005d in ?? ()
[21:31:34] [debug] #59 00380061 in ?? ()
[21:31:34] [debug] #60 00390065 in ?? ()
[21:31:34] [debug] #61 003a0069 in ?? ()
[21:31:34] [debug] #62 003b006d in ?? ()
[21:31:34] [debug] #63 003c0071 in ?? ()
[21:31:34] [debug] #64 003d0075 in ?? ()
[21:31:34] [debug] #65 003e0079 in ?? ()
[21:31:34] [debug] #66 003f007d in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #67 00400081 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #68 00410089 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #69 00420091 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #70 00430099 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #71 004400a1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #72 004500a9 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #73 004600b1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #74 004700b9 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #75 004800c1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #76 004900c9 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #77 004a00d1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #78 004b00d9 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #79 004c00e1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #80 004d00e9 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #81 004e00f1 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #82 004f00f9 in ?? () from C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\samp-server.exe
[21:31:34] [debug] #83 00500101 in ?? ()
[21:31:34] [debug] #84 00510111 in ?? ()
[21:31:34] [debug] #85 00520121 in ?? ()
[21:31:34] [debug] #86 00530131 in ?? ()
[21:31:34] [debug] #87 00540141 in ?? ()
[21:31:34] [debug] #88 00550151 in ?? ()
[21:31:34] [debug] #89 00560161 in ?? ()
[21:31:34] [debug] #90 00570171 in ?? ()
[21:31:34] [debug] #91 00580181 in ?? ()
[21:31:34] [debug] #92 00590191 in ?? ()
[21:31:34] [debug] #93 005a01a1 in ?? ()
[21:31:34] [debug] #94 005b01b1 in ?? ()
[21:31:34] [debug] #95 005c01c1 in ?? ()
[21:31:34] [debug] #96 005d01d1 in ?? ()
[21:31:34] [debug] #97 005e01e1 in ?? ()
[21:31:34] [debug] #98 005f01f1 in ?? ()
[21:31:34] [debug] #99 00600201 in ?? ()
[21:31:34] [debug] #100 00610221 in ?? ()
[21:31:34] [debug] #101 00620241 in ?? ()
[21:31:34] [debug] #102 00630261 in ?? ()
[21:31:34] [debug] #103 00640281 in ?? ()
[21:31:34] [debug] #104 006502a1 in ?? ()
[21:31:34] [debug] #105 006602c1 in ?? ()
[21:31:34] [debug] #106 006702e1 in ?? ()
[21:31:34] [debug] #107 00680301 in ?? ()
[21:31:34] [debug] #108 00690321 in ?? ()
[21:31:34] [debug] #109 006a0341 in ?? ()
[21:31:34] [debug] #110 006b0361 in ?? ()
[21:31:34] [debug] #111 006c0381 in ?? ()
[21:31:34] [debug] #112 006d03a1 in ?? ()
[21:31:34] [debug] #113 006e03c1 in ?? ()
[21:31:34] [debug] #114 006f03e1 in ?? ()
[21:31:34] [debug] #115 00700401 in ?? ()
[21:31:34] [debug] #116 00710441 in ?? ()
[21:31:34] [debug] #117 00720481 in ?? ()
[21:31:34] [debug] #118 007304c1 in ?? ()
[21:31:34] [debug] #119 00740501 in ?? ()
[21:31:34] [debug] #120 00750541 in ?? ()
[21:31:34] [debug] #121 00760581 in ?? ()
[21:31:34] [debug] #122 007705c1 in ?? ()
[21:31:34] [debug] #123 00780601 in ?? ()
[21:31:34] [debug] #124 00790641 in ?? ()
[21:31:34] [debug] #125 007a0681 in ?? ()
[21:31:34] [debug] #126 007b06c1 in ?? ()
[21:31:34] [debug] #127 007c0701 in ?? ()
[21:31:34] [debug] #128 007d0741 in ?? ()
[21:31:34] [debug] #129 007e0781 in ?? ()
[21:31:34] [debug] #130 007f07c1 in ?? ()
doesn't give any line :/
Reply
#6

pawn Код:
#0 native db_get_field_assoc () [0044de30] from samp-server.exe
#1 0002fe94 in public OnDialogResponse (playerid=0, dialogid=7, response=1, listitem=-1, inputtext[]=@0x001e6f08 "CHANGED") at C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts\gamemodes\TerribleStuntsYINI.pwn:2701
Sure it does. Check at the end -> ... gamemodes\TerribleStuntsYINI.pwn:2701

which is:
pawn Код:
db_get_field_assoc(Result, "MONEY", money, 30);
If you run a SQLite Broswer, then you'll be able to see that yourself that the field was empty.
Reply
#7

Then I don't know why it doesn't properly write information into the fields...

pawn Код:
forward public UpdateData(playerid);
public UpdateData(playerid)
{
    new
        Query[200],
        name[MAX_PLAYER_NAME]
    ;
    GetPlayerName(playerid, name, sizeof(name));
   
    format(Query,sizeof(Query),"UPDATE `USERS` SET  MONEY = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  PInfo[playerid][Money], DB_Escape(name));
    db_free_result(db_query(Admin, Query));
   
    format(Query,sizeof(Query),"UPDATE `USERS` SET  SCORE = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  PInfo[playerid][Score], DB_Escape(name));
    db_free_result(db_query(Admin, Query));
   
    format(Query,sizeof(Query),"UPDATE `USERS` SET  SKIN = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  PInfo[playerid][Skin], DB_Escape(name));
    db_free_result(db_query(Admin, Query));
   
    format(Query,sizeof(Query),"UPDATE `USERS` SET  COLOR = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  PInfo[playerid][Color], DB_Escape(name));
    db_free_result(db_query(Admin, Query));
   
    format(Query,sizeof(Query),"UPDATE `USERS` SET  KILLS = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  PInfo[playerid][Kills], DB_Escape(name));
    db_free_result(db_query(Admin, Query));
   
    format(Query,sizeof(Query),"UPDATE `USERS` SET  REPUTATION = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  PInfo[playerid][Rep], DB_Escape(name));
    db_free_result(db_query(Admin, Query));

    format(Query,sizeof(Query),"UPDATE `USERS` SET  DEATHS = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  PInfo[playerid][Deaths], DB_Escape(name));
    db_free_result(db_query(Admin, Query));

    format(Query,sizeof(Query),"UPDATE `USERS` SET  VORTEXPB = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  PInfo[playerid][VortexPB], DB_Escape(name));
    db_free_result(db_query(Admin, Query));

    format(Query,sizeof(Query),"UPDATE `USERS` SET  HOUSES = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  PInfo[playerid][Houses], DB_Escape(name));
    db_free_result(db_query(Admin, Query));

    format(Query,sizeof(Query),"UPDATE `USERS` SET  RACESWON = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  PInfo[playerid][RacesWon], DB_Escape(name));
    db_free_result(db_query(Admin, Query));
   
    format(Query,sizeof(Query),"UPDATE `USERS` SET  RACESRACED = '%d' WHERE `NAME` = '%s' COLLATE NOCASE",  PInfo[playerid][RacesRaced], DB_Escape(name));
    db_free_result(db_query(Admin, Query));
   
    return 1;
}
OnPlayerDisconnect:
pawn Код:
if (PInfo[playerid][Logged] == 1)
    {
        UpdateData(playerid);
        PInfo[playerid][Logged] = 0;
    }
Reply
#8

Jesus fuck, what are you doing? Do it all in one line! Also, why do you escape the player's name? Is not like it contains any special characters. Also, you aren't storing any query data, so why release it? And also, numbers don't require the ' ' in em.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)