только рабочий нужен а то only admin spec даже и админам не позволяет. Снизу он, может почему он и админам не позволяет?
Code
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
new pcvar
public plugin_init()
{
register_plugin("Only Admin Spectators","1.0","GHW_Chronic")
pcvar = register_cvar("spec_admin","a")
}
public client_putinserver(id)
{
new adminflags[32]
get_pcvar_string(pcvar,adminflags,31)
if(get_user_flags(id) & read_flags(adminflags))
{
if(task_exists(id)) remove_task(id)
}
set_task(2.0,"check_team",id,"",0,"b")
}
public check_team(id)
{
if(!is_user_connected(id))
{
remove_task(id)
}
else if(cs_get_user_team(id)==CS_TEAM_SPECTATOR)
{
client_print(id,print_center,"[AMXX] Only Specific Admins can go Spec. Forcing team change.")
new num, players[32], Float:ct
get_players(players,num,"g")
for(new i=0;i<num;i++)
{
if(players[i]!=id && cs_get_user_team(players[i])==CS_TEAM_CT) ct += 1.0
}
if(float(num) / 2.0 >= ct) cs_set_user_team(id,CS_TEAM_CT)
else cs_set_user_team(id,CS_TEAM_T)
}
}