SA-MP Forums Archive
cache_get_row - 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: cache_get_row (/showthread.php?tid=479471)



cache_get_row - erorche - 05.12.2013

i'v got errors about cache_get_row?,is the mysql plugin older or ?

pawn Код:
ublic f_LoadPlayer(playerid)
{
    new rows, fields,name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    cache_get_data(rows,fields);
    if(!rows)
    {
        mysql_format(dbhandle,bigquery,"INSERT INTO `players` (`name`,`slot1`,`slot2`,`slot3`,`slot4`,`slot5`,`slot6`,`slot7`,`slot8`,`slot9`,`slot10`) VALUES ('%e',0,0,0,0,0,0,0,0,0,0)",name);
        mysql_function_query(dbhandle,bigquery,false,"","");
        printf("MySQL: Player %s added to furniture database!",name);
    }
    else if(rows)
    {
        new temp[24],countused;
        cache_get_row(0,0,temp); FurnitureInfo[playerid][id] = strval(temp);
        cache_get_row(0,1,temp); format(FurnitureInfo[playerid][Name],MAX_PLAYER_NAME,"%s",name);
        cache_get_row(0,2,temp); FurnitureInfo[playerid][Slot][0] = strval(temp);
        cache_get_row(0,3,temp); FurnitureInfo[playerid][Slot][1] = strval(temp);
        cache_get_row(0,4,temp); FurnitureInfo[playerid][Slot][2] = strval(temp);
        cache_get_row(0,5,temp); FurnitureInfo[playerid][Slot][3] = strval(temp);
        cache_get_row(0,6,temp); FurnitureInfo[playerid][Slot][4] = strval(temp);
        cache_get_row(0,7,temp); FurnitureInfo[playerid][Slot][5] = strval(temp);
        cache_get_row(0,8,temp); FurnitureInfo[playerid][Slot][6] = strval(temp);
        cache_get_row(0,9,temp); FurnitureInfo[playerid][Slot][7] = strval(temp);
        cache_get_row(0,10,temp); FurnitureInfo[playerid][Slot][8] = strval(temp);
        cache_get_row(0,11,temp); FurnitureInfo[playerid][Slot][9] = strval(temp);
        cache_get_row(0,12,temp); FurnitureInfo[playerid][Slot][10] = strval(temp);
        cache_get_row(0,13,temp); FurnitureInfo[playerid][Slot][11] = strval(temp);
        cache_get_row(0,14,temp); FurnitureInfo[playerid][Slot][12] = strval(temp);
        cache_get_row(0,15,temp); FurnitureInfo[playerid][Slot][13] = strval(temp);
        cache_get_row(0,16,temp); FurnitureInfo[playerid][Slot][14] = strval(temp);
        cache_get_row(0,17,temp); FurnitureInfo[playerid][Slot][15] = strval(temp);
        cache_get_row(0,18,temp); FurnitureInfo[playerid][Slot][16] = strval(temp);
        cache_get_row(0,19,temp); FurnitureInfo[playerid][Slot][17] = strval(temp);
        cache_get_row(0,20,temp); FurnitureInfo[playerid][Slot][18] = strval(temp);
        cache_get_row(0,21,temp); FurnitureInfo[playerid][Slot][19] = strval(temp);
        cache_get_row(0,22,temp); FurnitureInfo[playerid][Slot][20] = strval(temp);
        cache_get_row(0,23,temp); FurnitureInfo[playerid][Slot][21] = strval(temp);
        cache_get_row(0,24,temp); FurnitureInfo[playerid][Slot][22] = strval(temp);
        cache_get_row(0,25,temp); FurnitureInfo[playerid][Slot][23] = strval(temp);
        cache_get_row(0,26,temp); FurnitureInfo[playerid][Slot][24] = strval(temp);
        cache_get_row(0,27,temp); FurnitureInfo[playerid][Slot][25] = strval(temp);
        cache_get_row(0,28,temp); FurnitureInfo[playerid][Slot][26] = strval(temp);
        cache_get_row(0,29,temp); FurnitureInfo[playerid][Slot][27] = strval(temp);
        cache_get_row(0,30,temp); FurnitureInfo[playerid][Slot][28] = strval(temp);
        cache_get_row(0,31,temp); FurnitureInfo[playerid][Slot][29] = strval(temp);
        for(new i = 0; i < 10; i++)
        {
            if(FurnitureInfo[playerid][Slot][i] != 0) countused++;
        }
        printf("MySQL: Player %s loaded from furniture database. Objects used: %d!",name,countused);
    }
    return 1;
}



Re: cache_get_row - iZN - 05.12.2013

The cache usage and the threaded queries were in R7+, you can use R20 which is the latest version cache/non-cache queries. If you're going to use R34 (which is the latest one) you will need to change your function to mysql_tquery and it is not having a bool for cache.


Re: cache_get_row - Konstantinos - 05.12.2013

Do you get undefined symbol "cache_get_row"? If so, the a_mysql.inc is an older version and you need to use the include for R7+ (latest R34). You will also need to use the plugin for the same version (their versions should match each other).


Re: cache_get_row - erorche - 05.12.2013

can somebody give me link of mysql R34?


Re: cache_get_row - Konstantinos - 05.12.2013

Quote:
Originally Posted by erorche
Посмотреть сообщение
can somebody give me link of mysql R34?
https://code.******.com/p/sa-mp-mysq...downloads/list

If you have problems, then use R33 which is static version.


Re: cache_get_row - erorche - 05.12.2013

now i got error to samp-server.exe it shows me Missing MSVRC110.dll and i downloaded put it in system32 and again where to put it?


Re: cache_get_row - iZN - 05.12.2013

Quote:
Originally Posted by erorche
Посмотреть сообщение
now i got error to samp-server.exe it shows me Missing MSVRC110.dll and i downloaded put it in system32 and again where to put it?
Don't put that manually, install Visual C++ Package instead.