Raised This Month: $ Target: $400
 0% 

[HELP] GHW's headcrab AI


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ds811888
BANNED
Join Date: Mar 2009
Location: Hong Kong
Old 08-02-2009 , 11:40   [HELP] GHW's headcrab AI
Reply With Quote #1

PHP Code:
public perform_headjump(ent)
{
 if(
pev_valid(ent))
 {
  new 
Float:origin[3], Float:origin2[3], Float:maxspeedFloat:velocity[3]
  
pev(ent,pev_maxspeed,maxspeed)
  
pev(ent,pev_origin,origin)
  new 
Float:blah[3]
  
blah[0] = 40.0 * (maxspeed 20.0)
  
blah[1] = 0.0
  blah
[2] = 40.0 * (20.0 maxspeed)
  
get_offset_origin(ent,blah,origin2)
  
get_speed_vector(origin,origin2,maxspeed 23,velocity)
  if(
velocity[2]<200.0velocity[2]=200.0
  set_pev
(ent,pev_velocity,velocity)
  switch(
random_num(1,3))
  {
   case 
1emit_sound(ent,CHAN_VOICE,"headcrab/hc_attack1.wav",VOL_NORMATTN_NORM,0,PITCH_NORM)
   case 
2emit_sound(ent,CHAN_VOICE,"headcrab/hc_attack2.wav",VOL_NORMATTN_NORM,0,PITCH_NORM)
   case 
3emit_sound(ent,CHAN_VOICE,"headcrab/hc_attack3.wav",VOL_NORMATTN_NORM,0,PITCH_NORM)
  }
  
set_pev(ent,pev_sequence,SQ_IN_AIR)
  
set_pev(ent,pev_gaitsequence,SQ_IN_AIR)
  
set_pev(ent,pev_framerate,FR_IN_AIR)
  new 
param[1]
  
//set_task(1.0 * (20.0 / maxspeed),"remove_flag",ent,param,1)
  
set_task(1.1,"remove_flag",ent,param,1)
 }

How to edit to headcrab just running?

Last edited by ds811888; 08-03-2009 at 04:55.
ds811888 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:19.


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