23.08.2018, 12:16
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(Database, DB_Query, sizeof(DB_Query), "SELECT * FROM `factions`");
mysql_tquery(Database, DB_Query, "FactionsRecieved");
print(DB_Query);
}
forward FactionsRecieved();
public FactionsRecieved()
{
if(cache_num_rows() == 0) print("No factions have been made");
else
{
for(new i = 0; i < cache_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(1239, 1, factionInfo[fID][facX], factionInfo[fID][facY], factionInfo[fID][facZ], 0, 0);
}
printf("[INFO]: Loaded %d groups from the database.", cache_num_rows());
}
return true;
}