mysql_tquery, callback didn't call
#1

Well, everything is in the title, my function OnGuildesLoad is not called.

I use mysql R39-3.

PHP код:
#include <YSI\y_hooks>
hook OnGameModeInit()
{
    print(
"test");
    for(new 
MIN_GUILDESMAX_GUILDESi++)
        
guInfo[i][guChef] = -1;
    return 
mysql_tquery(mysql"SELECT * FROM `Guildes`""OnGuildesLoad");
}
forward OnGuildesLoad();
public 
OnGuildesLoad()
{
    print(
"test 2");
    new
        
cache_get_row_count();
        
    for(new 
guildeid MIN_GUILDESguildeid lguildeid++)
    {
        if(!
cache_get_field_content_int(guildeid"Actif"))
        {
            
guInfo[guildeid][guActif] = false;
            continue;
        }
        
        
NbreGuildes++;
    
        
guInfo[guildeid][guActif] = true;
        
        
cache_get_field_content(guildeid"Nom"guInfo[guildeid][guNom]);
        
guInfo[guildeid][guNiveau] = cache_get_field_content_int(guildeid"Niveau");
        
guInfo[guildeid][guExp] = cache_get_field_content_int(guildeid"Exp");
        
guInfo[guildeid][guExpMax] = cache_get_field_content_int(guildeid"ExpMax");
        
guInfo[guildeid][guChef] = cache_get_field_content_int(guildeid"Chef");
        
guInfo[guildeid][guMembres] = cache_get_field_content_int(guildeid"Membres");
    }
    
    print(
"-----------------------------");
    
printf("%d guilde(s) chargйe(s)."NbreGuildes);
    print(
"-----------------------------");
    
    return 
1;

Код:
[00:43:35] test
[00:43:35] Number of vehicle models: 5
Reply
#2

Looks silly, but worth the try
pawn Код:
return mysql_tquery(mysql, "SELECT * FROM `Guildes`", "OnGuildesLoad", "", "");
If not then make sure you have "mysql_log(LOG_ALL);"
and lets see what's in the "mysql_log.txt"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)