Making gun's radius bigger?

So this for now is just testing, but still I can’t get this thing to work…
Here is the svcode



hook.Add("ShootBullet", "death_shootbullet", function( dmg, num, radius )
	radius = radius * 100
end)


also tried



hook.Add("ShootBullet", "death_shootbullet", function( dmg, num, radius )
	local bullet = {}
        bullet.Spread = Vector( radius * 100, radius * 100, 0 )
end)


ShootBullet isn’t a hook. You can modify the spread in an

GM:EntityFireBullets hook, but this will be called for every weapon that calls FireBullets internally.

huh thanks, and can I ask if you know does FAS2 and CW2 uses it or do I need to modify it differently?

[editline]5th September 2017[/editline]

  • I don’t think that this is working…


hook.Add("EntityFireBullets", "death_shootbullet", function( ent, bullet )
	bullet.Spread = Vector( 5000 * 500, 5000 * 500, 0 )
	return true
end)


[editline]5th September 2017[/editline]

ok, wtf it works with turrets

bumper

maybe FAS2 or CW2 use their own method of firing bullets (I doubt dou, because it would create huge compatibility issues) (http://wiki.garrysmod.com/page/WEAPON/ShootBullet), CW or FAS use their own, what they describe, “dynamic spray” so likely you won’t be able to edit that unless you take apart their base and look how they are doing it.

That helps with my research, so no luck with FAS2 (I haven’t found any docs/wiki) but there is hope for CW2 so I found out that there are two swep variables used for recoil “SWEP.Recoil” and “SWEP.RecoilToSpread” but I don’t know if I can modify them outside the swep file if I can it could work. (https://docs.google.com/document/d/1FC6Lm7ml6eI-ocwSk5GXq5Sv0hZyrfQK9bMkChHhNNk/edit)

You can, just get the weapon entity with :GetWeapon() and do your thing :slight_smile: Just keep in mind that they might keep being overriden by the weapon base, so it’s best in your interest if you look around and find any development hooks in the bases.

huh, I found there is a hook/callback called “calculateRecoil” it might be more efficient but I don’t see any structure of it, could possibly be in files.