
ter_restrict "32 25 4"
ct_restrict "32 25"
Code: Select all
public ter_restrict() { new args[128]; read_args(args, charsmax(args)); add_to_restriction(CS_TEAM_T, args); return PLUGIN_HANDLED;} public ct_restrict() { new args[128]; read_args(args, charsmax(args)); add_to_restriction(CS_TEAM_CT, args); return PLUGIN_HANDLED;} stock add_to_restriction(any:team, args[]) { remove_quotes(args); trim(args); restrictions[team] = 0; if(args[0]) { new arg[32], pos; while((pos = argparse(args, pos, arg, charsmax(arg))) != -1) { restrictions[team] |= (1 << (str_to_num(arg) - 1)); } }} public CS_OnBuy(id, item) { if(item > 32 && item != CSI_SHIELDGUN) { return PLUGIN_CONTINUE; } if(item == CSI_VEST || item == CSI_VESTHELM) { return check_restriction(id, CSI_VEST); } else if(item == CSI_SHIELDGUN) { return check_restriction(id, CSI_VESTHELM); } return check_restriction(id, item);} stock check_restriction(id, item) { if(restrictions[players_team[id]] && (1 << (item - 1))) { return PLUGIN_HANDLED; } return PLUGIN_CONTINUE;}