Raised This Month: $32 Target: $400
 8% 

Solved [TF2] Change death message at the top corner


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Walgrim
AlliedModders Donor
Join Date: Dec 2015
Location: France
Old 06-05-2017 , 09:59   [TF2] Change death message at the top corner
Reply With Quote #1

Hey there !

So I think that the title resume the thing.
I'm looking to change the death message at the topcorner into a deflected rocket/tf_projectile_rocket on PlayerDeath.

Thing is I don't really know how to do that, anyone can help?
__________________

Last edited by Walgrim; 06-05-2017 at 10:15.
Walgrim is offline
Walgrim
AlliedModders Donor
Join Date: Dec 2015
Location: France
Old 06-05-2017 , 10:15   Re: [TF2] Change death message at the top corner
Reply With Quote #2

Nevermind, solved it
__________________
Walgrim is offline
Kinsi
Senior Member
Join Date: Apr 2013
Old 06-05-2017 , 23:42   Re: [TF2] Change death message at the top corner
Reply With Quote #3

Maybe you should post your solution for others that might stumble upon your post?
Kinsi is offline
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 - 191 views - 944 Bytes)
__________________
Walgrim is offline
Reply


Thread Tools
Display Modes

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 00:13.


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