You can do it just in fakemeta look up the keyvalue stock in VEN's Fakemeta Utils inc in the tutorials section.
But info_tfdetect can actually be changed midgame, it doesn't have to be on precache. A better way would be to just find the entity on init and then make the changes to the keyvalues.
Also my knowledge of bitfields isnt great so i doubt it makes any difference but when mapping i've always been specific with it like:
team1_allies 14, team2_allies 13, team3_allies 11, team4_allies 7.
Try this... Can't compile/test it myself D: Had to quickly put it together in word because they have sodding restricted notepad on this pc
Code:
#include <amxmodx>
#include <engine>
#define PLUGIN "All Team Allies"
#define AUTHOR "chewweh"
#define VERSION "1.0"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("tfc_fixteams", "1")
if (!get_cvar_num("tfc_fixteams"))
return PLUGIN_CONTINUE
new ent = find_ent_by_class(-1, "info_tfdetect")
if (ent)
{
DispatchKeyValue(ent, "team1_allies", "14")
DispatchKeyValue(ent, "team2_allies", "13")
DispatchKeyValue(ent, "team3_allies", "11")
DispatchKeyValue(ent, "team4_allies", "7")
}
// you could create the ent if it doesn’t exist, although all maps will have one otherwise TFC crashes when you select anything other than the blue team.
return PLUGIN_CONTINUE
}
__________________