View Single Post
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 02-07-2016 , 06:32   Re: Advanced ShowMOTDPanel
Reply With Quote #22

Quote:
Originally Posted by Dr. McKay View Post
I haven't actually tested this in-game, but it should work fine.

This is an enhanced version of ShowMOTDPanel that allows for:
  • Hidden MOTD panels
  • Big MOTD panel (in TF2)
  • Verification that the client can actually receive MOTD panels before sending it
Example:

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <advanced_motd>

public void OnPluginStart() {
    
RegConsoleCmd("sm_google"Command_Google"Opens Google in a large MOTD window");
}

public 
Action Command_Google(int clientint args) {
    
AdvMOTD_ShowMOTDPanel(client"Google""http://www.google.com"MOTDPANEL_TYPE_URLtruetruetrueOnMOTDFailure);
    return 
Plugin_Handled;
}

public 
void OnMOTDFailure(int clientMOTDFailureReason reason) {
    if(
reason == MOTDFailure_Disabled) {
        
PrintToChat(client"[SM] You have HTML MOTDs disabled.");
    } else if(
reason == MOTDFailure_Matchmaking) {
        
PrintToChat(client"[SM] You cannot view HTML MOTDs because you joined via Quickplay.");
    } else if(
reason == MOTDFailure_QueryFailed) {
        
PrintToChat(client"[SM] Unable to verify that you can view HTML MOTDs.");
    } else {
        
PrintToChat(client"[SM] Unable to verify that you can view HTML MOTDs for an unknown reason.");
    }

I have tested it in CS:GO.
Plugin is loaded (sm plugins ->"example.smx" example.smx).
Modt does not show.
There is no errormessage!

I don't think it is working at the moment.

I used this because I've go problems with ShowMOTDPanel. As well nothing was opening with this command. (I have clientsided cl_disablehtmlmotd 0.)

Is there actually a problem with opening the motd out of running game?
fragnichtnach is offline