Raised This Month: $ Target: $400
 0% 

Solved [TF2] Change death message at the top corner


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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 - 200 views - 944 Bytes)
__________________
Walgrim is offline
 



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 21:09.


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