| 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:maxspeed, Float: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.0) velocity[2]=200.0 set_pev(ent,pev_velocity,velocity) switch(random_num(1,3)) { case 1: emit_sound(ent,CHAN_VOICE,"headcrab/hc_attack1.wav",VOL_NORM, ATTN_NORM,0,PITCH_NORM) case 2: emit_sound(ent,CHAN_VOICE,"headcrab/hc_attack2.wav",VOL_NORM, ATTN_NORM,0,PITCH_NORM) case 3: emit_sound(ent,CHAN_VOICE,"headcrab/hc_attack3.wav",VOL_NORM, ATTN_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?
|