View Single Post
Walgrim
AlliedModders Donor
Join Date: Dec 2015
Location: France
Old 06-06-2017 , 05:20   Re: [TF2] Change death message at the top corner
Reply With Quote #4

Sure, no problem so, here's the solution :

PHP Code:
#include <sourcemod>
#include <sdkhooks>

public Plugin:myinfo =
{
    
name "[TF2] Death rocket",
    
author "Walgrim",
    
description "Set the death as a deflected critical rocket.",
    
version "1.0"
};


public 
OnPluginStart()
{
    
HookEvent("player_death"OnPlayerDeathEventHookMode_Pre);
}

public 
Action:OnPlayerDeath(Handle:hEventString:strEventName[], bool:bDontBroadcast)
{
    
//Find the dead client
    
new iVictim GetClientOfUserId(GetEventInt(hEvent"userid"));
    
//If this client die
    
if(iVictim) {
        
//Here we set the hEvent death as a deflected rocket
        
SetEventString(hEvent"weapon""deflect_rocket");
        
//Here I set customkill because otherwise it won't take kills like headshots and all
        
SetEventString(hEvent"customkill""deflect_rocket");
        
//And here I just added on the hEvent the crits on it -> leave it if you don't want it
        
SetEventInt(hEvent"damagebits"DMG_CRIT);
    }
    
//Done

So yeah I made little plugin for it, to get the type of kills as "deflect_rocket" just see your console. (client side).

Hope it will help !

I let an attachment for people who wants to try it, I tested it and it worked.
Have fun
Attached Files
File Type: sp Get Plugin or Get Source (deflecteddeath.sp - 192 views - 944 Bytes)
__________________
Walgrim is offline