下面是引用 s8720419 於 2010-01-22 20:28 發表的 : 有沒有能丟棄,小槍的指令? 我撿到小槍時,小槍沒丟掉,只有主槍有換到。 能教我怎麼排嗎,或者是打什麼指令才有辦法~ 謝謝。
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)
stock drop_secondary_weapons(id) { // Get user weapons static weapons[32], num, i, weaponid num = 0 // reset passed weapons count (bugfix) get_user_weapons(id, weapons, num) for (i = 0; i < num; i++) { weaponid = weapons if ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM) { static wname[32] get_weaponname(weaponid, wname, sizeof wname - 1) engclient_cmd(id, "drop", wname) } } }
drop_secondary_weapons(id)