03-16-2011, 03:09
Im trying to put a gun that shot fire.. but i can't get it work
Like the raygun but that shot fire like a flamethrower but i can't...
Code:
doRayGun()
{
self takeAllWeapons();
self giveWeapon("uzi_mp", 0, self calcWeaponOptions(3, 0, 0, 0, 0));
self endon("death");
self endon("disconnect");
while(1)
{
self waittill("weapon_fired");
if(self getCurrentWeapon() != "uzi_mp")
continue;
soundEnt = spawn("script_model", self getAim());
soundEnt playSoundAsMaster("mpl_kls_artillery_impact");
{
for(x = -1; x < 1; x+=0.25)
{
for(y = -1; y < 1; y+=0.25)
{
for(z = -1; z < 1; z+=0.25)
line(self getTagOrigin("tag_weapon_right") + (x, y, z), self getAim() + (x, y, z), (1, 0, 0));
}
}
LoadFX( "weapon/muzzleflashes/fx_pilot_light", self getAim());
RadiusDamage(self getAim(), 64, 1000, 1000, self);
}
soundEnt delete();
}
}
getAim()
{
forward = self getTagOrigin("tag_eye");
end = self vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
Crosshair = BulletTrace( forward, end, true, self )[ "position" ];
return Crosshair;
}
vector_scal(vec, scale)
{
vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
return vec;
}
Like the raygun but that shot fire like a flamethrower but i can't...