AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help blocking a message (https://forums.alliedmods.net/showthread.php?t=309001)

sekac 07-10-2018 06:57

Help blocking a message
 
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



PurposeLessx 07-10-2018 07:14

Re: Help blocking a message
 
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;



sekac 07-10-2018 07:36

Re: Help blocking a message
 
It's still not working.

^SmileY 07-10-2018 08:54

Re: Help blocking a message
 
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;
}


sekac 07-10-2018 09:57

Re: Help blocking a message
 
Still not working.

^SmileY 07-10-2018 10:06

Re: Help blocking a message
 
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.

sekac 07-10-2018 10:20

Re: Help blocking a message
 
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.

^SmileY 07-10-2018 10:25

Re: Help blocking a message
 
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

sekac 07-10-2018 10:33

Re: Help blocking a message
 
It shows nothing when I try to go PIP, but it is showing me other server messages.

^SmileY 07-10-2018 10:35

Re: Help blocking a message
 
Quote:

Originally Posted by sekac (Post 2602662)
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??


All times are GMT -4. The time now is 12:46.

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