其实可以用此stock做成效果0.0 但有点麻烦.. 可以参考一下= =""
复制程式
stock drop_weapons(id, dropwhat) // dropwhat: 1 = primary weapon , 2 = secondary weapon
{
// Get user weapons
static weapons[32], num, i, weaponid
num = 0 // reset passed weapons count (bugfix)
get_user_weapons(id, weapons, num)
// Loop through them and drop primaries or secondaries
for (i = 0; i < num; i++)
{
// Prevent re-indexing the array
weaponid = weapons[i]
if ((dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
{
// Get weapon name
static wname[32]
get_weaponname(weaponid, wname, charsmax(wname))
// Drop weapon
engclient_cmd(id, "drop", wname)
}
}
}
之后dropwhat参数为1 则丢弃主枪.
dropwhat参数为2 则丢弃次要枪.
但是不知为啥用了此stock.. 如果运用在开局上且模式为zp(4.3)
会产生跳机的现象(就是我的0.0)
所以保险一点我就用上面的写法...(现在自己的zp也是这样写法= ="")