Not looping through all factions in database.
#1

So I have tried to set it up so it gathers all the information from the table factions. It is meant to create a little 'i' icon for the player in the game at the x y z of the factions. The function "LoadFactions" is called ongamemodeinit, and then successfully calls the net function. Only one symbol is created in the game for one of the factions and not for the second, ect ect.

PHP Code:
forward LoadFactions();
public 
LoadFactions()
{
    new 
DB_Query[900];
    
mysql_format(DatabaseDB_Querysizeof(DB_Query), "SELECT * FROM `factions`");
    
mysql_tquery(DatabaseDB_Query"FactionsRecieved");
    print(
DB_Query);
}
forward FactionsRecieved();
public 
FactionsRecieved()
{
    if(
cache_num_rows() == 0) print("No factions have been made");
    else
    {
         for(new 
0cache_num_rows(); i++)
        {
            
//cache_get_value_int(0, "fID", factionInfo[fID][fID]);
            
cache_get_value(0"facName"factionInfo[fID][facName],32);
            
cache_get_value_name_float(0"facX"factionInfo[fID][facX]);
            
cache_get_value_name_float(0"facY"factionInfo[fID][facY]);
            
cache_get_value_name_float(0"facZ"factionInfo[fID][facZ]);
            
CreateDynamicPickup(12391factionInfo[fID][facX], factionInfo[fID][facY], factionInfo[fID][facZ], 00);
        }
          
printf("[INFO]: Loaded %d groups from the database."cache_num_rows());
    }
    return 
true;

Reply


Messages In This Thread
Not looping through all factions in database. - by yllo - 23.08.2018, 12:16
Re: Not looping through all factions in database. - by Calisthenics - 23.08.2018, 12:25

Forum Jump:


Users browsing this thread: 1 Guest(s)