AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Diffirentiate Entities in World that I Can Shoot from Those I Shouldn't (https://forums.alliedmods.net/showthread.php?t=298887)

hellmonja 06-25-2017 04:41

Diffirentiate Entities in World that I Can Shoot from Those I Shouldn't
 
Sorry for the long title. It's a bit hard to explain.

I have this weapon that coded the whole shooting process. It uses ExecuteHam(Ham_TakeDamage) to dish out the damage. Damaging players is fine. Damaging part of the world, however, is where the problem is. If I enabled the "World Damage" it does its work fine but it also destroys stuff I'm not supposed to, like the supply boxes on de_dust maps which the C4 is supposed to blow up. If disabled, I can't destroy certain objects like vents, windows, and even hostages, which is really weird.

So is there a way to filter out those objects I shouldn't be damaging?...

PRoSToTeM@ 06-25-2017 06:10

Re: [HELP] Diffirentiate Entities in World that I Can Shoot from Those I Shouldn't
 
Try to check pev_takedamage for != DAMAGE_NO.

hellmonja 06-25-2017 10:37

Re: [HELP] Diffirentiate Entities in World that I Can Shoot from Those I Shouldn't
 
Quote:

Originally Posted by PRoSToTeM@ (Post 2531571)
Try to check pev_takedamage for != DAMAGE_NO.

Hey it worked! Did it like this:
PHP Code:

if(pev(targetpev_takedamage) == 1)
                
ExecuteHam(Ham_TakeDamagetargetweaponidDAMAGE0DMG_BULLET); 

Tested it across 4 different maps and it works perfectly. Thanks, mate!...:bacon!:


All times are GMT -4. The time now is 23:09.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.