其實可以用此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也是這樣寫法= ="")