AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to delete weapon with i killed? (https://forums.alliedmods.net/showthread.php?t=170503)

Screeaam.. 10-25-2011 15:51

How to delete weapon with i killed?
 
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.

Bugsy 10-25-2011 16:50

Re: How to delete weapon with i killed?
 
http://forums.alliedmods.net/showthr...skull+deathmsg

Use make_deathmsg or modify the deathmsg as it happens.

Screeaam.. 10-25-2011 17:42

Re: How to delete weapon with i killed?
 
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?

Bugsy 10-25-2011 18:25

Re: How to delete weapon with i killed?
 
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 )

Screeaam.. 10-26-2011 03:58

Re: How to delete weapon with i killed?
 
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.


All times are GMT -4. The time now is 14:16.

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