下面是引用 岳岳 于 2014-01-19 02:45 发表的 ZP狙击手模式问题:
要怎么让幸存者跟狙击手不能丢枪?...每次打字键没按到结果以为有打字不小心按个G就扔掉在也减不回来然后成了一名废物= =
然后再来是怎么让幸存者跟狙击手不会掉枪?每次枪一震掉马上又变回了废物= =....
这两个问题无法解决其实就等于没这两个模式= =|||
.......
是那段没错…
不过有时候枪被「震掉」不是ZP主插件的问题…
而是执行「震掉」这动作的插件没做判断…
例如我在别的插件随便执行「engclient_cmd(id, "drop", "weapon_m249")」…
只要手上拿M249的不论是不是幸存者全都得丢枪…
除非用<hamsandwich>的 Ham_CS_Item_CanDrop 去阻止…
例如:
复制程式
// Weapons calssname
new const weapon_classname[][] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
"weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550", "weapon_galil", "weapon_famas",
"weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249", "weapon_m3", "weapon_m4a1",
"weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552", "weapon_ak47", "weapon_knife", "weapon_p90" }
public plugin_init()
{
for (new i = 0; i < sizeof weapon_classname; i++) if (strlen(weapon_classname[i]) != 0)
{
RegisterHam(Ham_CS_Item_CanDrop, weapon_classname[i], "fw_Item_CanDrop")
}
}
public fw_Item_CanDrop(weapon)
{
static id; id = pev(weapon, pev_owner)
if (is_user_alive(id) && zp_get_user_survivor(id))
{
SetHamReturnInteger(0)
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
被这样设定过的幸存者…只要还活着…武器都会像小刀或手榴弹一样无法丢弃…
这样谁都别想让我丢掉武器啦~
当然遇到 strip_user_weapons 还是得哭哭…