Raised This Month: $ Target: $400
 0% 

[REQ] Change/delete "Player has left the game"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Joce93
Senior Member
Join Date: Feb 2016
Old 05-16-2016 , 12:56   [REQ] Change/delete "Player has left the game"
Reply With Quote #1

Hello guys.

Firstly, sorry if i'm in the wrong section.

I need help to change or delete the quote "Player has left the game" when someone leaves the server. (I don't need to change anything about the joining message, it's ok)

I know it's possible,i've seen this before on a server. I want to replace the original quote, not adding another line with a plugin.

I'm playing on Sven Coop (HL1 mod).

Thanks

Last edited by Joce93; 05-16-2016 at 14:08.
Joce93 is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 05-16-2016 , 13:44   Re: [REQ] Change/delete "Player has left the game"
Reply With Quote #2

I have the same request, but I want to erase the original Player Join message to replace it with my own.
__________________
gabuch2 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-16-2016 , 22:38   Re: [REQ] Change/delete "Player has left the game"
Reply With Quote #3

Here is a plugin that is able to block those messages. (dodplugins.net is down at the moment so I couldn't find the original post/code)
__________________
fysiks is offline
Joce93
Senior Member
Join Date: Feb 2016
Old 05-17-2016 , 14:38   Re: [REQ] Change/delete "Player has left the game"
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
Here is a plugin that is able to block those messages. (dodplugins.net is down at the moment so I couldn't find the original post/code)
I tryed on Sven Co-op but it's not working.

Can somebody help me ?
Joce93 is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 05-18-2016 , 02:09   Re: [REQ] Change/delete "Player has left the game"
Reply With Quote #5

something like that !

im not tested

PHP Code:
#include <amxmodx>

public plugin_init() {

    
register_message(get_user_msgid("TextMsg"),    "msgTextMsg");
}
public 
msgTextMsg(msgidmsgdestmsgent) {
    
        new 
sz[80]
        
get_msg_arg_string(2sz79)
        if(
containi(sz"has left the game") != -1)
                return 
PLUGIN_HANDLED
        
return PLUGIN_CONTINUE

__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
SpannerSpammer
Member
Join Date: Mar 2006
Old 05-18-2016 , 05:12   Re: [REQ] Change/delete "Player has left the game"
Reply With Quote #6

Joce93, the default HL disconnect message is sent via a SayText MSG.

Try hooking that before trying TextMsg. If that doesn't work then try hooking
different messages until you find the right one: HudText , HudTextPro etc.

_____________________________________________ _________________________

Shattered Heart Lynx. The default HL connect message is sent via TextMsg,
hook that and use set_msg_arg_string() to modify it.

Now bear in mind that different MODs might use different messages than the default HL
ones to send connect/disconnect messages.
__________________
[NeoTF|DEV]SpannerSpammer-[AoE]-
NeoTF Development Team.
http://steamcommunity.com/groups/neotf

Last edited by SpannerSpammer; 05-18-2016 at 05:24.
SpannerSpammer is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-18-2016 , 09:07   Re: [REQ] Change/delete "Player has left the game"
Reply With Quote #7

You could always hook the messages and write all of them to a file and you should be able to find the message you are looking for.
__________________
fysiks is offline
Joce93
Senior Member
Join Date: Feb 2016
Old 05-19-2016 , 14:01   Re: [REQ] Change/delete "Player has left the game"
Reply With Quote #8

Quote:
Originally Posted by SpannerSpammer View Post
Joce93, the default HL disconnect message is sent via a SayText MSG.

Try hooking that before trying TextMsg. If that doesn't work then try hooking
different messages until you find the right one: HudText , HudTextPro etc.

_____________________________________________ _________________________

Shattered Heart Lynx. The default HL connect message is sent via TextMsg,
hook that and use set_msg_arg_string() to modify it.

Now bear in mind that different MODs might use different messages than the default HL
ones to send connect/disconnect messages.


Can you help me for the script ? I used abdobiskra's code replacing "TextMsg" by "SayText" but it does not work:

PHP Code:
#include <amxmodx>

public plugin_init() {

    
register_message(get_user_msgid("SayText"),    "msgSayText");
}
public 
msgSayText(msgidmsgdestmsgent) {
    
        new 
sz[80]
        
get_msg_arg_string(2sz79)
        if(
containi(sz"example message") != -1)
                return 
PLUGIN_HANDLED
        
return PLUGIN_CONTINUE

Joce93 is offline
SpannerSpammer
Member
Join Date: Mar 2006
Old 05-19-2016 , 19:01   Re: [REQ] Change/delete "Player has left the game"
Reply With Quote #9

Here you go, this is just an example of what to do. The type and usage of Connect/Disconnect messages
may depend on The MOD. For instance, TFC sends a TextMsg Disconnect message with a localized string
for the 2nd (string) parameter and the disconnecting player name for the 3rd (string) parameter.

The code is set to override the connect/disconnect message witha custom one,
to just block the messages, comment out the line: #define OVERRIDE

Spoiler
__________________
[NeoTF|DEV]SpannerSpammer-[AoE]-
NeoTF Development Team.
http://steamcommunity.com/groups/neotf

Last edited by SpannerSpammer; 05-19-2016 at 19:08.
SpannerSpammer is offline
SpannerSpammer
Member
Join Date: Mar 2006
Old 05-20-2016 , 14:59   Re: [REQ] Change/delete "Player has left the game"
Reply With Quote #10

Forgot to add: If the MOD uses a titles.txt file, check and see if there is a
localized text entry for a connection message ( %s has joined the game ) etc.

For TFC it looks like:
Code:
Game_playerjoin
{
%s has joined the game
}
This is sent via a TextMsg message as the 2nd parameter, all localized strings are preceded
with the # chracter so the string is sent as: #Game_playerjoin. The 3rd parameter
of the message is the player name.
__________________
[NeoTF|DEV]SpannerSpammer-[AoE]-
NeoTF Development Team.
http://steamcommunity.com/groups/neotf
SpannerSpammer 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 00:26.


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