Raised This Month: $51 Target: $400
 12% 

[L4d2] Request: Remove kill messages


Post New Thread Reply   
 
Thread Tools Display Modes
Gurluas
Senior Member
Join Date: Apr 2010
Old 12-11-2010 , 14:49   Re: [L4d2] Request: Remove kill messages
Reply With Quote #11

Bump
Gurluas is offline
Gurluas
Senior Member
Join Date: Apr 2010
Old 01-07-2011 , 07:40   Re: [L4d2] Request: Remove kill messages
Reply With Quote #12

bump
Gurluas is offline
Gurluas
Senior Member
Join Date: Apr 2010
Old 02-08-2011 , 20:31   Re: [L4d2] Request: Remove kill messages
Reply With Quote #13

bump, is it even possible?
Gurluas is offline
honorcode23
BANNED
Join Date: Mar 2010
Location: Chile
Old 02-08-2011 , 22:07   Re: [L4d2] Request: Remove kill messages
Reply With Quote #14

This works to block pounce damage announce:

PHP Code:
#include <sourcemod>

public OnPluginStart()
{
    new 
UserMsg:MsgMessage GetUserMessageId("PZDmgMsg");
    
HookUserMessage(MsgMessageOnPZDmgMsgtrue);
}

//Fires anytime a kill, protect, heal, damage x5 message is called (i Guess)
public Action:OnPZDmgMsg(UserMsg:msg_idHandle:bf, const players[], playersNumbool:reliablebool:init)
{
    
//Read Message
    
new iMsgType BfReadByte(bf); //This is the message type id: 12 = Pounce Damage 9 = <player> hit <player> x2 message
    
new iAttackerUserId BfReadShort(bf); //Userid of the attacker or the healer, etc.
    
new iVictimUserId BfReadShort(bf); //Userid of the victim / target
    
BfReadShort(bf); //Unknown
    
new iDamage BfReadShort(bf); //Damage done.
    
    //Print the info to server, uncomment to check
    //PrintToServer("PZDmg Sent: T:%i | A:%i | V:%i | D:%i", iMsgType, iAttackerUserId, iVictimUserId, iDamage);
    
    //If is pounce damage msg, stop it.
    
if(iMsgType == 12)
    {
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;

Un-comment the debug line and check the iMsgType value for the message you wish to block, hope it was helpful.
honorcode23 is offline
Gurluas
Senior Member
Join Date: Apr 2010
Old 02-10-2011 , 08:52   Re: [L4d2] Request: Remove kill messages
Reply With Quote #15

Uncomment the debug line...Ehm what?

Can this remove friendly fire and death messages aswell?
Let me explain what it is for.

We invented a game, Murderer for L4d2 where a player is the murderer. The murderer must kill the other players without them discovering who the murderer is. The players can accuse each other etc. and the Murderer can use it to his Advantage.

Problem is, the murderer cant pick stray targets off because when you hit someone everyone knows that someone shot someone or killed someone.

Thats why I need thoose messages removed.
Say, player 1 notices player 2 is walking around alone. Player 1 wants to kill player 2, but once he kills player 2 the game announces that player 1 killed player 2. So the rest of the survivors knows who the murderer is.

Without the message the game is much more fun.
Gurluas is offline
honorcode23
BANNED
Join Date: Mar 2010
Location: Chile
Old 02-10-2011 , 09:57   Re: [L4d2] Request: Remove kill messages
Reply With Quote #16

Compile this:

PHP Code:
#include <sourcemod>

public OnPluginStart()
{
    new 
UserMsg:MsgMessage GetUserMessageId("PZDmgMsg");
    
HookUserMessage(MsgMessageOnPZDmgMsgtrue);
}

//Fires anytime a kill, protect, heal, damage x5 message is called (i Guess)
public Action:OnPZDmgMsg(UserMsg:msg_idHandle:bf, const players[], playersNumbool:reliablebool:init)
{
    
//Read Message
    
new iMsgType BfReadByte(bf); //This is the message type id: 12 = Pounce Damage 9 = <player> hit <player> x2 message
    
new iAttackerUserId BfReadShort(bf); //Userid of the attacker or the healer, etc.
    
new iVictimUserId BfReadShort(bf); //Userid of the victim / target
    
BfReadShort(bf); //Unknown
    
new iDamage BfReadShort(bf); //Damage done.
    
    //Print the info to server, uncomment to check
    
PrintToServer("PZDmg Sent: T:%i | A:%i | V:%i | D:%i"iMsgTypeiAttackerUserIdiVictimUserIdiDamage);

    return 
Plugin_Continue;

Ok now, every time that kind of messages of friendly-fire, damage x4, <player> killed <player> the message PZDmg is sent. The message can be blocked using return Plugin_Handled. However, if you block this message directly, absolutelly nothing will be sent to players and all messages (linked to this) will be blocked. You only need to block 3 type of messages, so, go to your empty server, check the server console and start doing friendly fire, or kill someone.

The server will print, for example, something like this:

Code:
PZDemg Sent: T:12 | A:1 | V:3 | D:0
"T" would be the message id, this is what you want to block the specific message. When you obtain this value, add the following code you the previous one, remove the "PrintToServer" line and everyone is happy. Suppose the id is 8:

Code:
if(iMsgType == 8)
{
         return Plugin_Handled;
}
Thats all. If you dont understand i cant really help you anymore, i dont have the time to get all the message ids.
honorcode23 is offline
Gurluas
Senior Member
Join Date: Apr 2010
Old 02-10-2011 , 11:38   Re: [L4d2] Request: Remove kill messages
Reply With Quote #17

Let me get this straight...I compile it, get the ID then add the new lines in a new plugin or in the one i compiled before?
Gurluas is offline
honorcode23
BANNED
Join Date: Mar 2010
Location: Chile
Old 02-10-2011 , 12:28   Re: [L4d2] Request: Remove kill messages
Reply With Quote #18

the new one, but the remove "PrintToServer" to avoid the server console spam ;)
honorcode23 is offline
asto
Member
Join Date: Aug 2010
Old 05-13-2011 , 08:11   Re: [L4d2] Request: Remove kill messages
Reply With Quote #19

I would like to remove the red "Kill message" and "Incapacitated message".

The above method doesn't remove these.
asto is offline
asto
Member
Join Date: Aug 2010
Old 05-15-2011 , 09:48   Re: [L4d2] Request: Remove kill messages
Reply With Quote #20

I found a source code here:
http://forums.steampowered.com/forum....php?t=1414777

I found the Left 4 Dead's user message list here:
https://forums.alliedmods.net/showthread.php?t=95894

I put the "PZDmgMsg" into the source.

Code:
#include <sourcemod>

public OnPluginStart()
{
    HookUserMessage(GetUserMessageId("PZDmgMsg"), PZDmgMsg, true);
}

public OnPluginEnd()
{
    UnhookUserMessage(GetUserMessageId("PZDmgMsg"), PZDmgMsg, true);
}

public Action:PZDmgMsg(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init) 
{ 
        return Plugin_Handled; 
}
It removes the messages like "x protected, healed, rescued,... y" below the red kill and incapacitated messages. I tried it with all user messages, but nothing remove the the red "kill and incapacitated" messages.
I need help.
asto is offline
Reply



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 06:54.


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