ItsMods

Full Version: How to make a hug message when somebody kill's you with a specific weapon?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For example - I want to add 'bad luck' when somebody kills me with a Tomahawk!
How would I do that?
Code:
                    if ( iDamage > 99 && sWeapon == "tomohawk_mp" )
                    {
                    self thread maps\mp\gametypes\_hud_message::hintMessage("^4Bad Luck", 3);
                    }


If u wanted to show something on the killers screen.. (i would)

Code:
                    if ( iDamage > 99 && sWeapon == "tomohawk_mp" )
                    {
                    eattacker thread maps\mp\gametypes\_hud_message::hintMessage("^4Nice Throw, Bad Idiot!", 3);
                    }

add that to your globallogic player file around the 900th line where you see shit about flash / grenades.. not sure if thats the right weapon name for it, you might need to find that for yourself..
I cannot get it to work every time i add the global player file it cannon compile it
Maybe this will work:

Code:
if (sWeapon == "mp_hatchet")
    {
        self maps\mp\gametypes\_hud_message::hintMessage("^4Bad Luck", 3);
    }

And put it after this code(it's somewhere in player_killed()):
Code:
    if ( (!isDefined( attacker ) || attacker.classname == "trigger_hurt" || attacker.classname == "worldspawn" || attacker == self ) && isDefined( self.attackers )  )
    {        
        if ( !isDefined(bestPlayer) )
        {
            for ( i = 0; i < self.attackers.size; i++ )
            {
                player = self.attackers[i];
                if ( !isDefined( player ) )
                    continue;
                
                if (!isDefined( self.attackerDamage[ player.clientId ] ) || ! isDefined( self.attackerDamage[ player.clientId ].damage ) )
                    continue;
                
                if ( player == self || (level.teamBased && player.team == self.team ) )
                    continue;
                
                if ( self.attackerDamage[ player.clientId ].lasttimedamaged + 2500 < getTime() )
                    continue;            
    
                if ( !allowedAssistWeapon( self.attackerDamage[ player.clientId ].weapon ) )
                    continue;
    
                if ( self.attackerDamage[ player.clientId ].damage > 1 && ! isDefined( bestPlayer ) )
                {
                    bestPlayer = player;
                    bestPlayerMeansOfDeath = self.attackerDamage[ player.clientId ].meansOfDeath;
                    bestPlayerWeapon = self.attackerDamage[ player.clientId ].weapon;
                }
                else if ( isDefined( bestPlayer ) && self.attackerDamage[ player.clientId ].damage > self.attackerDamage[ bestPlayer.clientId ].damage )
                {
                    bestPlayer = player;    
                    bestPlayerMeansOfDeath = self.attackerDamage[ player.clientId ].meansOfDeath;
                    bestPlayerWeapon = self.attackerDamage[ player.clientId ].weapon;
                }
            }
        }
        if ( isdefined ( bestPlayer ) )    
            bestPlayer maps\mp\_medals::assistedSuicide(bestPlayerWeapon);
    }