Quote:
Originally Posted by ConnorMcLeod
Use info_map_parameters entity to disable buy on a wanted team.
Remove the StatusIcon hook.
|
PHP Code:
public plugin_precache()
{
new iEntity = create_entity(info_map_parameters);
g_iTeamMode = register_cvar("wm_teammode", "1"); // 0 = both 1 = T only 2 = CT only.
switch(get_pcvar_num(g_iTeamMode))
{
case 1: DispatchKeyValue(iEntity, "buying", "1");
case 2: DispatchKeyValue(iEntity, "buying", "2");
default: DispatchKeyValue(iEntity, "buying", "3");
}
DispatchSpawn(iEntity);
g_hSpawn = register_forward(FM_Spawn, "FwdSpawn");
}
public FwdSpawn(iEntity)
{
static szClassname[32];
entity_get_string(iEntity, EV_SZ_classname, szClassname, 31);
if(equal(szClassname, info_map_parameters))
{
remove_entity(iEntity);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
The above code for some reason no matter what the value of the cvar is. it allows both teams to buy.