Help to update MYSQL plugin
#10

I'll link to samp wiki for R40 which explains all the functions and their parameters in case you need it: https://sampwiki.blast.hk/wiki/MySQL/R40

Quote:
Originally Posted by ubunttu
Посмотреть сообщение
GW.pwn(10040) : warning 213: tag mismatch
Код:
cache_get_value_name(0, "exists", field, ConnectMYSQL);
connection handle is no longer a parameter in cache_get_value_name, remove it.
Quote:
Originally Posted by ubunttu
Посмотреть сообщение
GW.pwn(10060) : warning 202: number of arguments does not match definition
Код:
new facid = cache_insert_id(ConnectMYSQL);
cache_insert_id does not have any parameter, remove connection handle.

Quote:
Originally Posted by ubunttu
Посмотреть сообщение
GW.pwn(11429) : error 025: function heading differs from prototype
Код:
public OnQueryError(errorid, error[], callback[], query[], connectionHandle) {
connection handle has now a tag:
pawn Код:
public OnQueryError(errorid, const error[], const callback[], const query[], MySQL:handle)
Quote:
Originally Posted by pdonald
Посмотреть сообщение
THANK YOU!

You know how to fix it?
PHP код:
 error 017undefined symbol "cache_get_value_int_ovrld" 
PHP код:
 format(sG,sizeof(sG), "{FFFFFF}%i- %s - %d\n"posrankname,cache_get_value_int(r"FISHINGskills")); 
PHP код:
else if(strcmp(params,"fishing",true) == 0) {
    new 
rowsfieldsposrank;
    
mysql_query(ConnectMYSQL,"SELECT * FROM `accounts` ORDER BY FISHINGskills DESC LIMIT 15");
    
cache_get_row_count(rows);
    
cache_get_field_count(fields);
    for(new 
rrowsr++) {
        
posrank 1;
        
cache_get_value_name(r"Username",name);
        
format(sG,sizeof(sG), "{FFFFFF}%i- %s - %d\n"posrankname,cache_get_value_int(r"FISHINGskills"));
        
strcat(DialogNGL,sG);
        
ShowPlayerDialog(playerid20000DIALOG_STYLE_MSGBOX"Raking Fishing"DialogNGL"Fechar""");
    }

cache_get_value_int has two usages:
pawn Код:
native cache_get_value_index_int(row_idx, column_idx, &destination);
native cache_get_value_name_int(row_idx, const column_name[], &destination);
Those do not return the value directly but pass it by reference, so you will need to change it to:
pawn Код:
new player_fishing_skills, Cache: result = mysql_query(ConnectMYSQL, "SELECT * FROM `accounts` ORDER BY FISHINGskills DESC LIMIT 15");

for (new r, rows = cache_num_rows(); r < rows; r++)
{
    cache_get_value(r, "Username", name);
    cache_get_value_int(r, "FISHINGskills", player_fishing_skills);
 
    format(sG, sizeof(sG), "{FFFFFF}%i- %s - %d\n", r + 1, name, player_fishing_skills);
    strcat(DialogNGL, sG);
}

ShowPlayerDialog(playerid, 20000, DIALOG_STYLE_MSGBOX, "Raking Fishing", DialogNGL, "Fechar", "");

cache_delete(result);
As it is non-threaded queries, you will need to store the cache-id and remove it from the memory to avoid memory leaks. Threaded queries are always recommended though so consider changing it eventually.
Reply


Messages In This Thread
Help to update MYSQL plugin - by ubunttu - 16.10.2016, 00:34
Re: Help to update MYSQL plugin - by ubunttu - 16.10.2016, 07:53
Re: Help to update MYSQL plugin - by Konstantinos - 16.10.2016, 09:21
Re: Help to update MYSQL plugin - by Gotham - 16.10.2016, 10:25
Re: Help to update MYSQL plugin - by ubunttu - 16.10.2016, 15:00
Re: Help to update MYSQL plugin - by Konstantinos - 16.10.2016, 15:17
Re: Help to update MYSQL plugin - by pdonald - 17.10.2016, 01:22
Re: Help to update MYSQL plugin - by Konstantinos - 17.10.2016, 10:04
Re: Help to update MYSQL plugin - by ubunttu - 17.10.2016, 12:57
Re: Help to update MYSQL plugin - by Konstantinos - 17.10.2016, 14:53

Forum Jump:


Users browsing this thread: 4 Guest(s)