• Wanting To Remove Bullets Adding Velocity To Shot Players
    6 replies, posted
Title. I'm running a server with an FPS gamemode. It uses a system of complex telescopics and bipods (the CW2.0 weapon base), which are interrupted when you get shot. I'm not sure if this is a result of the weapon base or garry's mod, but I'm looking for a way to get rid of it. Any help appreciated.
I think this might be of use to you: Entity/SetVelocity >Actually binds to CBaseEntity::SetBaseVelocity() which sets the entity's velocity due to forces applied by other entities.
It's 100% a system put in place with the actual SWEP. Go into where the content is located, edit the .lua files and go hunting for stuff that looks like it would be defined as the 'issue' for the interruption. (All I can tell just by reading this is that the SWEP has a system to interrupt when taking damage, to undo when on fire, because if it didn't imagine being shot, then dying without knowing? Would suck.
You can use [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/EntityFireBullets]GM:EntityFireBullets[/url] and set Force to 0 in the Bullet structure.
force only affects props that have physics. One messy method to remove the pushing a player from damage is to do something like this hook.Add("EntityTakeDamage","removeknockback",function(target,dmginfo) if(dmginfo:GetDamageType() == DMG_BULLET) then --Only do this stuff for bullets local dmg = dmginfo:GetDamage() -- Store the damage for later. dmginfo:SetDamage(0) -- Set actual damage to 0, which also prevents pushing players. target:SetHealth(target:Health() - dmg) -- Remove amount of health based on damage. end end) Are there better ways? Maybe? This is the best I have for an answer, and is what I have used.
I'll go ahead and give this a shot. I was recommended by someone else to try a custom damage type. Will see how that have to works as well.
Better way is to make a trace and launch player if hit so.
Sorry, you need to Log In to post a reply to this thread.