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

blocking usermessage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
potatoz
AlliedModders Donor
Join Date: Nov 2016
Old 12-09-2018 , 12:10   blocking usermessage
Reply With Quote #1

Hi,

Using gameme, i'm finding it difficult getting rid of some of its connect / disconnect messages. And so i found it easiest to just rid of all gameme-messages considering they don't really have much use in the server and not having coded for a while

I'm finding that this code gets rid of all plugin-messages but the ones i want to get rid off (don't mind the faulty syntax) i'm searching for help in reversing this effect and so it only gets rid of messages with the "gameME:"-prefix

PHP Code:
#include <sourcemod>

public OnPluginStart()
{
    
HookUserMessage(GetUserMessageId("TextMsg"), MsgHooktrue);
}

public 
Action MsgHook(UserMsg msg_idHandle msg, const players[], playersNumbool reliablebool init)
{
    
char buffer[250];
    
PbReadString(msg"params"buffersizeof(buffer), 0);
    
    if (
StrContains(buffer"gameME:"))
        return 
Plugin_Handled;
        
    return 
Plugin_Continue;

__________________

Last edited by potatoz; 12-09-2018 at 12:11.
potatoz is offline
JoinedSenses
Senior Member
Join Date: Sep 2013
Old 12-11-2018 , 18:45   Re: blocking usermessage
Reply With Quote #2

Hook event "player_connect" ("player_connect_client" for orangebox games) and "player_disconnect". Set broadcastdisabled to true.


Example:
Code:
#include <sourcemod>

public void OnPluginStart() {
	HookEvent("player_connect", eventPlayerConnect, EventHookMode_Pre);
	HookEvent("player_disconnect", eventPlayerDisconnect, EventHookMode_Pre);
}
public Action eventPlayerConnect(Event event, const char[] name, bool dontBroadcast) {
	event.BroadcastDisabled = true;
}

public Action eventPlayerDisconnect(Event event, const char[] name, bool dontBroadcast) {
	event.BroadcastDisabled = true;
}
Edit: maybe i misread. The above code will disable default connect/disconnect messages. If it's the plugin that's printing out the messages and if you have the source of that plugin, you can edit the PrintToChatAll() lines for connect/disconnect, recompile, and put it on the server.
__________________

Last edited by JoinedSenses; 12-11-2018 at 18:47.
JoinedSenses is offline
potatoz
AlliedModders Donor
Join Date: Nov 2016
Old 12-13-2018 , 08:48   Re: blocking usermessage
Reply With Quote #3

Quote:
Originally Posted by JoinedSenses View Post
Hook event "player_connect" ("player_connect_client" for orangebox games) and "player_disconnect". Set broadcastdisabled to true.


Example:
Code:
#include <sourcemod>

public void OnPluginStart() {
	HookEvent("player_connect", eventPlayerConnect, EventHookMode_Pre);
	HookEvent("player_disconnect", eventPlayerDisconnect, EventHookMode_Pre);
}
public Action eventPlayerConnect(Event event, const char[] name, bool dontBroadcast) {
	event.BroadcastDisabled = true;
}

public Action eventPlayerDisconnect(Event event, const char[] name, bool dontBroadcast) {
	event.BroadcastDisabled = true;
}
Edit: maybe i misread. The above code will disable default connect/disconnect messages. If it's the plugin that's printing out the messages and if you have the source of that plugin, you can edit the PrintToChatAll() lines for connect/disconnect, recompile, and put it on the server.
Yeah well the issue is that i can't seem to find which plugin is sending these messages. The GameME plugin doesn't seem to include any connect/disconnect-messages in itself and none of the other plugins i've checked does either.

This is why i've just decided to try blocking all messages with the corresponding prefix
__________________
potatoz is offline
wolvez04
Senior Member
Join Date: Feb 2016
Location: Andora
Old 12-13-2018 , 12:09   Re: blocking usermessage
Reply With Quote #4

Cant you just block on gameme control panel? Has options for stopping text and changing methods.
__________________
Hiring developers of all sorts for small or big jobs.
Paying nicely. Just PM for any available jobs.

wolvez04 is offline
potatoz
AlliedModders Donor
Join Date: Nov 2016
Old 12-14-2018 , 16:53   Re: blocking usermessage
Reply With Quote #5

Quote:
Originally Posted by wolvez04 View Post
Cant you just block on gameme control panel? Has options for stopping text and changing methods.
i would if i knew the login or if it's even set up that way. thing is though that the server comes from an older, no-longer active community, all i've got is the FTP

i appreciate the thought though
__________________

Last edited by potatoz; 12-14-2018 at 16:53.
potatoz is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-15-2018 , 03:27   Re: blocking usermessage
Reply With Quote #6

Are you using gameME plugin from github ?? You could edit plugin... ?

*edit
which versio of gameme you have ?

Last edited by Bacardi; 12-15-2018 at 03:36.
Bacardi is offline
potatoz
AlliedModders Donor
Join Date: Nov 2016
Old 12-15-2018 , 04:49   Re: blocking usermessage
Reply With Quote #7

Quote:
Originally Posted by Bacardi View Post
Are you using gameME plugin from github ?? You could edit plugin... ?

*edit
which versio of gameme you have ?
i have the latest one from their website, however i can't seem to find where in the code it would send these messages
__________________
potatoz is offline
ThatKidWhoGames
Veteran Member
Join Date: Jun 2013
Location: IsValidClient()
Old 12-18-2018 , 12:36   Re: blocking usermessage
Reply With Quote #8

I'm pretty sure gameME sends rcon commands through the control panel for the messages. I don't think a plugin does it. I could be wrong though.
ThatKidWhoGames is offline
potatoz
AlliedModders Donor
Join Date: Nov 2016
Old 12-19-2018 , 14:57   Re: blocking usermessage
Reply With Quote #9

Quote:
Originally Posted by ThatKidWhoGames View Post
I'm pretty sure gameME sends rcon commands through the control panel for the messages. I don't think a plugin does it. I could be wrong though.
Would explain the troubles finding one, would appreciate any way of blocking them without the need for GameME control panel login
__________________
potatoz 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 14:49.


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