|
此为菜鸟服务器的自动踢高手插件,当kill与dead的差值达到一定程度自动踢出服务器。防止高手肆意虐待菜鸟及一定程度上防止使用作弊器的用户。
此插件可稍作修改达到防止暴力作弊器。比如改为当每分钟杀人达到指定数(比如10,每分钟能够杀10人的估计也就暴力作弊器吧)自动踢出该用户。
仅供参考 !
/* AMX Mod script
*
* (c) 2004-2005, +ARUKARI-
* http://w4.sytes.net/~money-zero/
*
* Players with immunity won't be checked
*/
#include <amxmod>
#include <amxmisc>
new SCORELEVEL = 20 // kill与dead的最高值
new CHECKTIME = 1 // 测试间隔,单位分
public client_disconnect(id) {
remove_task(id)
return PLUGIN_CONTINUE
}
public client_putinserver(id) {
if (!is_user_bot(id)) {
new param[1]
param[0] = id
set_task(30.0, "showWarn", id, param, 1)
}
return PLUGIN_CONTINUE
}
public score_kick(param[]){
new id = param[0]
if ((get_user_flags(id) & ADMIN_IMMUNITY) || (get_user_flags(id) & ADMIN_RESERVATION)) {
remove_task(id)
client_print(id, print_chat, "[SSK] Strong level checking disabled due to immunity...")
return PLUGIN_CONTINUE
}
new deaths = get_user_deaths(id)
new frags = get_user_frags(id)
new SCORE = (frags - deaths)
if(SCORE>=SCORELEVEL){
kickPlayer(id)
return PLUGIN_HANDLED
}else{
client_print(id,print_chat, "[SSK]%d is your strong level.",SCORE)
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public plugin_init()
{
register_plugin("Server Strong Kicker","1.0","+ARUKARI-")
if (CHECKTIME < 15) CHECKTIME = 15
return PLUGIN_CONTINUE
}
kickPlayer(id) {
new name[32]
get_user_name(id, name, 31)
new uID = get_user_userid(id)
server_cmd("banid 1 #%d", uID)
client_cmd(id, "echo ^"[SSK] Sorry but you have high strong level, try later...^"; disconnect")
client_print(0, print_chat, "[SSK] %s was disconnected due to high strong level!", name)
return PLUGIN_CONTINUE
}
public showWarn(param[]) {
client_print(param[0], print_chat, "[SSK] Players with strong level higher than %d level will be kicked!", SCORELEVEL)
set_task(float(CHECKTIME), "score_kick", param[0], param, 1, "b")
return PLUGIN_CONTINUE
} |
|