05.03.2017, 02:04
So my Faction System has been having problems displaying the Faction Name.
but not initially.
When I create the faction eg: LSPD.
It will show correctly in /f(actionchat, /stats & /factionlist
but after the server gets turned off & retarted it is not reading or displaying correctly.
its just empty.
like this "Faction: | Rank: Cadet"
it should be "Faction: LSPD | Rank: Cadet"
OnGameModeInit
Stats Displaying Faction & Rank.
Anyone know whats wrong here?
but not initially.
When I create the faction eg: LSPD.
It will show correctly in /f(actionchat, /stats & /factionlist
but after the server gets turned off & retarted it is not reading or displaying correctly.
its just empty.
like this "Faction: | Rank: Cadet"
it should be "Faction: LSPD | Rank: Cadet"
OnGameModeInit
Code:
mysql_tquery(g_SQL, "SELECT * FROM `factions` ORDER BY `id` ASC", "FactionLoad", ""); mysql_tquery(g_SQL, "SELECT * FROM `factionranks` ORDER BY `id` ASC", "LoadFactionRanks", "");
Code:
public FactionLoad() { new rows = cache_num_rows(); for(new i = 0; i < rows && i < MAX_FACTIONS; i ++) { new factionid; cache_get_value_name_int(i, "id", factionid); cache_get_value_name(i, "name", FactionInfo[factionid][Name]); cache_get_value_name_int(i, "rank", FactionInfo[factionid][Rank]); } }
Code:
format(string, sizeof(string), "{00A5FF}** Faction: %s | Rank: %s", FactionInfo[Player[i][Faction]][Name], FactionRanks[Player[i][Faction]][Player[i][FactionRank]]); SendClientMessage(i, COLOR_LIGHTBLUE, string);