引用 | 編輯
tony486
2013-05-08 05:35 |
樓主
▼ |
||
x0
複製程式
if (g_damage[attacker] >= 150) { g_damage[attacker] -= 150 g_xp[attacker] += 1 } [/pre] 而不是偵查攻擊者的傷害多少 這個是為了修改 獨立槍械攻擊力 誤差問題 例如把攻擊力改為0.1成 扣血只是一半,,,可是偵查出已經破了500傷害. 求指點! 300雅幣!~ x0
|
引用 | 編輯
andyt0621
2013-05-08 08:18 |
1樓
▲ ▼ |
方法一、將TakeDamage轉用為TakeDamage_Post
方法二、將TakeDamage轉用為client_damage 以上兩者都不需改動public下的內容 x0 |
引用 | 編輯
a7811311622
2013-05-08 09:37 |
2樓
▲ ▼ |
下面是引用 andyt0621 於 2013-05-08 08:18 發表的 :如果要取得最正確的傷害數值的話… message_damage 或 client_damage 通常是比 TakeDamage_Post 好一些… 因為 TakeDamage_Post 的傷害不會計算頭盔和同隊傷害的傷害減免… 題外話: ANDY你知道 ExecuteHamB(Ham_TakeDamage 可以不用 LOG_KILL 就能 讓系統自動送出 Ham_Killed 和 DeathMsg 嗎? 最近找資料在AlliedModders爬文才發現的… x1 |
引用 | 編輯
a7811311622
2013-05-08 16:39 |
4樓
▲ ▼ |
引用 | 編輯
andyt0621
2013-05-08 20:07 |
5樓
▲ ▼ |
下面是引用 a7811311622 於 2013-05-08 09:37 發表的 : 我知道TakeDamage可以不用LOG_KILL.. 之前寫一些特殊武器插件就試過了 但"傷害不會計算頭盔和同隊傷害的傷害減免"我就不知道了 0.0 下面是引用 tony486 於 2013-05-08 16:02 發表的: a78大說了.. 但寫插件比較少用.. (至少我還沒用過 xD) x0 |
引用 | 編輯
a7811311622
2013-05-08 23:31 |
6樓
▲ ▼ |
引用 | 編輯
a7811311622
2013-05-09 09:04 |
8樓
▲ ▼ |
引用 | 編輯
andyt0621
2013-05-09 12:18 |
10樓
▲ ▼ |
||||||||||
下面是引用 a7811311622 於 2013-05-08 23:31 發表的 : 還有我寫的WeaponSystem都用了不少次 ExecuteHamB(Ham_TakeDamage的inflictor我每次都寫為attacker.. 不過public Ham_TakeDamage我就沒用過inflictor 下面是引用 tony486 於 2013-05-09 11:37 發表的: 看您還是對ham hook不太了解吧.. 試試這個吧
x0 |
引用 | 編輯
a7811311622
2013-05-09 12:45 |
11樓
▲ ▼ |
下面是引用 andyt0621 於 2013-05-09 12:18 發表的 :一般來說用在槍枝上的傷害 inflictor 寫 attacker 是沒什麼大問題… 不過如果用在榴彈、飛彈等投射物件會發生BUG…發生時機很微妙… 丟出去的那瞬間切換武器…殺人訊息會變成當下拿的武器… 例如拿著M32或M79射出後馬上切換成閃光彈…然後看著殺人圖變成閃光彈… 以下是之前在AlliedModders找到後我稍微修改過的版本: 複製程式 new inflictor = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "weapon_m4a1")) if(pev_valid(inflictor)) { set_pev(inflictor, pev_owner, attacker) ExecuteHamB(Ham_TakeDamage,victim,inflictor,attacker,damage,damage_type) engfunc(EngFunc_RemoveEntity, inflictor) } 因為是系統自動送出的訊息…所以自定義的殺人圖也是會被 message_deathmsg 修改到… 就看你的需求啦…就像 Weapon_Balrog7 的範圍傷害條件根本不會發生這問題也不用寫這堆內容就是了… x0 |
引用 | 編輯
a7811311622
2013-05-09 18:16 |
16樓
▲ ▼ |
引用 | 編輯
andyt0621
2013-05-09 18:35 |
17樓
▲ ▼ |
下面是引用 a7811311622 於 2013-05-09 12:45 發表的 : 試過用M79發射後被殺.. 殺人圖變了SKULL.. 不過也懶Fix了 下面是引用 tony486 於 2013-05-09 17:34 發表的:2121 可以貼上錯誤嗎. 你插件include很多我沒有的inc.. 但正常來說我所修改的內容不應該影響插件內容 x0 |
引用 | 編輯
a7811311622
2013-05-09 18:49 |
18樓
▲ ▼ |
引用 | 編輯
tony486
2013-05-10 03:06 |
20樓
▲ ▼ |
||||||||||
下面是引用 andyt0621 於 2013-05-09 18:35 發表的 :
x0 |
引用 | 編輯
a7811311622
2013-05-10 09:06 |
21樓
▲ ▼ |
引用 | 編輯
a7811311622
2013-05-10 19:52 |
23樓
▲ ▼ |
引用 | 編輯
a7811311622
2013-05-11 08:26 |
25樓
▲ ▼ |
引用 | 編輯
a7811311622
2013-05-11 21:39 |
27樓
▲ ▼ |
下面是引用 tony486 於 2013-05-11 21:09 發表的 :在 register_message(get_user_msgid("TextMsg"), "message_textmsg") 下面插入 複製程式 register_message(get_user_msgid("Damage"), "message_damage") 複製程式 public message_damage(msg_id, msg_dest, victim) if (attacker == victim || !is_user_connected(attacker))改成 複製程式 static attacker; attacker = get_user_attacker(victim) static damage; damage = get_msg_arg_int(2) if (damage <= 0) return HAM_IGNORED if (!(1 <= attacker <= 32) || !(1 <= victim <= 32)) return HAM_IGNORED if (attacker == victim || !is_user_connected(attacker)) return HAM_IGNORED g_damage[attacker] += damage x0 |
引用 | 編輯
tony486
2013-05-11 22:06 |
28樓
▲ ▼ |
下面是引用 a7811311622 於 2013-05-11 21:39 發表的 : 加你那段 立即出現錯誤 x0 |
引用 | 編輯
a7811311622
2013-05-11 22:24 |
29樓
▲ |