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

Help blocking a message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sekac
Senior Member
Join Date: Nov 2016
Old 07-10-2018 , 06:57   Help blocking a message
Reply With Quote #1

I tried blocking the "Picture-In-Picture is not available in First-Person mode while playing." message and it didn't work.

PHP Code:
register_message(get_user_msgid("TextMsg"), "Message_TextMsg")

public 
Message_TextMsg(iMsgIdiMsgDestid)
{
    if( !
id && get_msg_arg_int(1) == print_center )
    {
        new 
szMessage[15]
        
get_msg_arg_string(2szMessagecharsmax(szMessage))
        if( 
equal(szMessage"#Cstrike_TitlesTXT_Spec_No_PIP") )
            return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE

sekac is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 07-10-2018 , 07:14   Re: Help blocking a message
Reply With Quote #2

Can you try?

PHP Code:
#include <amxmodx>

new TextMsg;

public 
plugin_precache()
{
    
TextMsg get_user_msgid("TextMsg");
}

public 
plugin_init() {
    
register_plugin("Block Msg""1.0""PurposeLess");

    
register_message(TextMsg"message_TextMsg");
}

public 
message_TextMsg(msgidmsgdestid)
{
    static const 
message_specnorip[] = "#Cstrike_TitlesTXT_Spec_No_PIP";

    new 
msg[15];
    
get_msg_arg_string(2msgcharsmax(msg));

    return (
equali(msgmessage_specnorip)) ? 1:0;

__________________
A plugin that is needed for every server.
PHP Code:
public client_connect(id)
{
    if(
get_user_iq(id) < 80)
    {
        
server_cmd("kick #%d 'You have kicked from the server because your IQ is not high enough'"get_user_userid(id));
    }

PurposeLessx is offline
sekac
Senior Member
Join Date: Nov 2016
Old 07-10-2018 , 07:36   Re: Help blocking a message
Reply With Quote #3

It's still not working.
sekac is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 07-10-2018 , 08:54   Re: Help blocking a message
Reply With Quote #4

Code:
#include <amxmodx>

public plugin_init()
{
	register_plugin("Test Block","1.0","ME");

	register_message(get_user_msgid("TextMsg"),"TextMsg");
}

public TextMsg(Msg,Dest,id)
{
	new Message[32]; // #Cstrike_TitlesTXT_Spec_No_PIP has 31 in size, not 15
	get_msg_arg_string(2,Message,charsmax(Message));

	return (equali(Message,"#Cstrike_TitlesTXT_Spec_No_PIP")) ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
}
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
sekac
Senior Member
Join Date: Nov 2016
Old 07-10-2018 , 09:57   Re: Help blocking a message
Reply With Quote #5

Still not working.
sekac is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 07-10-2018 , 10:06   Re: Help blocking a message
Reply With Quote #6

Code:
#include <amxmodx>

new g_TextMsg;

public plugin_init()
{
	register_plugin("Test","0.1","ME");
	
	g_TextMsg = get_user_msgid("TextMsg");
	register_event("TextMsg","TextMsg","a","2=#Cstrike_TitlesTXT_Spec_No_PIP");
}

public TextMsg()
{
	set_msg_block(g_TextMsg,BLOCK_ONCE);
	return PLUGIN_HANDLED;
}
Im suspect that first plugin works, also test second version

EDIT: First version will work fine with #Game_will_restart_in as parameter!

You also can disable picture in picture mode with a server variable i guess.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 07-10-2018 at 10:11.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
sekac
Senior Member
Join Date: Nov 2016
Old 07-10-2018 , 10:20   Re: Help blocking a message
Reply With Quote #7

Still nothing... I found that the command for toggling picture-in-picture is spec_toggleinset. Also there is spec_pip, but that doesn't disable it.
sekac is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 07-10-2018 , 10:25   Re: Help blocking a message
Reply With Quote #8

Code:
#include <amxmodx>

public plugin_init()
{
	register_plugin("Test Block","1.0","ME");

	register_message(get_user_msgid("TextMsg"),"TextMsg");
}

public TextMsg(Msg,Dest,id)
{
	new Message[32]; // #Cstrike_TitlesTXT_Spec_No_PIP has 31 in size, not 15
	get_msg_arg_string(2,Message,charsmax(Message));

	server_print(Message);

	return (containi(Message,"Spec_No_PIP")) ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
}
Try this and see what is returning into server_console when try to spec picture
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
sekac
Senior Member
Join Date: Nov 2016
Old 07-10-2018 , 10:33   Re: Help blocking a message
Reply With Quote #9

It shows nothing when I try to go PIP, but it is showing me other server messages.
sekac is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 07-10-2018 , 10:35   Re: Help blocking a message
Reply With Quote #10

Quote:
Originally Posted by sekac View Post
It shows nothing when I try to go PIP, but it is showing me other server messages.
Nothing related with spec_pip? if not, this message is not catch-able??
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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 09:07.


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