cityhonghu 发表于 2005-11-21 15:56:56

【转贴】自动踢暴力作弊器使用者-为完善!

此为菜鸟服务器的自动踢高手插件,当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
param = id
set_task(30.0, "showWarn", id, param, 1)
}
return PLUGIN_CONTINUE
}

public score_kick(param[]){
new id = param
if ((get_user_flags(id) & ADMIN_IMMUNITY) || (get_user_flags(id) & ADMIN_RESERVATION)) {
remove_task(id)
client_print(id, print_chat, " 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, "%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
get_user_name(id, name, 31)
new uID = get_user_userid(id)
server_cmd("banid 1 #%d", uID)
client_cmd(id, "echo ^" Sorry but you have high strong level, try later...^"; disconnect")
client_print(0, print_chat, " %s was disconnected due to high strong level!", name)
return PLUGIN_CONTINUE
}

public showWarn(param[]) {
client_print(param, print_chat, " Players with strong level higher than %d level will be kicked!", SCORELEVEL)
set_task(float(CHECKTIME), "score_kick", param, param, 1, "b")
return PLUGIN_CONTINUE
}

wk703 发表于 2011-5-8 13:40:56

只是楼主要看懂怎么用而已!
页: [1]
查看完整版本: 【转贴】自动踢暴力作弊器使用者-为完善!