mysql_tquery, callback didn't call - 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: mysql_tquery, callback didn't call (
/showthread.php?tid=583007)
mysql_tquery, callback didn't call -
Dutheil - 24.07.2015
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 i = MIN_GUILDES; i < MAX_GUILDES; i++)
guInfo[i][guChef] = -1;
return mysql_tquery(mysql, "SELECT * FROM `Guildes`", "OnGuildesLoad");
}
forward OnGuildesLoad();
public OnGuildesLoad()
{
print("test 2");
new
l = cache_get_row_count();
for(new guildeid = MIN_GUILDES; guildeid < l; guildeid++)
{
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
Re: mysql_tquery, callback didn't call -
xVIP3Rx - 24.07.2015
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"