31.05.2018, 20:40
Hi everyone, I have a loading problem in my faction system, when the stock LoadFactions () is called it does not load the factions, I believe the problem is in the cache_get_value that is not passing the database data to the variables because console show the correct number of the factions loaded, but the faction variables receive no data.
I already tried to fix it in several ways, changing the shape of the loop but without result, does anyone have an idea of how to fix it? Thank you in advance and sorry for my english, this is not my native language.
Here is the code
I already tried to fix it in several ways, changing the shape of the loop but without result, does anyone have an idea of how to fix it? Thank you in advance and sorry for my english, this is not my native language.
Here is the code
PHP код:
stock LoadFactions()
{
new rows;
new Cache:result;
result = mysql_query(Connect, "SELECT * FROM `factions`");
if(cache_get_row_count(rows))
{
for(new i = 0; i < rows; i++)
{
cache_get_value_int(i, "fID", Factions[i][fID]);
cache_get_value_int(i, "fLeaderID", Factions[i][fLeaderID]);
cache_get_value_name(i, "fLeaderName", Factions[i][fLeaderName]);
cache_get_value_name(i, "fNome", Factions[i][fNome]);
cache_get_value_name(i, "fTag",Factions[i][fTag]);
cache_get_value_name(i, "Cargo1Faction", Factions[i][Cargo1Faction]);
cache_get_value_name(i, "Cargo2Faction", Factions[i][Cargo2Faction]);
cache_get_value_name(i, "Cargo3Faction",Factions[i][Cargo3Faction]);
cache_get_value_name(i, "Cargo4Faction",Factions[i][Cargo4Faction]);
cache_get_value_name(i, "Cargo5Faction",Factions[i][Cargo5Faction]);
cache_get_value_int(i, "fKScore", Factions[i][fKScore]);
cache_get_value_int(i, "fDScore", Factions[i][fDScore]);
cache_get_value_int(i, "fCarteira", Factions[i][fCarteira]);
}
}
printf("[Faction] - %i Facзхes foram carregadas!", rows);
Total_Factions_Created = rows;
cache_delete(result);
return 1;
}