AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved [TF2] Change death message at the top corner (https://forums.alliedmods.net/showthread.php?t=298225)

Walgrim 06-05-2017 09:59

[TF2] Change death message at the top corner
 
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? :3

Walgrim 06-05-2017 10:15

Re: [TF2] Change death message at the top corner
 
Nevermind, solved it :3

Kinsi 06-05-2017 23:42

Re: [TF2] Change death message at the top corner
 
Maybe you should post your solution for others that might stumble upon your post?

Walgrim 06-06-2017 05:20

Re: [TF2] Change death message at the top corner
 
1 Attachment(s)
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


All times are GMT -4. The time now is 17:22.

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