Page 2 of 9 FirstFirst 1234 ... LastLast
Results 11 to 20 of 85
  1. #11
    Who?
    Join Date
    Sep 2009
    Location
    Stockholm, Sweden
    Posts
    2,799

    Re: Admin Alert Plugin

    The bfbc2 server loops back any messages with strSpeaker set to "Server" if they were sent with admin.say (to the normal chat area, not yelling)

    The below code will ignore any loopbacked messages.
    Code:
    public void OnGlobalChat(string strSpeaker, string strMessage) {
    	if (String.Compare(strSpeaker, "Server", true) != 0) {
    		// Message was not sent back by the BFBC2 server.
    	}
    }
    I started at DICE late Oct. 2014, so ignore every post before that.

  2. #12

    Re: Admin Alert Plugin

    I sent a PM to Lorax about this if I'm not mistaken but I reckoned I should post it here in case one of the other coders wanted to do it.

    My worry is that you might miss the sound or popup when you're away from the computer e.g. the toilet. Can someone code in another alert where it highlights/focuses procon in the taskbar? Just like when you recieve a new message in an IM client. Thanks

  3. #13
    Administrator
    Join Date
    Mar 2010
    Location
    Tasmania, Australia
    Posts
    3,491

    Re: Admin Alert Plugin

    I had a play with message boxes, the issue was that the C# MessageBox is Modal.. You can get around that by firing off a new thread.
    Code:
    public void dispBox()
            {
                string message = "Message";
                string caption = "Caption";
                DialogResult result;
    
                result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo);
            }
    
    new Thread(dispBox).Start();

  4. #14

    Re: Admin Alert Plugin

    Quote Originally Posted by ghost-hsdragon
    I am also getting the problem where it resets the system tray alert to "off" when i shutdown procon. Everything else seems to be fine only the "enable system tray alert" resets.
    I haven't noticed this happening, but I'll see if I can track it down.

    As far as the spam bot alerts go, good call and I had actually thought to ignore any messages sent by the server but it slipped my mind. Feel free to post up either the code block change/addition and I'll incorporate it into the plugin.

  5. #15

    Re: Admin Alert Plugin

    I tracked down the problem with the systray alerts not saving and updated the first post with the new version.

  6. #16

    Re: Admin Alert Plugin

    Works perfect now. Great job! keep up the good work!!!

  7. #17

    Re: Admin Alert Plugin

    Quote Originally Posted by Phogue
    The bfbc2 server loops back any messages with strSpeaker set to "Server" if they were sent with admin.say (to the normal chat area, not yelling)

    The below code will ignore any loopbacked messages.
    Code:
    public void OnGlobalChat(string strSpeaker, string strMessage) {
    	if (String.Compare(strSpeaker, "Server", true) != 0) {
    		// Message was not sent back by the BFBC2 server.
    	}
    }
    Quote Originally Posted by Zaeed
    I had a play with message boxes, the issue was that the C# MessageBox is Modal.. You can get around that by firing off a new thread.
    Code:
    public void dispBox()
            {
                string message = "Message";
                string caption = "Caption";
                DialogResult result;
    
                result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo);
            }
    
    new Thread(dispBox).Start();
    where would i put those in the file to make them work? i tried a bit lastnight but then it wouldn't even notify me when someone said one of the keywords at all

  8. #18
    Administrator
    Join Date
    Mar 2010
    Location
    Tasmania, Australia
    Posts
    3,491

    Re: Admin Alert Plugin

    You might want to put a filter on server messages. The kill streak plugin often sets the plugin off...

    i've modified the first line of global chat to be
    Code:
    if ((String.Compare(m_strPreviousMessage, strMessage) != 0) && (String.Compare(strSpeaker, "Server") !=0))

  9. #19
    Administrator
    Join Date
    Mar 2010
    Location
    Tasmania, Australia
    Posts
    3,491

    Re: Admin Alert Plugin

    Quote Originally Posted by cllckcllck
    Quote Originally Posted by Phogue
    The bfbc2 server loops back any messages with strSpeaker set to "Server" if they were sent with admin.say (to the normal chat area, not yelling)

    The below code will ignore any loopbacked messages.
    Code:
    public void OnGlobalChat(string strSpeaker, string strMessage) {
    	if (String.Compare(strSpeaker, "Server", true) != 0) {
    		// Message was not sent back by the BFBC2 server.
    	}
    }
    Quote Originally Posted by Zaeed
    I had a play with message boxes, the issue was that the C# MessageBox is Modal.. You can get around that by firing off a new thread.
    Code:
    public void dispBox()
            {
                string message = "Message";
                string caption = "Caption";
                DialogResult result;
    
                result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo);
            }
    
    new Thread(dispBox).Start();
    where would i put those in the file to make them work? i tried a bit lastnight but then it wouldn't even notify me when someone said one of the keywords at all
    cllckcllck, my code there is only a rough doodle.. It doesn't work, just a concept..

    You'll have to look to Lorax to see if he want's to add this functionality to the plugin.

  10. #20

    Re: Admin Alert Plugin

    Is this plug-in supposed to work over the PLC? If so, I can't for the life of me get it to work... Even added the sound files to the client machine. Works on the box running the layer server fine.

 

 

Similar Threads

  1. Cheater Alert [v0.0.3.1] (07.04.2011) [BC2]
    By MorpheusX(AUT) in forum Plugins
    Replies: 185
    Last Post: 15-05-2012, 01:11
  2. REQUEST: Cheater Alert
    By CaptainSilver in forum Plugin Development
    Replies: 60
    Last Post: 16-02-2011, 23:02
  3. Problem mit Admin Alert Plugin
    By Headshot177 in forum Procon 1.0 Frostbite
    Replies: 0
    Last Post: 15-08-2010, 06:51
  4. Warning sound or alert
    By TGSCPM in forum Procon 1.0 Frostbite
    Replies: 0
    Last Post: 20-03-2010, 01:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •