[已解決]很奇怪耶

Home Home
引用 | 編輯 s091140
2014-08-04 15:27
樓主
推文 x0
當玩家碰到觸手,就執行tentacle_dmg
//////
public fw_tentacle_touch(tentacle, id)
{
  if(!pev_valid(tentacle))
  return
       
 if(is_user_alive(id))
 {
    tentacle_dmg(id)  
 }
 
 
}
/////
測試傷害功能的指令
register_clcmd("dmg", "tentacle_dmg")


////////
令玩家彈上天並扣血

public tentacle_dmg(id)
{
        if(!is_user_connected(id))
  return
        if(is_user_alive(id))
 {
                static Float:Velocity[3]
                Velocity[0] = 1.0
                Velocity[1] = 1.0
                Velocity[2] = random_float(800.0, 1000.0)
                set_pev(id, pev_velocity, Velocity)
    
 }
 ExecuteHamB(Ham_TakeDamage, id, 0, id, 20.0, DMG_BULLET)  
 }
////////


在測試時發現觸手只會扣血,我不能彈上天

但輸入指令後發現功能無缺

獻花 x0
引用 | 編輯 弒血
2014-08-04 15:42
1樓
  
下面是引用 s091140 於 2014-08-04 15:27 發表的 [npc]很奇怪耶: 到引言文
當玩家碰到觸手,就執行tentacle_dmg
//////
public fw_tentacle_touch(tentacle, id)
{
  if(!pev_valid(tentacle))
.......


public tentacle_dmg(id)
{
if(!is_user_connected(id))
return

        if(is_user_alive(id))
{
                static Float:Velocity[3]
      pev(id, pev_velocity, velocity)
    velocity[2] += random_float(800.0, 1000.0);
                set_pev(id, pev_velocity, Velocity)
  }
}

獻花 x0
引用 | 編輯 s091140
2014-08-04 16:08
2樓
  
多謝回答
可是還未能彈起

獻花 x0
引用 | 編輯 s091140
2014-08-04 16:15
3樓
  
下面是引用 s8720419 於 2014-08-04 15:42 發表的 : 到引言文



public tentacle_dmg(id)
{
if(!is_user_connected(id))
return

        if(is_user_alive(id))
{
                static Float:Velocity[3]
      pev(id, pev_velocity, velocity)
    velocity[2] += random_float(800.0, 1000.0);
                set_pev(id, pev_velocity, Velocity)
  }
}
原來要用SOLID_TRIGGER
否則會被卡住

獻花 x0