AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Ham_TakeDamage gibs (https://forums.alliedmods.net/showthread.php?t=83273)

Bad_Bud 01-06-2009 22:12

Ham_TakeDamage gibs
 
I'm trying to damage a player by calling a virtual Ham_TakeDamage function. Would it be possible to gib a player based on this damage (if they are killed) by altering the dmgbits? If so, what should I pass through for the dmgbits?

danielkza 01-06-2009 22:23

Re: Ham_TakeDamage gibs
 
Quote:

Originally Posted by Bad_Bud (Post 739672)
I'm trying to damage a player by calling a virtual Ham_TakeDamage function. Would it be possible to gib a player based on this damage (if they are killed) by altering the dmgbits? If so, what should I pass through for the dmgbits?

PHP Code:

// Instant damage values for use with gmsgDamage 3rd value write_long(BIT)
#define DMG_GENERIC                     0           // Generic damage was done
#define DMG_CRUSH                       (1<<0)      // Crushed by falling or moving object
#define DMG_BULLET                      (1<<1)      // Shot
#define DMG_SLASH                       (1<<2)      // Cut, clawed, stabbed
#define DMG_BURN                        (1<<3)      // Heat burned
#define DMG_FREEZE                      (1<<4)      // Frozen
#define DMG_FALL                        (1<<5)      // Fell too far
#define DMG_BLAST                       (1<<6)      // Explosive blast damage
#define DMG_CLUB                        (1<<7)      // Crowbar, punch, headbutt
#define DMG_SHOCK                       (1<<8)      // Electric shock
#define DMG_SONIC                       (1<<9)      // Sound pulse shockwave
#define DMG_ENERGYBEAM                  (1<<10)     // Laser or other high energy beam 
#define DMG_NEVERGIB                    (1<<12)     // With this bit OR'd in, no damage type will be able to gib victims upon death
#define DMG_ALWAYSGIB                   (1<<13)     // With this bit OR'd in, any damage type can be made to gib victims upon death.
#define DMG_DROWN                       (1<<14)     // Drowning
#define DMG_PARALYZE                    (1<<15)     // Slows affected creature down
#define DMG_NERVEGAS                    (1<<16)     // Nerve toxins, very bad
#define DMG_POISON                      (1<<17)     // Blood poisioning
#define DMG_RADIATION                   (1<<18)     // Radiation exposure
#define DMG_DROWNRECOVER                (1<<19)     // Drowning recovery
#define DMG_ACID                        (1<<20)     // Toxic chemicals or acid burns
#define DMG_SLOWBURN                    (1<<21)     // In an oven
#define DMG_SLOWFREEZE                  (1<<22)     // In a subzero freezer
#define DMG_MORTAR                      (1<<23)     // Hit by air raid (done to distinguish grenade from mortar)
#define DMG_TIMEBASED                   (~(0x3fff)) // Mask for time-based damage 


Bad_Bud 01-06-2009 23:01

Re: Ham_TakeDamage gibs
 
Awesome! Does explosive damage only gib when damage is over a certain amount, whereas alwaysgib always gibs?

Edit: seems like blast damage just blows things around.

danielkza 01-06-2009 23:05

Re: Ham_TakeDamage gibs
 
Quote:

Originally Posted by Bad_Bud (Post 739679)
Awesome! Does explosive damage only gib when damage is over a certain amount, whereas alwaysgib always gibs?

Edit: seems like blast damage just blows things around.

I have no idea about every flag's behavior, but you can check the damage yourself and apply the flags according to your own conditions. Seems like the best alternative.

Owyn 03-12-2009 16:58

Re: Ham_TakeDamage gibs
 
what if replace normal damage with another damge type like DMG_SHOCK ?
will it add any effects to when player is hit? will it display an icon to attacked or anything else?
and can i replace damage gibs without calling Ham_Take_damage again?

Dr.G 03-12-2009 18:59

Re: Ham_TakeDamage gibs
 
should be easy to test... put this in a forward and exec that on a bot or something

ExecuteHamB(Ham_TakeDamage, id, iEnt, iAttacker, 10.0, DMG_GENERIC)


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

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