Kick spect (amx plugin)
(Różnice między wersjami)
Linia 1: | Linia 1: | ||
Kikcjuje graczy zbyt długo siedżcych na spectatorze | Kikcjuje graczy zbyt długo siedżcych na spectatorze | ||
− | nie kopie adminów z flagą ''' | + | nie kopie adminów z flagą '''a''' oraz flagą "s" |
*antispec 0/1 kontroluje czy plugin działa czy nie | *antispec 0/1 kontroluje czy plugin działa czy nie | ||
Linia 39: | Linia 39: | ||
team = get_user_team(i) // Team 1 = T, Team 2 = CT | team = get_user_team(i) // Team 1 = T, Team 2 = CT | ||
− | if( team > 0 || !is_user_connected(i) || is_user_bot(i) || is_user_hltv(i) || (get_user_flags(i) & | + | if( team > 0 || !is_user_connected(i) || is_user_bot(i) || is_user_hltv(i) || (get_user_flags(i) & ADMIN_IMMUNITY) || (get_user_flags(i) & ADMIN_LEVEL_G)) { |
specmeter[i] = 0 | specmeter[i] = 0 | ||
} | } | ||
Linia 87: | Linia 87: | ||
new param[1] | new param[1] | ||
param[0] = id | param[0] = id | ||
− | if ((get_user_flags( | + | if ((get_user_flags(i) & ADMIN_IMMUNITY) || (get_user_flags(i) & ADMIN_LEVEL_G)) { |
set_task(10.0, "showinfo", id, param, 1) | set_task(10.0, "showinfo", id, param, 1) | ||
} | } |
Wersja z 11:19, 17 wrz 2006
Kikcjuje graczy zbyt długo siedżcych na spectatorze nie kopie adminów z flagą a oraz flagą "s"
- antispec 0/1 kontroluje czy plugin działa czy nie
- antispec_kicktime n // definuje czas w sekundach (n) na kicknięcie
/* AMX Mod script * * antispec 0/1 - enable or disable kicking of spectators * antispec_kicktime n - n = seconds before kick (60 seconds minimum) * */ #include <amxmod> new specmeter[33] public checkspec() { if (get_cvar_num("antispec") == 0) { return PLUGIN_CONTINUE } if (get_cvar_num("antispec_kicktime") < 60) { set_cvar_num("antispec_kicktime", 60) } new team new i new maxplayers new players[32] get_players(players, maxplayers) for(i = 1; i <= maxplayers; ++i) { team = get_user_team(i) // Team 1 = T, Team 2 = CT if( team > 0 || !is_user_connected(i) || is_user_bot(i) || is_user_hltv(i) || (get_user_flags(i) & ADMIN_IMMUNITY) || (get_user_flags(i) & ADMIN_LEVEL_G)) { specmeter[i] = 0 } else { set_hudmessage(255, 0, 0, -1.0, 0.85, 0, 1.0, 2.0, 0.1, 0.1, 4) show_hudmessage(i,"Spectator kick in: %i sec",(get_cvar_num("antispec_kicktime")-specmeter[i])) specmeter[i] += 1 if (specmeter[i] > get_cvar_num("antispec_kicktime")-1) { specmeter[i] = get_cvar_num("antispec_kicktime") new name[32] get_user_name(i, name, 31) client_print(0, print_chat, "[KICK_SPEC by majri] Gracz %s wyrzucony z powodu przesiadywania na specie (mjr)!", name) client_cmd(i, "echo ^"[KICK_SPEC] Za dlugo siedziales na specie ! ...^";disconnect") } } } return PLUGIN_CONTINUE } public client_disconnect(id) { specmeter[id]=0 return PLUGIN_CONTINUE } public client_connect(id) { specmeter[id]=0 return PLUGIN_CONTINUE } public plugin_init() { register_plugin("Timed Spectator Kicker","1.02","code by jimmy") register_cvar("antispec","1") register_cvar("antispec_kicktime","120") set_task(1.0,"checkspec",156132, "", 0, "b") return PLUGIN_CONTINUE } public client_putinserver(id) { if (!is_user_bot(id)) { new param[1] param[0] = id if ((get_user_flags(i) & ADMIN_IMMUNITY) || (get_user_flags(i) & ADMIN_LEVEL_G)) { set_task(10.0, "showinfo", id, param, 1) } else { set_task(10.0, "showWarn", id, param, 1) } } return PLUGIN_CONTINUE } public showWarn(param[]) { client_print(param[0], print_chat, "[KICK_SPEC by majri] Gracze ze specta beda wyrzucani po uplywie %i seconds", get_cvar_num("antispec_kicktime")) return PLUGIN_CONTINUE } public showinfo(param[]) { client_print(param[0], print_chat, "[KICK_SPEC by majri] Spectator timer disabled due to immunity...") return PLUGIN_CONTINUE }