引用 | 編輯
abc121212
2010-09-01 20:12 |
樓主
▼ |
||
x0
我又來啦迷:發這樣多文不悶嗎 我:不= = 問題: drop_weapons(id, 1) 是用來趺落武器嗎? 不是的話 那是什麼呢? x0
|
引用 | 編輯
史來姆
2010-09-01 20:23 |
5樓
▲ ▼ |
我把整段給你看..
首先設定"東西"(= =) 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) 然後再加上這個"東西"(= ="""): 複製程式 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) } } } x0 |
引用 | 編輯
abc121212
2010-09-01 20:26 |
6樓
▲ ▼ |
完全不明白= =
那個 drop_weapons(id, dropwhat) dropwhat是CSW_武器? x0 |
引用 | 編輯
史來姆
2010-09-01 20:29 |
7樓
▲ ▼ |
一字記之曰: 複製後貼上 (謎:這不是一"字"吧......)
之後再在適當的位置寫上 drop_weapons(id, 1) 此指令為丟掉持有主槍 或者 drop_weapons(id, 2) 此指令為丟掉持有副槍 可不是CSW_XXX喔,是1或者2~ x0 |
引用 | 編輯
chuchung712
2010-09-01 20:56 |
11樓
▲ ▼ |
static weap_id
weap_id = get_user_weapon(id) if (weap_id == CSW_KNIFE) XXX 自己換成要的武器 x0 |
引用 | 編輯
史來姆
2010-09-01 21:17 |
13樓
▲ ▼ |
我也不太懂......如果跟照朱聰大的話
應該是這樣 if(cs_get_user_weapon(id) == CSW_M4A1) //如果持有M4A1的話 drop_weapons(id, 1) //掉下主槍(M4A1) 有錯不要罵我,我只是amxx爛手 x0 |
引用 | 編輯
abc121212
2010-09-01 21:19 |
14樓
▲ ▼ |
那如果多把槍的話 是不是
if(cs_get_user_weapon(id) == CSW_M4A1) //如果持有M4A1的話 if(cs_get_user_weapon(id) == CSW_AWP) if(cs_get_user_weapon(id) == CSW_P90) if(cs_get_user_weapon(id) == CSW_SG552) drop_weapons(id, 1) //掉下全部槍 x0 |
引用 | 編輯
森之千手
2010-09-01 21:21 |
15樓
▲ ▼ |
if(cs_get_user_weapon(id) == CSW_M4A1 || cs_get_user_weapon(id) == CSW_AWP || cs_get_user_weapon(id) == CSW_P90 || cs_get_user_weapon(id) == CSW_SG552)
x0 |
引用 | 編輯
chuchung712
2010-09-01 21:21 |
16樓
▲ ▼ |
居然被無視了…
算了 洗澡去 x0 |
引用 | 編輯
abc121212
2010-09-01 21:22 |
17樓
▲ ▼ |
即是
if(cs_get_user_weapon(id) == CSW_M4A1 cs_get_user_weapon(id) == CSW_AWP cs_get_user_weapon(id) == CSW_P90 Cs_get_user_weapon(id) == CSW_SG552) drop_weapons(id, 1) // 是嗎? x0 |
引用 | 編輯
史來姆
2010-09-01 21:25 |
18樓
▲ ▼ |
一於採用朱聰大的方法=v=也許這樣會較好(我總覺得我寫錯了甚麼似的....)
static weap_id weap_id = get_user_weapon(id) if(weap_id == CSW_M4A1 || weap_id == CSW_AWP || weap_id == CSW_P90 || weap_id == CSW_SG552) drop_weapons(id, 1) x0 |
引用 | 編輯
abc121212
2010-09-01 21:29 |
19樓
▲ ▼ |
有錯誤
.......................................sma(40) : eroor055: start of function body with out function header x0 |
引用 | 編輯
史來姆
2010-09-01 21:30 |
20樓
▲ ▼ |
你的標題啊.......
不能在任何一個空白處加上指令...... (小弟還有電腦系的東西要弄,先告退,接下來交給各位大大) x0 |
引用 | 編輯
肥貓貓
2010-09-23 04:30 |
24樓
▲ ▼ |
那invalid function or declaration又是什麼意思
你沒有先定義 weap_id 就使用這個函數 Pawn很笨 會看不懂. 所以 public blah_weap_stuff(id) { new static weap_id = get_user_weapon(id,_,_); if(weap_id == CSW_AWP) { // blah balh } // blah blah... } 其實不需要用到 static 這個 簡單點的話也可以用成 new weap_id = get_user_weapon(id,_,_); x0 |
引用 | 編輯
a7811311622
2010-09-23 10:22 |
25樓
▲ ▼ |
下面是引用 肥貓貓 於 2010-09-23 04:30 發表的 : 嘛…會出現錯誤「invalid function or declaration」就代表…編碼用成了有署名的UTF-8了… 至於 static …意見同上…用了 new 又用 static 是意義不明的說… 話說「get_user_weapon(id,_,_)」也能寫成「get_user_weapon(id)」… x0 |
引用 | 編輯
freeze02468
2010-10-03 09:58 |
26樓
▲ ▼ |
它的意思應該是"掉落所有武器"
就是當有人陣亡時,會掉落所有擁有的武器之類的 x0 |