06-12-2011, 04:11
(This post was last modified: 06-12-2011, 04:16 by Metro-Police#45.)
My chopper gunner won't shoot AT4 rounds. I tried a MG4 shooting AT4 rounds and it worked well but the chopper gunner has problems.
Code:
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
self thread CG();
}
}
CG()
{
self endon("death");
for(;;)
{
self waittill( "weapon_fired" );
self.curWeap = self getCurrentWeapon();
if (isSubStr(self.curWeap, "cobra_player_minigun_mp"))
{
MagicBullet( "at4_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );
}
}
}
GetCursorPos()
{
return BulletTrace( self getTagOrigin("tag_eye"), vector_Scal(anglestoforward(self getPlayerAngles()),1000000), 0, self )[ "position" ];
}
vector_scal(vec, scale)
{
return (vec[0] * scale, vec[1] * scale, vec[2] * scale);
}