SA-MP Forums Archive
Can't get this to work (relating to threaded mysql). - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can't get this to work (relating to threaded mysql). (/showthread.php?tid=585539)



Can't get this to work (relating to threaded mysql). - Dokins - 14.08.2015

pawn Код:
forward GetRecord(playerid);
public GetRecord(playerid)
{
    new r_msg[500], dialogstring[500], Rows = cache_get_row_count( );

    if(Rows < 1)return SendClientMessage(playerid, COLOUR_GREY, "No records found.");

    for(new n = 0; n < Rows; n++)
    {
        cache_get_row(n, 0, r_msg);
        sscanf(r_msg, "p<|>e<iiiis[24]iiii>", PlayerArrests[n]);
        if(n == 0)
        {
            format(dialogstring, sizeof(dialogstring), ""#COL_WHITE"%s", PlayerArrests[n][ar_cr]);
        }
        else
        {
            format(dialogstring, sizeof(dialogstring), "%s\n"#COL_WHITE"%s", dialogstring, PlayerArrests[n][ar_cr]);
        }
    }

    strcpy(Pdialogstring[playerid], dialogstring, 200);
    ShowPlayerDialog(playerid, DIALOG_RECORDS, DIALOG_STYLE_LIST, "Showing 10 Latest Records.", dialogstring, "Select", "Back");
    return 1;
}
I'm calling the function in a dialog...
pawn Код:
format(string, sizeof(string), "SELECT * FROM `arecords` WHERE `PSQLID` = %d ORDER BY `id` DESC LIMIT 10", psql[playerid]);
                    mysql_tquery(dbHandle, string, "GetRecord", "i", playerid);



Re: Can't get this to work (relating to threaded mysql). - Dokins - 02.11.2015

Bump.