AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] GHW's headcrab AI (https://forums.alliedmods.net/showthread.php?t=99182)

ds811888 08-02-2009 11:40

[HELP] GHW's headcrab AI
 
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?


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

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