@Anou : To use cache functions in your code after a mysql_tquery, you MUST specify a callback in parameter of mysql_tquery.
Doing like this is the good way : pawn Код:
pawn Код:
|
Look inline functions it does exactly the same as what you want.
|
SA-MP Dedicated Server ---------------------- v0.3z, ©2005-2014 SA-MP Team [02:50:51] [02:50:51] Server Plugins [02:50:51] -------------- [02:50:51] Loading plugin: streamer [02:50:51] *** Streamer Plugin v2.6.1 by Incognito loaded *** [02:50:51] Loaded. [02:50:51] Loading plugin: mysql [02:50:51] > MySQL plugin R5 successfully loaded. [02:50:51] Loaded. [02:50:51] Loading plugin: nativechecker [02:50:51] Loaded. [02:50:51] Loaded 3 plugins. [02:50:51] [02:50:51] Filterscripts [02:50:51] --------------- [02:50:51] Loaded 0 filterscripts. [02:50:51] Error: Function not registered: 'cache_get_data' [02:50:51] Error: Function not registered: 'cache_get_row' [02:50:51] Error: Function not registered: 'mysql_tquery' [02:50:51] Error: Function not registered: 'cache_get_row_int' [02:50:51] Error: Function not registered: 'cache_get_row_float' [02:50:51] Error: Function not registered: 'mysql_log' [02:50:51] Script[gamemodes/LFG.amx]: Run time error 19: "File or function is not found" [02:50:51] Number of vehicle models: 0
SA-MP Dedicated Server
---------------------- v0.3z, ©2005-2014 SA-MP Team [02:50:51] [02:50:51] Server Plugins [02:50:51] -------------- [02:50:51] Loading plugin: streamer [02:50:51] *** Streamer Plugin v2.6.1 by Incognito loaded *** [02:50:51] Loaded. [02:50:51] Loading plugin: mysql [02:50:51] > MySQL plugin R5 successfully loaded. How to fix it ? |
Код:
SA-MP Dedicated Server ---------------------- v0.3z, ©2005-2014 SA-MP Team [02:50:51] [02:50:51] Server Plugins [02:50:51] -------------- [02:50:51] Loading plugin: streamer [02:50:51] *** Streamer Plugin v2.6.1 by Incognito loaded *** [02:50:51] Loaded. [02:50:51] Loading plugin: mysql [02:50:51] > MySQL plugin R5 successfully loaded. [02:50:51] Loaded. [02:50:51] Loading plugin: nativechecker [02:50:51] Loaded. [02:50:51] Loaded 3 plugins. [02:50:51] [02:50:51] Filterscripts [02:50:51] --------------- [02:50:51] Loaded 0 filterscripts. [02:50:51] Error: Function not registered: 'cache_get_data' [02:50:51] Error: Function not registered: 'cache_get_row' [02:50:51] Error: Function not registered: 'mysql_tquery' [02:50:51] Error: Function not registered: 'cache_get_row_int' [02:50:51] Error: Function not registered: 'cache_get_row_float' [02:50:51] Error: Function not registered: 'mysql_log' [02:50:51] Script[gamemodes/LFG.amx]: Run time error 19: "File or function is not found" [02:50:51] Number of vehicle models: 0 |
> MySQL plugin R5 successfully loaded. |
update to R7 http://files.g-stylezzz.com/mysql/re...-win32_vs9.rar Windows |
----------
Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3z, ©2005-2014 SA-MP Team [15:01:03] filterscripts = "" (string) [15:01:03] [15:01:03] Server Plugins [15:01:03] -------------- [15:01:03] Loading plugin: mysql [15:01:03] Failed. [15:01:03] Loaded 0 plugins. [15:01:03] [15:01:03] Filterscripts [15:01:03] --------------- [15:01:03] Loaded 0 filterscripts. [15:01:03] Script[gamemodes/slymind.amx]: Run time error 19: "File or function is not found" [15:01:03] Number of vehicle models: 0 I've this problem, like other people. My mysql plugin is at last version, I downloaded which is posted laslty |
The nativechecker plugin won't help here, you probably just don't have the required C++ redistributables installed. Check the FAQ for a solution.
|
#include <YSI/y_inline> #include <a_mysql> //... inline Callback(number, Float:float) { printf("inline callback called! (number: %d, float: %f)", number, float); } mysql_tquery_inline(sql, "SELECT 1", using inline Callback, "df", 123, 456.7777);
Failed (libmysqlclient_r.so.16: cannot open shared object file: No such file or directory)
for centos6 pls help! |
No, there shouldn't be a problem.
Are you sure you installed the x86 redistributables (and not the x64 ones)? Did you place the libmysql.dll in the server directory? |
public OnFilterScriptInit()
{
print( "> Connecting to MySQL server..." );
sqlconn = mysql_connect( "127.0.0.1", "root", "samp", "thepassistrue" );
ManualVehicleEngineAndLights();
mysql_tquery( sqlconn, "SELECT * FROM `prices`;", "CarPriceLoadInit" );
return 1;
}
forward CarPriceLoadInit();
public CarPriceLoadInit()
{
new tmp[16];
print("Loading Car Prices data.....");
for( new i = 0; i < cache_get_row_count( sqlconn ); i++ ) {
cache_get_field_content( i, "model", tmp, sqlconn ); VehInfo[i][Model] = strval(tmp);
cache_get_field_content( i, "type", tmp, sqlconn ); VehInfo[i][Type] = strval(tmp);
cache_get_field_content( i, "name", VehInfo[i][Name], sqlconn, 64 );
cache_get_field_content( i, "price", tmp, sqlconn ); VehInfo[i][Price][0] = strval(tmp);
}
printf("|- %d Car Prices loaded from database. -|", cache_get_row_count( sqlconn ));
return 1;
}
[23:01:24] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `prices`;", callback: "CarPriceLoadInit", format: "(null)" [23:01:24] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [23:01:24] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [23:01:24] [DEBUG] CMySQLConnection::Connect - connection was successful [23:01:24] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [23:01:24] [DEBUG] CMySQLConnection::Connect - connection was successful [23:01:24] [DEBUG] CMySQLConnection::Connect - connection was successful [23:01:24] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [23:01:24] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [23:01:24] [DEBUG] CMySQLQuery::Execute[CarPriceLoadInit] - starting query execution [23:01:24] [DEBUG] CMySQLQuery::Execute[CarPriceLoadInit] - query was successfully executed within 0.580 milliseconds [23:01:24] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [23:01:24] [DEBUG] Calling callback "CarPriceLoadInit".. [23:01:24] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3z-R4, ©2005-2014 SA-MP Team [23:02:09] [23:02:09] Server Plugins [23:02:09] -------------- [23:02:09] Loading plugin: streamer [23:02:09] Loaded. [23:02:09] Loading plugin: sscanf [23:02:09] [23:02:09] =============================== [23:02:09] sscanf plugin loaded. [23:02:09] Version: 2.8.1 [23:02:09] © 2012 Alex "******" Cole [23:02:09] =============================== [23:02:09] Loaded. [23:02:09] Loading plugin: mysql [23:02:09] >> plugin.mysql: R39-2 successfully loaded. [23:02:09] Loaded. [23:02:09] Loaded 3 plugins. [23:02:09] [23:02:09] Filterscripts [23:02:09] --------------- [23:02:09] Loading filterscript 'ls_mall.amx'... [23:02:09] Loading filterscript 'ls_elevator.amx'... [23:02:09] Loading filterscript 'VehSys.amx'... [23:02:09] [23:02:09] > Connecting to MySQL server... [23:02:09] Loaded 3 filterscripts. [23:02:09] Loaded 3 vehicles from: vehicles/trains.txt [23:02:09] Loaded 3 vehicles from: vehicles/pilots.txt [23:02:09] Loaded 15 vehicles from: vehicles/lv_law.txt [23:02:09] Loaded 39 vehicles from: vehicles/lv_airport.txt [23:02:09] Loaded 255 vehicles from: vehicles/lv_gen.txt [23:02:09] Loaded 38 vehicles from: vehicles/sf_law.txt [23:02:09] Loaded 35 vehicles from: vehicles/sf_airport.txt [23:02:09] Loaded 353 vehicles from: vehicles/sf_gen.txt [23:02:09] Loaded 24 vehicles from: vehicles/ls_law.txt [23:02:09] Loaded 37 vehicles from: vehicles/ls_airport.txt [23:02:09] Loaded 98 vehicles from: vehicles/ls_gen_inner.txt [23:02:09] Loaded 389 vehicles from: vehicles/ls_gen_outer.txt [23:02:09] Loaded 71 vehicles from: vehicles/whetstone.txt [23:02:09] Loaded 168 vehicles from: vehicles/bone.txt [23:02:09] Loaded 61 vehicles from: vehicles/flint.txt [23:02:09] Loaded 96 vehicles from: vehicles/tierra.txt [23:02:09] Loaded 96 vehicles from: vehicles/red_county.txt [23:02:09] Total vehicles from files: 1781 [23:02:09] --------------------------------------- [23:02:09] Running Grand Larceny - by the SA-MP team [23:02:09] --------------------------------------- [23:02:09] Number of vehicle models: 173 [23:02:10]