Raised This Month: $ Target: $400
 0% 

Rocket smoke trail sometimes don't show


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
hzqst
Senior Member
Join Date: Jul 2008
Old 08-02-2009 , 03:51   Rocket smoke trail sometimes don't show
Reply With Quote #1

rocket launch

PHP Code:
public wpn_rocket_shoot(id){
 if(
g_rocket_clip[id] <= 0) return
 if(
g_rocket_status[id] == rocket_draw) return
 new 
Float:start_origin[3], Float:angle[3]
 
pev(idpev_v_angleangle)
 
angle[0] *= -1.0
 
 ck_get_user_startpos
(id24.06.08.0start_origin)
 new 
rocket engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
 
set_pev(rocketpev_anglesangle)
 
set_pev(rocketpev_originstart_origin)
 
set_pev(rocketpev_classname"rocket_rocket")
 
set_pev(rocketPROJECT_REFLECT0)
 
engfunc(EngFunc_SetModelrocketmdl_pj_rocket)
 new 
critical random_num(1,100)
 if(
critical <= g_critical[id] || g_critical_on[id]){
  
set_pev(rocketPROJECT_CRITICAL1)
  
engfunc(EngFunc_EmitSoundidCHAN_WEAPONsnd_rocket_shoot_crit1.0ATTN_NORM0PITCH_NORM)
  if(
g_team[id] == TEAM_REDfm_set_rendering(rocketkRenderFxGlowShell225500kRenderNormal128)
  else 
fm_set_rendering(rocketkRenderFxGlowShell050225kRenderNormal128)
 } else {
  
set_pev(rocketPROJECT_CRITICAL0)
  
engfunc(EngFunc_EmitSoundidCHAN_WEAPONsnd_rocket_shoot1.0ATTN_NORM0PITCH_NORM)
  
fm_set_rendering(rocketkRenderFxGlowShell250128,0kRenderNormal64)
 }
 
set_pev(rocketpev_mins, {-1.0, -1.0, -1.0})
 
set_pev(rocketpev_maxs, {1.01.01.0})
 
set_pev(rocketpev_solidSOLID_TRIGGER)
 
set_pev(rocketpev_movetypeMOVETYPE_FLYMISSILE)
 
set_pev(rocketpev_ownerid)
 new 
Float:velocity[3]
 
velocity_by_aim(idget_pcvar_num(cvar_rocket_velocity), velocity)
 
set_pev(rocketpev_velocityvelocity)
 
//Effect
 
ck_get_user_startpos(id35.06.08.0start_origin)
 
FX_Explode(start_originspr_rocketlaunch630TE_EXPLFLAG_NOSOUND)
 
ck_get_user_startpos(id, -30.06.08.0start_origin)
 
FX_Smoke(start_origin)
 
g_rocket_clip[id] --
 
fm_set_user_anim(idanim_rocket_shoot)
 
g_rocket_time[id] = get_gametime()
 
FX_UpdateClip(idCSW_TMPg_rocket_clip[id])
 
RegisterHamFromEntity(Ham_Touchrocket"fw_Touch_RPGRocket")
 
set_pev(rocketpev_nextthink0.1)
 
RegisterHamFromEntity(Ham_Thinkrocket"fw_Think_RPGRocket")
 
 
ck_showhud_status(id)

and rocket think

PHP Code:
public fw_Think_RPGRocket(rocket){
  if(!
pev_valid(rocket)) return
  new 
Float:origin[3]
  
pev(rocketpev_originorigin)
  
engfunc(EngFunc_PlaybackEvent0rocket260.0originFloat:{0.00.00.0}, 5.05.00200);//It works well with set_task 
  
set_pev(rocketpev_nextthink0.1)

Sometimes it doesn't show the smoke trail

Last edited by hzqst; 08-02-2009 at 03:58.
hzqst is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode