|
发表于 2006-9-6 23:56:45
|
显示全部楼层
来自 中国–上海–上海
回复: 【求助】求杀人数和被杀数成负数将被踢出服务器的插件
代码如下.
你测试是否可以工作.
- #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();
- }
-
- }
复制代码 |
|