引用 | 編輯
timmy3a
2014-07-17 12:50 |
樓主
▼ |
||
x0
擊退力插件 有擊退作用反能寫成 反擊退作用 引力 不是指 無重力 也不是把實體 轉移到 一點 CS地圖上 有一些功能 能做到把 1個範圍的 人拉到1個點 請問插件有可能製造到這效果嗎~? 幻想一下黑洞吧 x0
|
引用 | 編輯
Nailaz
2014-07-17 23:38 |
2樓
▲ ▼ |
new Float:velocity[3]
new Float:origin1[3], Float:origin2[3] new a = -1000/向量,正數即為彈開,負數即為吸引 pev(index1, pev_origin, origin1)//讀取玩家1的座標 pev(index2, pev_origin, origin2)//讀取玩家2的座標 get_speed_vector_to_entity(id, i, a, velocity) velocity[2] += 100.0//上升高度 set_pev(i, pev_velocity, velocity)//設定位置,達到吸引的效果(玩家2的位置,就是玩家2會飛向玩家1) stock get_speed_vector_to_entity(ent1, ent2, Float:speed, Float:new_velocity[3]) { if(!pev_valid(ent1) || !pev_valid(ent2)) return 0; static Float:origin1[3] pev(ent1,pev_origin,origin1) static Float:origin2[3] pev(ent2,pev_origin,origin2) new_velocity[0] = origin2[0] - origin1[0]; new_velocity[1] = origin2[1] - origin1[1]; new_velocity[2] = origin2[2] - origin1[2]; static Float:num num = speed / vector_length(new_velocity); new_velocity[0] *= num; new_velocity[1] *= num; new_velocity[2] *= num; return 1; } x0 |
引用 | 編輯
弒血
2014-07-17 23:48 |
3樓
▲ ▼ |
下面是引用 Nailaz 於 2014-07-17 23:38 發表的 : 那個..其實 不用再取得座標了.. new Float:velocity[3] new a = -1000/向量,正數即為彈開,負數即為吸引 上面那些被劃掉的都是多出來的.. 因為 你把自己跟其餘玩家帶入 get_speed_vector_to_entity 時 裡面就有取得座標的換算了.. 話說...擊退力...把數字改成負數 不就..變成吸力槍 跟 黑洞的原理是一樣的.. x2 |
引用 | 編輯
timmy3a
2014-07-20 12:32 |
5樓
▲ |
下面是引用 Nailaz 於 2014-07-17 23:38 發表的 : 下面是引用 s8720419 於 2014-07-17 23:48 發表的 : 謝謝你們提供方法~ 有空會TEST 一下 如果有問題 我再發表 x0 |