ahh i see.
how about doing what i did with the planes MG's?
script the shooting. That way you can detect when you shoot someone. Sound good?
EDIT:
These are from admin pro Server_planes/damage.scr
Code:
main local.action:
switch(local.action)
{
case "BOMB":
self zoomoff
self waitthread bomb
break
case "SHOOT":
self thread shoot
self.shooting=1
wait self.shootdelay
self.shooting=0
break
case "CHANGE_WEAPON":
self.canchange = 0
self thread change_weapon
wait self.changedelay
self.canchange = 1
break
}
end
shoot:
local.fwd_vec = angles_toforward self.viewangles
local.start = self gettagposition "eyes bone"
local.hit = trace (local.start + local.fwd_vec * 64 ) (local.start + local.fwd_vec * 22000 ) 0
switch(self.planeweap)
{
case 1: //mg
self.plane playsound mg42_gun_snd_fire
self thread checkhit local.hit
break
case 2: //30 call
self.plane playsound jeep_snd_fire
self thread checkhit local.hit
break
case 3:
self thread rocket local.hit
break
default:
self thread checkhit local.hit
}
/*
self.plane light 1 1 0 10
waitframe
self.plane light 0 0 0 0
local.dirtleft = spawn script_model
local.dirtleft model "models/fx/corona_red.tik"
local.dirtleft.origin = local.hit
local.dirtleft.scale = .5
local.dirtleft notsolid
local.dirtleft commanddelay 1.0 remove
*/
end
checkhit local.place:
self thread mgeffect local.place
for(local.i = 1; local.i <= $player.size; local.i++)
{
local.player= $player[local.i]
if(local.player!=self && local.player != NIL)
{
local.end_or_not = waitthread team_check local.player self
if(local.end_or_not==1)
{
end //end if same team and team team killing is not on
}
if(local.player.flying==1)
{
if(local.player.plane.scale == .75)
{
local.hitvec = local.place - local.player.plane.origin
local.hitvec_fwd = local.hitvec * local.player.plane.forwardvector
local.hitvec_lf = local.hitvec * local.player.plane.leftvector
local.hitvec_up = local.hitvec * local.player.plane.upvector
local.is_hit_fwd = (abs local.hitvec_fwd) <= 200.0
local.is_hit_lf = (abs local.hitvec_lf) <= 200.0
local.is_hit_up = local.hitvec_up >= 0.0 && local.hitvec_up <= 35.0
local.damage = 20
}
else
{
local.hitvec = local.place - local.player.plane.origin
local.hitvec_fwd = local.hitvec * local.player.plane.forwardvector
local.hitvec_lf = local.hitvec * local.player.plane.leftvector
local.hitvec_up = local.hitvec * local.player.plane.upvector
local.is_hit_fwd = (abs local.hitvec_fwd) <= 120.0
local.is_hit_lf = (abs local.hitvec_lf) <= 120.0
local.is_hit_up = local.hitvec_up >= 0.0 && local.hitvec_up <= 15.0
local.damage = 30
}
}
else
{
local.hitvec = local.place - local.player.origin
local.hitvec_fwd = local.hitvec * local.player.forwardvector
local.hitvec_lf = local.hitvec * local.player.leftvector
local.hitvec_up = local.hitvec * local.player.upvector
local.is_hit_fwd = (abs local.hitvec_fwd) <= 32.0
local.is_hit_lf = (abs local.hitvec_lf) <= 32.0
local.is_hit_up = local.hitvec_up >= 0.0 && local.hitvec_up <= 92.0
local.damage = 45
}
if(local.is_hit_fwd && local.is_hit_lf && local.is_hit_up)
{
local.player damage self local.damage self.plane local.player.origin self.forwardvector (0 0 0) 10 1 18 -1
}
}
}
end
team_check local.player local.shooter:
local.gametype = getcvar "g_gametype"
if(local.gametype=="1")
{
end 0
}
local.ff = getcvar "g_teamdamage"
if(local.ff=="0")
{
if(local.player.dmteam == local.shooter.dmteam)
{
end 1
}
}
end 0
mgeffect local.place:
if(self.spawnedmg==0)
{
self.spawnedmg=1
local.left = ( self.plane gettagposition "tag_barrel01")
self.plane.gunleft = spawn statweapons/mg42_gun_fake.tik "targetname" ("planesmgleft" + self.entnum) spawnflags 1
self.plane.gunleft.angles = self.plane.angles
self.plane.gunleft.origin = local.left
self.plane.gunleft attach self.plane "tag_barrel01"
self.plane.gunleft setPlayerUsable 0
if(self.dmteam=="axis")
{
local.right = ( self.plane gettagposition "tag_barrel02")
self.plane.gunright = spawn statweapons/mg42_gun_fake.tik targetname ("planesmgright" + self.entnum) spawnflags 1
self.plane.gunright.angles = self.plane.angles
self.plane.gunright.origin = local.right
self.plane.gunright attach self.plane "tag_barrel02"
self.plane.gunright setPlayerUsable 0
}
else
{
local.right = ( self.plane gettagposition "tag_barrel04")
self.plane.gunright = spawn statweapons/mg42_gun_fake.tik "targetname" ("planesmgright" + self.entnum) spawnflags 1
self.plane.gunright.angles = self.plane.angles
self.plane.gunright.origin = local.right
self.plane.gunright attach self.plane "tag_barrel04"
self.plane.gunright setPlayerUsable 0
}
self.plane.gunright hide
self.plane.gunleft hide
self.plane.gunright notsolid
self.plane.gunleft notsolid
}
local.org = spawn script_origin
local.org.origin = local.place
self.plane.gunright.angles = self.viewangles
self.plane.gunleft.angles = self.viewangles
self.plane.gunright setaimtarget local.org
self.plane.gunleft setaimtarget local.org
self.plane.gunleft anim fire
self.plane.gunright anim fire
local.org remove
//self.plane anim blast
end
in the planes:
a plane is spawned with 2 mg's on their wings.
Above:
The player presses shoot:
The mg's fire blanks, they are dummys, they d not hurt you.
The animations roll on:
The script traces if it would of hit anyone...
the script kills anyone it find with the payer as the attacker.
done.