引用 | 編輯
freeze02468
2014-01-11 14:40 |
樓主
▼ |
||
|
引用 | 編輯
a7811311622
2014-01-11 15:07 |
1樓
▲ ▼ |
下面是引用 freeze02468 於 2014-01-11 14:40 發表的 小弟又來問問題了...小弟又來問問題了...,|請問各位大大...:不…上次有說過了…那段已經是很舊又很爛的殺人圖寫法了… 後期的方法就直接修改 DeathMsg 了… 例如: 複製程式 public plugin_init() { register_message(get_user_msgid("DeathMsg"), "message_deathmsg") } public message_deathmsg(msg_id, msg_dest, msg_entity) { static attacker; attacker = get_msg_arg_int(1) //static victim; victim = get_msg_arg_int(2) //static headshot; headshot = get_msg_arg_int(3) static weapon[32]; get_msg_arg_string(4, weapon, sizeof weapon - 1) if (g_Had_DragonSword[attacker] && equal(weapon, "knife")) { set_msg_arg_string(4, "dragonsword") // hud.txt 裡的SPR名稱,例如這裡的名稱是 d_dragonsword } } x1 |
引用 | 編輯
freeze02468
2014-01-11 15:11 |
2樓
▲ ▼ |
引用 | 編輯
freeze02468
2014-01-11 16:04 |
3樓
▲ ▼ |
||||||||||
對不起a78大大...小弟還有一個問題...Sorry
是關於購買青龍偃月刀時的問題... 大大您之前有教過我說要在 複製程式 public zp_extra_item_selected(id, ItemID) 的 複製程式 if(ItemID == g_DragonSword) 中加入 if (g_Had_DragonSword[id]) { client_print(id, print_center, "你已經擁有此武器") return ZP_PLUGIN_HANDLED; // ZP自訂的回傳值,效果就自讓子彈包自己加回去 } 不過不知道為什麼買了不會扣錢..而且還可以一直買...請問是小弟哪裡寫錯了?
x0 |
引用 | 編輯
a7811311622
2014-01-11 21:48 |
4樓
▲ ▼ |
下面是引用 freeze02468 於 2014-01-11 16:04 發表的 :因為寫錯位置了…||= = 你的 get_dragonsword(id) 沒放在 return ZP_PLUGIN_HANDLED; 之後… return 的效果當然沒法影響到 get_dragonsword(id) … 複製程式 public zp_extra_item_selected(id, ItemID) { if(ItemID == g_DragonSword) get_dragonsword(id) // 可是程式是先執行這裡後再往下執行,你給武器的內容在這裡 { if (g_Had_DragonSword[id]) // 滿足某條件? { client_print(id, print_center, "你已經擁有此武器") return ZP_PLUGIN_HANDLED; // 讓下面的主要內容不執行 } // 主要內容 } } x1 |
引用 | 編輯
freeze02468
2014-01-12 01:00 |
5樓
▲ ▼ |
下面是引用 a7811311622 於 2014-01-11 21:48 發表的 : 非常感謝大大的幫忙!! 改插件真的是太難了...雖然有些指令是知道他的意思...但是全部堆起來根本看不懂在做什麼 如果沒有大大你的幫助我根本不行... x0 |
引用 | 編輯
freeze02468
2014-01-12 01:36 |
6樓
▲ ▼ |
||||||||||
下面是引用 a7811311622 於 2014-01-11 21:48 發表的 : 請問大大...能夠在問您一個問題嗎? 小弟有將SPR的指令都寫進去了... https://forums.alliedmods.net/showthread.php?t=175632 如果照著上面網站的教學做是能夠正常顯示 不過這樣普刀和青龍偃月刀都是一樣的SPR 就跟之前的這篇一樣... http://bbs.mychat.to/reads.php?tid=993664 接著小弟將插件裡的指令照著大大的方法修改過了... 就是像這樣子 複製程式 public OnAddToPlayerKnife( const item, const player ) { if( pev_valid( item ) && is_user_alive( player ) ) // just for safety. { if( g_Had_DragonSword[ player ] ) { message_begin( MSG_ONE, MsgIndexWeaponList, .player = player ); write_string( "weapon_dragonsword" ); // WeaponName write_byte( -1 ); // PrimaryAmmoID write_byte( -1 ); // PrimaryAmmoMaxAmount write_byte( -1 ); // SecondaryAmmoID write_byte( -1 ); // SecondaryAmmoMaxAmount write_byte( 2 ); // SlotID (0...N) write_byte( 1 ); // NumberInSlot (1...N) write_byte( CSW_KNIFE ); // WeaponID write_byte( 0 ); // Flags message_end(); } else { message_begin( MSG_ONE, MsgIndexWeaponList, .player = player ); write_string( "weapon_knife" ); // WeaponName write_byte( -1 ); // PrimaryAmmoID write_byte( -1 ); // PrimaryAmmoMaxAmount write_byte( -1 ); // SecondaryAmmoID write_byte( -1 ); // SecondaryAmmoMaxAmount write_byte( 2 ); // SlotID (0...N) write_byte( 1 ); // NumberInSlot (1...N) write_byte( CSW_KNIFE ); // WeaponID write_byte( 0 ); // Flags message_end(); } } } 如果工程太浩大的話那小弟就不好意思麻煩大大了 老是給您添麻煩真不好意思
x0 |
引用 | 編輯
a7811311622
2014-01-12 09:45 |
7樓
▲ ▼ |
引用 | 編輯
freeze02468
2014-01-12 11:20 |
8樓
▲ ▼ |
||||||||||
下面是引用 a7811311622 於 2014-01-12 09:45 發表的 : 不好意思大大 register_clcmd 的後面那一串忘了改了.... 不過...我改完了之後還是一樣沒有跑出來... 還是因為插件本身的關係? 因為在買的時候右邊不會跑出SPR... 或是小弟又那裏打錯了? 可以麻煩請大大幫下一嗎? 對不起小弟比較笨...需要大大的幫忙...
x0 |
引用 | 編輯
freeze02468
2014-01-12 12:22 |
9樓
▲ ▼ |
||||||||||
很對不起大大...在這個問題還沒解決之前又有另外一個問題衍生出來了
這個問題是另外一個插件... 還是關於可以一直買槍的問題... 當我修改完之後,要編譯時出現了... 真的感到萬分的抱歉!! 問了這麼多的問題...
x0 |
引用 | 編輯
a7811311622
2014-01-12 16:40 |
10樓
▲ ▼ |
下面是引用 freeze02468 於 2014-01-12 11:20 發表的 :這是刀子…刀子通常不像武器…右邊會顯示SPR… 除非自己在 public get_dragonsword(id) 裡面加入這段: 複製程式 message_begin( MSG_ONE, MsgIndexWeaponList, .player = player ); write_string( "weapon_dragonsword" ); // WeaponName write_byte( -1 ); // PrimaryAmmoID write_byte( -1 ); // PrimaryAmmoMaxAmount write_byte( -1 ); // SecondaryAmmoID write_byte( -1 ); // SecondaryAmmoMaxAmount write_byte( 2 ); // SlotID (0...N) write_byte( 1 ); // NumberInSlot (1...N) write_byte( CSW_KNIFE ); // WeaponID write_byte( 0 ); // Flags message_end(); 下面是引用 freeze02468 於 2014-01-12 12:22 發表的 :這插件的寫法不是常見的寫法… 第92行的 g_Had_BWGlock[id] 要改成 Get_BitVar(g_Had_BWGlock, id) … x0 |
引用 | 編輯
freeze02468
2014-01-12 17:30 |
11樓
▲ ▼ |
引用 | 編輯
a7811311622
2014-01-13 13:44 |
12樓
▲ ▼ |
引用 | 編輯
freeze02468
2014-01-13 14:18 |
13樓
▲ |