Raised This Month: $ Target: $400
 0% 

How to delete weapon with i killed?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 10-25-2011 , 15:51   How to delete weapon with i killed?
Reply With Quote #1

Hello!

Here I have this code:

Code:
stock UTIL_Damage(attacker, victim, Float:fDamage, damagebits, ent = 0, const szWeapon[] = ""){
        static info_target = 0;
        if(!info_target)
                info_target = engfunc(EngFunc_AllocString, "info_target");
        
        if(pev_valid(ent))
                ExecuteHamB(Ham_TakeDamage, victim, ent, attacker, fDamage, damagebits);
        else{
                ent = engfunc(EngFunc_CreateNamedEntity, info_target);
                set_pev(ent, pev_classname, szWeapon);
                ExecuteHamB(Ham_TakeDamage, victim, ent, attacker, fDamage, damagebits);
                set_pev(ent, pev_flags, FL_KILLME);
        }
}
Code:
UTIL_Damage(attacker, victim, 40.0, (1<<1), attacker, "");
So yes, it displays the DMG, as well as attacking the victim sees it. But how to do that in the upper right corner of display skull, not a weapon with which they killed but that I must see the DMG of skill.

Cause i'm using this for skills in my mod.

If i make ent = 0 i don't see DMG, but see skull, but if i make ent = attacker i see DMG, but see too weapon witch i killed.
Screeaam.. is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-25-2011 , 16:50   Re: How to delete weapon with i killed?
Reply With Quote #2

http://forums.alliedmods.net/showthr...skull+deathmsg

Use make_deathmsg or modify the deathmsg as it happens.
__________________
Bugsy is offline
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 10-25-2011 , 17:42   Re: How to delete weapon with i killed?
Reply With Quote #3

I had item in Diablo which killing everyone from knife on one hit.
And when u used skill and u have knife this skill killed enemie on one hit.
But I fixed it checking damagebits.

Sorry for my english.

Which damagebit corresponds to the DMG from knife?

Last edited by Screeaam..; 10-25-2011 at 17:42.
Screeaam.. is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-25-2011 , 18:25   Re: How to delete weapon with i killed?
Reply With Quote #4

Bullet/gun and knife have the same damage bits for whatever reason so in addition to checking the bits you have to check attacker weapon.

const DMG_KNIFE = DMG_BULLET | DMG_NEVERGIB;

if ( ( bitdmg & DMG_KNIFE ) == DMG_KNIFE )
__________________

Last edited by Bugsy; 10-25-2011 at 18:26.
Bugsy is offline
Screeaam..
Senior Member
Join Date: Jun 2010
Location: Poland
Old 10-26-2011 , 03:58   Re: How to delete weapon with i killed?
Reply With Quote #5

So if i check in hamsandwich damagebits & DMG_BULLET and in my skill i make damage like (1<<31) will be good?

Yester day i try with DMG_BULLET on AWP and it works very fine.

Okay, you can close this topic. I will try function from ur post.

Thank you.
Screeaam.. 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 14:16.


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