Hello guys,
I want to share my source code of the 8shot.
It is an shotgun with 8 bullets and it shoots 105mm ac130 bullets.
Code:
GetCursorPos()
{
forward = self getTagOrigin("tag_eye");
end = self thread vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
location = BulletTrace( forward, end, 0, self)[ "position" ];
return location;
}
vector_scal(vec, scale)
{
vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
return vec;
}
do8shot()
{
self endon("disconnect");
self endon("death");
currentweapon = self GetCurrentWeapon();
self giveWeapon("spas12_eotech_mp", 0, true);
self switchToWeapon("spas12_eotech_mp");
ammo = 8; // amount of ammo
while(1)
{
self waittill( "weapon_fired" );
self.curWeap = self getCurrentWeapon();
if (isSubStr(self.curWeap, "spas12_eotech_mp"))
{
MagicBullet( "ac130_105mm_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );
}
ammo--;
if (ammo <= 0)
break;
wait 0.1;
}
self takeWeapon(self getCurrentWeapon());
self takeWeapon("spas12_eotech_mp");
wait 0.2;
self switchToWeapon(currentweapon);
}
And to call it:
Code:
self thread do8shot();
Credits:
Maker of the ROFL launcher( don't know his name )