|
试了好久,被杀数-杀人数等于设定的数值就被踢,可是,这个插件试了几次了,无法使用啊。
[PHP]#include <amxmodx>
#include <cstrike>
#define PLUGIN "AutoKick"
#define VERSION "1.0"
#define AUTHOR "ahcat"
public plugin_init() {
register_plugin( PLUGIN, VERSION, AUTHOR);
register_cvar( "dt_autokick", "5");
register_event("DeathMsg", "hook_deathMsg", "a");
}
public hook_deathMsg(){
new nVictim = read_data(2);
new nDeaths = cs_get_user_deaths( nVictim);
new nFrags = get_user_frags( nVictim);
if( nDeaths - nFrags >= get_cvar_num( "dt_autokick")){
new userid = get_user_userid( nVictim);
server_cmd( "kick #%d ^"你的分数太低了...^"", userid);
server_exec();
}
} [/PHP] |
|