|
发表于 2009-8-28 02:05:11
|
显示全部楼层
来自 中国–广东–惠州
睡不着,顺手做了一个.用法:在控制台输入amx_on_off命令可以控制自动门
- #include <amxmodx>
- #include <amxmisc>
- #include <hamsandwich>
- #define PLUGIN_NAME "New Plug-In"
- #define PLUGIN_VERSION "1.0"
- #define PLUGIN_AUTHOR "zwfgdlc"
- new bool:OnOff=false;
- public plugin_init()
- {
- register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
- new mapname[32];
- get_mapname(mapname,31);
-
- if(equali(mapname,"de_nuke"))
- {
- RegisterHam(Ham_Touch,"trigger_multiple","fwd_Touch");
- register_clcmd("amx_on_off","cmd_on_off",ADMIN_KICK);
- }else pause("ad");
- }
- public fwd_Touch(ent,id)
- {
- if(OnOff)
- return HAM_SUPERCEDE;
-
- return HAM_IGNORED;
- }
- public cmd_on_off(id)
- {
- OnOff=OnOff?false:true;
-
- return PLUGIN_HANDLED;
- }
复制代码 |
|