|
发表于 2009-7-22 00:36:18
|
显示全部楼层
来自 中国–河南–郑州
我没有服务器,无法完成测试,简单的做了一个,不知道可不可以。- /* 本插件由 AMXX-Studio 中文版自动生成*/
- /* UTF-8 func by www.DT-Club.net */
- #include <amxmodx>
- #include <amxmisc>
- #define PLUGIN_NAME "BAN CHEATING PLAYER EX"
- #define PLUGIN_VERSION "1.0"
- #define PLUGIN_AUTHOR "Hydralisk"
- // 4 Years ago I was an AMX MOD Scriptor. NOW, I was just a normal citizen...
- // admincmd.amxx module required.
- public plugin_init()
- {
- register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
- register_concmd("amx_superbanip","superbanip",ADMIN_BAN," <playername>: Ban the ip of the very player");
- register_cvar("amx_superbanminutes","60");
- //在此处添加您的代码...
- }
- public superbanip(id,level,cid)
- {
- if (!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED;
-
- new arg[32];
- read_argv(1, arg, 31);
- new player = cmd_target(id, arg, 1);
-
-
- if (!player)
- return PLUGIN_HANDLED;
-
- new playername[32];
- get_user_name(player,playername,31);
-
- set_user_info(player,"cheatflag","cheater");
-
- server_cmd("amx_bannip %s %d",playername,get_cvar_num("amx_superbanminutes"));
- return PLUGIN_HANDLED;
- }
- public client_connect(id)
- {
- new cflag[15];
- get_user_info(id,"cheatflag",cflag,14);
- if (equal(cflag,"cheater"))
- {
- new playername[32];
- get_user_name(id,playername,31);
- server_cmd("amx_bannip %s %d",playername,get_cvar_num("amx_superbanminutes"));
- }
- }
复制代码 需要服务器的AMXX插件运行自带的admincmd.amxx(就是含有amx_banip命令的插件),用法:
amx_superbanip 玩家名
服务器变量:
amx_superbanipminutes banip的时间了。。。个人感觉这个没什么用。。
你试试看吧,我4年多没写插件了,思路比以前窄的多。。 |
|