i've tried out the kickheads tutorial from Ivana Gibson and it works great.
but i only want to kick these heads when i press the MOUSE2 button, so i have added the command
.float kickgibs; into the defs.qc
then
if (self.impulse == 25)
self.kickgibs = TRUE;
if (self.impulse == 26)
self.kickgibs = FALSE;
into weapons.qc
and this
alias +kickgibs_on "impulse 25"
alias -kickgibs_on "impulse 26"
bind MOUSE2 +kickgibs_on
into my autoexec.cfg
and finally
//**********************************************
//Kicking Gibs n Dead Heads
//**********************************************
void() kick_touch;
void() kick_touch =
{
local vector v;
if (self.kickgibs != TRUE)
return;
// only a player can kick it
if (other.classname != "player")
return;
//randomize sound
if (random()< 0.6)
sound(other, CHAN_ITEM, "zombie/z_hit.wav", 1, ATTN_NORM);
else
sound(other, CHAN_ITEM, "zombie/z_miss.wav", 1, ATTN_NORM);
//define velocity
//you can play with these formulas to adjust
//trajectory
v_x = (other.velocity_x*2+50*random());
v_y = (other.velocity_y*2+50*random());
v_z =250 + 160 * random()+(other.velocity_y+other.velocity_x)*0.30;
self.flags = self.flags - ( self.flags & FL_ONGROUND );
self.velocity = v;
};
but it doesnt work!!!
i hope someone knows whats wrong...