This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Displaying side damage indicator


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 08-23-2012 , 18:38   Displaying side damage indicator
Reply With Quote #1

You know how on the right of your screen (maybe left) when you get certain types of damage it displays an icon. i.e. poison gas displays a gas mask, fire a little flame, ice/ddrowing displays a snow flake or w/e.

I want to force the display of that. How would i do that?

Specifically i want to display the snowflake when attacked.
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 08-23-2012 , 19:42   Re: Displaying side damage indicator
Reply With Quote #2

UIS
Erox902 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-24-2012 , 01:21   Re: Displaying side damage indicator
Reply With Quote #3

Depends of damageBit you pass in TakeDamage and also inflictor origin is used.

If you don't use TakeDamage, you can make the game send such msg by setting :

pev_dmg_take
m_bitsDamageType
pev_dmg_inflictor

See in my gasnade plugin i've made such a code. http://forums.alliedmods.net/showthread.php?p=532225

Code :

PHP Code:
TakeDamage(idiEntiOwnerflDmgDMG_SLOWFREEZE
PHP Code:
TakeDamage(idiEntiAttackerFloat:flDmgiDmgBit)
{
    new 
Float:flHealth;
    
pev(idpev_healthflHealth);

    
flHealth -= flDmg;

    if( 
flHealth )
    {
        
ExecuteHamBHam_KilledidiAttacker);
        return;
    }

    
set_pev(idpev_healthflHealth);

    
set_pev(idpev_dmg_takeflDmg);
    
set_pdata_int(idm_bitsDamageTypeiDmgBit);
    
set_pev(idpev_dmg_inflictoriEnt);

I use this because i want to know output damage, but if you don't care, you can just use ExecuteHam(Ham_TakeDamage with correct damageBit.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-24-2012 at 01:23.
ConnorMcLeod is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 08-24-2012 , 04:55   Re: Displaying side damage indicator
Reply With Quote #4

wont this just work?
Code:
TakeDamage(id, iEnt, iAttacker, Float:flDmg, iDmgBit) { sethamparaminteger(5, iDmgBit | DMG_SLOWFREEZE) }
jimaway is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 08-24-2012 , 10:27   Re: Displaying side damage indicator
Reply With Quote #5

I really just want to display that icon. Not actually deal damage. But when i get to that i'll look over those options more thoroughly and decide accordingly.

Thanks for all responses!
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-24-2012 , 11:43   Re: Displaying side damage indicator
Reply With Quote #6

Then use only 3 last lines of the stock i gave, will only trigger the Damage message.
Or send manually a Damage message using message_begin.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:33.


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