How do I allow a vehicle that is both a vehicle script (engine) and a SENT to take bullet damage, not just explosive damage?
Well, the vehicle probably has an (On)EntityTakeDamage function within its files that filters the damage. It's also possible that some weapons could only allow players/certain props to take its damage, such as target:IsPlayer().
I'd search the through the SENT files first for a damage function.
It does, but it does not filter bullets. It's normal.
Can you post the damage functions you find please.
Could be affect by any of the following:
[CODE]
-----hooks
GM:EntityTakeDamage( Entity target, CTakeDamageInfo dmg )
GM:OnDamagedByExplosion( Player ply, CTakeDamageInfo dmginfo )
ENT:OnTakeDamage( CTakeDamageInfo damage )
ENT:PassesDamageFilter( CTakeDamageInfo dmg )
------classes
Entity:PassesDamageFilter( CTakeDamageInfo dmg )
Entity:TakeDamage( number damageAmount, Entity attacker, Entity inflictor )
Entity:TakeDamageInfo( CTakeDamageInfo damageInfo )
Entity:TakePhysicsDamage( CTakeDamageInfo dmginfo ) --technically this also
[/CODE]
[editline]2nd May 2016[/editline]
Note, this could really also very well be an issue with the weapons and how they apply damage to whatever they hit.
If you dont find anything that would block the damage to only allow explosions via checking for the code stuff above. You will have to take a look at a weapon to test this theory.
[editline]2nd May 2016[/editline]
The CTakeDamageInfo is type that has these method available: [url]http://wiki.garrysmod.com/page/Category:CTakeDamageInfo[/url]
Specifically you can set the damage TYPE using : [url]http://wiki.garrysmod.com/page/CTakeDamageInfo/SetDamageType[/url]
You can find a list of damage types here: [url]http://wiki.garrysmod.com/page/Enums/DMG[/url]
These functions are specifically applicable to your problem:
[CODE]
CTakeDamageInfo:IsDamageType( number dmgType )
CTakeDamageInfo:GetDamageType()
CTakeDamageInfo:SetDamageType( number type )
[/CODE]
If I recall correctly, I tested it recently and the hook does not even run for bullet damage... I amplified the damage by 1000x and no matter how much I shot at it, nothing happened.
Well through deduction, im assuming that since:
1. When you fire a weapon at a player, they get hurt.
2. When you shoot props (prop_physics), nothing happens by default except physics.
3. When you shoot a dynamic prop (prop_dynamic) , it can explode..like the barrel.
Maybe weapons check if the entity is "prop_dynamic" or a player before applying damage? And perhaps your car is a different type??
[QUOTE=Palooz;50244228]Well through deduction, im assuming that since:
1. When you fire a weapon at a player, they get hurt.
2. When you shoot props (prop_physics), nothing happens by default except physics.
3. When you shoot a dynamic prop (prop_dynamic) , it can explode..like the barrel.
Maybe weapons check if the entity is "prop_dynamic" or a player before applying damage? And perhaps your car is a different type??[/QUOTE]
This is not my vehicle. I'm just editing this vehicle's code: [url]https://steamcommunity.com/sharedfiles/filedetails/?id=118997241[/url]
Can you post the vehicle's server initialize / damage functions. I can't guess any further without viewing the code.
Sorry, you need to Log In to post a reply to this thread.