引用 | 编辑
HsK
2012-05-19 20:00 |
1楼
▲ |
下面是引用 9889899 于 2012-05-02 20:31 发表的 移除地面手雷的插件..: 复制程式 #include <amxmodx> #include <amxmisc> #include <fakemeta> #include <hamsandwich> const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90) const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE) new cvar_botquota, g_hamczbots; public plugin_init() cvar_botquota = get_cvar_pointer("bot_quota"); public client_putinserver(id) { if (is_user_bot (id) && cvar_botquota && !g_hamczbots) set_task(0.1, "register_ham_czbots", id); } public register_ham_czbots(id) { if (!is_user_connected(id) || !get_pcvar_num(cvar_botquota) || g_hamczbots) return; RegisterHamFromEntity(Ham_Killed, id, "fw_PlayerKilled"); g_hamczbots = true; } public fw_PlayerKilled(victim, attacker, shouldgib) { if (!is_user_connected(victim)) return; new weapons[32], num, weaponid; get_user_weapons(victim, weapons, num); for (new n = 1; n <= 2; n++) { for (new i = 0; i < num; i++) { weaponid = weapons[i] if ((n == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (n == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM))) { new wname[32]; get_weaponname(weaponid, wname, charsmax(wname)); engclient_cmd(victim, "drop", wname); n=10; break; } } } fm_strip_user_weapons(victim); } stock fm_strip_user_weapons(id) { static ent; ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "player_weaponstrip")); if (!pev_valid(ent)) return; dllfunc(DLLFunc_Spawn, ent); dllfunc(DLLFunc_Use, ent, id); engfunc(EngFunc_RemoveEntity, ent); } have not test. x0 |