AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Displaying side damage indicator (https://forums.alliedmods.net/showthread.php?t=193908)

Liverwiz 08-23-2012 18:38

Displaying side damage indicator
 
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.

Erox902 08-23-2012 19:42

Re: Displaying side damage indicator
 
UIS

ConnorMcLeod 08-24-2012 01:21

Re: Displaying side damage indicator
 
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.

jimaway 08-24-2012 04:55

Re: Displaying side damage indicator
 
wont this just work?
Code:
TakeDamage(id, iEnt, iAttacker, Float:flDmg, iDmgBit) { sethamparaminteger(5, iDmgBit | DMG_SLOWFREEZE) }

Liverwiz 08-24-2012 10:27

Re: Displaying side damage indicator
 
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!

ConnorMcLeod 08-24-2012 11:43

Re: Displaying side damage indicator
 
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.


All times are GMT -4. The time now is 05:43.

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