2020-11-06, 04:57 PM
// under OnGameModeInit
mysql_tquery(mysql_connection// change this to yours, "SELECT * FROM `Factions`", "LoadFactions");
forward LoadFactions();
public LoadFactions()
{
new rows, fields;
cache_get_data( rows, fields, your conn handle );
if( rows )
{
for( new i = 0; i < rows; i )
{
cache_get_value_int(i,"id",Factions[i][ID]);
cache_get_value_name(i,"name",Factions[i][Name]);
cache_get_value_name(i,"type",Factions[i][Type]);
cache_get_value_name(i,"Rank1",Factions[i][Rank1]);
cache_get_value_name(i,"Rank2",Factions[i][Rank2]);
cache_get_value_name(i,"Rank3",Factions[i][Rank3]);
cache_get_value_name(i,"Rank1",Factions[i][Rank4]);
}
}
return (true);
}
mysql_tquery(mysql_connection// change this to yours, "SELECT * FROM `Factions`", "LoadFactions");
forward LoadFactions();
public LoadFactions()
{
new rows, fields;
cache_get_data( rows, fields, your conn handle );
if( rows )
{
for( new i = 0; i < rows; i )
{
cache_get_value_int(i,"id",Factions[i][ID]);
cache_get_value_name(i,"name",Factions[i][Name]);
cache_get_value_name(i,"type",Factions[i][Type]);
cache_get_value_name(i,"Rank1",Factions[i][Rank1]);
cache_get_value_name(i,"Rank2",Factions[i][Rank2]);
cache_get_value_name(i,"Rank3",Factions[i][Rank3]);
cache_get_value_name(i,"Rank1",Factions[i][Rank4]);
}
}
return (true);
}