Threaded query with num rows isn't being printed as a log.
#1

Simple issue, weird response.

Current log:
PHP Code:
[databaseConnecting to the database..
[
databaseConnected to the database after (17ms)
[
achievementsLoaded a total of 4 achievements..
Number of vehicle models0
[housesLoaded 55 house wallpapers successfully.
[
interiorsLoaded 4 doors successfully.
[
objectsLoaded 0 objects from the database
And how my house module is looking like:
PHP Code:
enum houseWallpapersVariables {
    
hWP_ID,
    
Float:hWP_x,
    
Float:hWP_y,
    
Float:hWP_z,
    
Float:hWP_rotx,
    
Float:hWP_roty,
    
Float:hWP_rotz,
    
hWP_model,
    
hWP_txdModel,
    
hWP_txdTXD[32],
    
hWP_txdTexture[32],
    
hWP_type,
    
hWP_object
}
static 
houseWallpapersData[500][250][houseWallpapersVariables];
enum houseVariables {
    
houseID,
    
houseOwner[MAX_PLAYER_NAME],
    
houseAdress[64]
}
static 
houseData[500][houseVariables];
#include <YSI\y_hooks>
hook OnGameModeInit() {
    
inline OnHouseDataReceived() {
        for(new 
icache_num_rows(); i++) {
            
cache_get_value_name_int(i"id"houseData[i][houseID]);
            
cache_get_value_name(i"adress"houseData[i][houseAdress], 64);
            
cache_get_value_name(i"owner"houseData[i][houseOwner], MAX_PLAYER_NAME);
        }
        
printf("[houses] Loaded %i houses successfully."cache_num_rows());
    }
    
mysql_tquery(databaseConnection"SELECT * FROM houses");
    
inline OnHouseWallpapersReceived() {
        for(new 
rowrow cache_num_rows(); row++) {
            static 
id;
            
cache_get_value_name_int(row"houseid"id);
            
cache_get_value_name_int(row"model"houseWallpapersData[id][row][hWP_model]);
            
cache_get_value_name_int(row"type"houseWallpapersData[id][row][hWP_type]);
            
cache_get_value_name_int(row"txdModel"houseWallpapersData[id][row][hWP_txdModel]);
            
cache_get_value_name(row"txdTXD"houseWallpapersData[id][row][hWP_txdTXD], 32);
            
cache_get_value_name(row"txdTexture"houseWallpapersData[id][row][hWP_txdTexture], 32);
            
cache_get_value_name_float(row"x"houseWallpapersData[id][row][hWP_x]);
            
cache_get_value_name_float(row"y"houseWallpapersData[id][row][hWP_y]);
            
cache_get_value_name_float(row"z"houseWallpapersData[id][row][hWP_z]);
            
cache_get_value_name_float(row"rotx"houseWallpapersData[id][row][hWP_rotx]);
            
cache_get_value_name_float(row"roty"houseWallpapersData[id][row][hWP_roty]);
            
cache_get_value_name_float(row"rotz"houseWallpapersData[id][row][hWP_rotz]);
            
SetDynamicObjectMaterial((houseWallpapersData[id][row][hWP_object] = CreateDynamicObject(houseWallpapersData[id][row][hWP_model], houseWallpapersData[id][row][hWP_x], houseWallpapersData[id][row][hWP_y], houseWallpapersData[id][row][hWP_z], houseWallpapersData[id][row][hWP_rotx], houseWallpapersData[id][row][hWP_roty], houseWallpapersData[id][row][hWP_rotz])), 0houseWallpapersData[id][row][hWP_txdModel], houseWallpapersData[id][row][hWP_txdTXD], houseWallpapersData[id][row][hWP_txdTexture], 0);
        }
        
printf("[houses] Loaded %i house wallpapers successfully."cache_num_rows());
    }
    
mysql_tquery_inline(databaseConnection"SELECT * FROM `house wallpapers` LIMIT 5000"using inline OnHouseWallpapersReceived);

Why isn't the first /printf/ being printed? I'm so lost.
Reply
#2

you mean why this isn't getting printed?
PHP Code:
printf("[houses] Loaded %i houses successfully."cache_num_rows()); 
if yes then bruh you're executing threaded query for a inline callback. [ didn't work with that so far but maybe ]
so try changing
PHP Code:
mysql_tquery(databaseConnection"SELECT * FROM houses"); 
to ->
PHP Code:
mysql_tquery_inline(databaseConnection"SELECT * FROM houses"using inline OnHouseDataReceived); 
Reply
#3

^ Try the above. I was too late with the same solution.
Reply
#4

ahhhh shieeet, completely forgot to link it to the inline callack
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)