對不起!您沒有登入,請先登入論壇
下面是引用 freeze02468 於 2014-01-11 14:40 發表的 小弟又來問問題了...小弟又來問問題了...,|請問各位大大...: 瀏覽此文章需要威望
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 } }
下面是引用 a7811311622 於 2014-01-11 15:07 發表的 : 不…上次有說過了…那段已經是很舊又很爛的殺人圖寫法了…後期的方法就直接修改 DeathMsg 了…
public zp_extra_item_selected(id, ItemID)
if(ItemID == g_DragonSword)
下面是引用 freeze02468 於 2014-01-11 16:04 發表的 : 對不起a78大大...小弟還有一個問題...Sorry是關於購買青龍偃月刀時的問題...大大您之前有教過我說要在.......
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; // 讓下面的主要內容不執行 } // 主要內容 } }
下面是引用 a7811311622 於 2014-01-11 21:48 發表的 : 因為寫錯位置了…||= =你的 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; // 讓下面的主要內容不執行 } // 主要內容 } }
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(); } } }
下面是引用 freeze02468 於 2014-01-12 01:36 發表的 : 請問大大...能夠在問您一個問題嗎? 小弟有將SPR的指令都寫進去了..........
下面是引用 a7811311622 於 2014-01-12 09:45 發表的 : 再重看一次我當初 OnItemSlotKnife 和 register_clcmd 的說明…