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;
}
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 PHP код:
|
It was solved with a modification in the loop, but thanks for the willingness to help! + Rep
|
Don't rep for that, and pay attention to the rules of the forum... 24 hour bumps only.
Whilst many of us aren't here 24 hours a day, you will get people who are post whoring to get the count up, or rep hunting to also get their rep up. Those are the usual ones to pounce on these threads. The old 'try this' *pastes code without ANY explanation of what it does*, the blind 'update plugins' without ANY care for how it will affect your script. Be careful about these people, as once the real knowledgeable people get to you, you've already ruined your script more, and are en-grained in an approach which is terribly wrong. Only rep those who actually help you, in an informative sense, and from a technique and advisory/successful helping... Hell, all he did was ask the version of MySQL..... |
Don't rep for that, and pay attention to the rules of the forum... 24 hour bumps only.
Whilst many of us aren't here 24 hours a day, you will get people who are post whoring to get the count up, or rep hunting to also get their rep up. Those are the usual ones to pounce on these threads. The old 'try this' *pastes code without ANY explanation of what it does*, the blind 'update plugins' without ANY care for how it will affect your script. Be careful about these people, as once the real knowledgeable people get to you, you've already ruined your script more, and are en-grained in an approach which is terribly wrong. Only rep those who actually help you, in an informative sense, and from a technique and advisory/successful helping... Hell, all he did was ask the version of MySQL..... |