|
发表于 2009-8-12 16:52:05
|
显示全部楼层
来自 中国–广东–惠州–惠城区
本帖最后由 zwfgdlc 于 2009-8-12 16:57 编辑
你自己试下吧,理论上应该没问题。
- #include <amxmodx>
- #include <amxmisc>
- #include <fakemeta>
- #include <cstrike>
- #include <hamsandwich>
- #define PLUGIN_NAME "New Plug-In"
- #define PLUGIN_VERSION "1.0"
- #define PLUGIN_AUTHOR "zwfgdlc"
- new pcvar_playersnum;
- public plugin_init()
- {
- register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
- pcvar_playersnum=register_cvar("amx_OnOff_playersum","6"); //服务器小于6人时开启
-
- if(engfunc(EngFunc_FindEntityByString,-1,"classname","func_bomb_target")) //如果是de类放包拆包地图
- RegisterHam(Ham_AddPlayerItem,"player","fwd_AddPlayerItem");
-
- if(engfunc(EngFunc_FindEntityByString,-1,"classname","hostage_entity")) //如果是cs类解救人质地图
- register_logevent("Round_Start",2,"1=Round_Start");
-
- return PLUGIN_CONTINUE;
- }
- public fwd_AddPlayerItem(id,ent)
- {
- if(get_pdata_int(ent,43,4) != CSW_C4) return HAM_IGNORED;
- if(get_playersnum(1) > get_pcvar_num(pcvar_playersnum)) return HAM_IGNORED;
-
- cs_set_user_plant(id,0,0);
- set_pev(id,pev_body,0);
-
- message_begin(MSG_BROADCAST,get_user_msgid("ScoreAttrib"),{0,0,0},id);
- write_byte(id);
- write_byte(0);
- message_end();
-
- set_pev(ent,pev_flags,FL_KILLME);
- dllfunc(DLLFunc_Think, ent);
- SetHamReturnInteger(0);
-
- return HAM_SUPERCEDE;
- }
- public Round_Start()
- {
- new ent=-1;
- while((ent=engfunc(EngFunc_FindEntityByString,ent,"classname","hostage_entity")))
- {
- set_pev(ent,pev_flags,FL_KILLME);
- dllfunc(DLLFunc_Think, ent);
- }
- }
复制代码 |
评分
-
查看全部评分
|