AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   block bomb damage? possible? (https://forums.alliedmods.net/showthread.php?t=87614)

Owyn 03-14-2009 12:36

block bomb damage? possible?
 
i tried ham_takedamage to block all damage on flagged user and return supercode but it blocked all trigger damage and fall damage but not the bomb one )= why?

Dores 03-14-2009 13:04

Re: block bomb damage? possible?
 
You can remove the bomb when it explodes and create a fake exploding animation (with sound).

Owyn 03-14-2009 13:05

Re: block bomb damage? possible?
 
i don't want all players to block bomb damage, just one

Dores 03-14-2009 13:06

Re: block bomb damage? possible?
 
You can kill everyone around the explosion area except for the wanted player.

Owyn 03-14-2009 13:09

Re: block bomb damage? possible?
 
and what about people not so far from bomb but which should not be killed but be damaged?

Dores 03-14-2009 13:13

Re: block bomb damage? possible?
 
You need to use the calculation of distance and damage.
The farther the player, the least damage.
If the player is close, give him high damage.

There are many plugins who use that calculation, search.

P.S: Something like this:

PHP Code:

// From Molotov Cocktail plugin.
tempdmg damage - (damage range) * get_distance_f(originpOrigin); 


Hunter-Digital 03-14-2009 13:19

Re: block bomb damage? possible?
 
or you can just set that player godmode for one second while the bomb explodes...

Dores 03-14-2009 13:26

Re: block bomb damage? possible?
 
Yeah I guess that will work.

Owyn 03-14-2009 14:19

Re: block bomb damage? possible?
 
how do i make player godmode right before explosion?

Exolent[jNr] 03-14-2009 14:26

Re: block bomb damage? possible?
 
When you detect the bomb explosion, you can use this stock:
Code:
// VEN stock fm_cs_get_grenade_type(index) {     if (get_pdata_int(index, 96, 4) & (1<<8))         return CSW_C4;         new bits = get_pdata_int(index, 114, 4);     if (bits & (1<<0))         return CSW_HEGRENADE;     else if (bits & (1<<1))         return CSW_SMOKEGRENADE;     else if (!bits)         return CSW_FLASHBANG;         return 0; }


All times are GMT -4. The time now is 08:56.

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