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

Dynamic MOTD 3.0


Post New Thread Reply   
 
Thread Tools Display Modes
Author
psychonic

BAFFLED
Join Date: May 2008
Plugin ID:
2160
Plugin Version:
3.0.0
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    80 
    Plugin Description:
    Allows sending of player/server info via GET vars to the MOTD url for easy customization of MOTD per player/server
    Old 01-06-2011 , 10:31   Dynamic MOTD 3.0
    Reply With Quote #1

    Dynamic MOTD

    As noted in the description, this plugin allows sending of player/server info via GET vars to the MOTD url for easy customization of MOTD per player/server.

    It will replace the MOTD already sent by the game via usermessage with a new one.


    Cvars:
    • dynamicmotd_url - Url to use, including info tokens. "" for default.
    • dynamicmotd_title - Title to use for motd window (on supported games), including info tokens. "" for default.
    • dynamicmotd_big - If enabled, uses a larger MOTD window on supported games. 0 - Disabled (default), 1 - Enabled. If this is enabled, MOTD is delayed until first team selection.
    • dynamicmotd_custom - The value here will be used when replacing the {SERVER_CUSTOM} token.

    Info Tokens:
    • {STEAM_ID} (in same format shown on "status" command for the game)
    • {USER_ID}
    • {FRIEND_ID} ('community id', a.k.a. 64-bit steam id)
    • {NAME}
    • {IP}
    • {LANGUAGE} (value of client's cl_language var)
    • {RATE} (value of client's rate var)
    • {SERVER_IP}
    • {SERVER_PORT}
    • {SERVER_NAME} (server hostname)
    • {SERVER_CUSTOM} (value of dynamicmotd_custom)
    • {L4D_GAMEMODE} (current game mode string on l4d and l4d2)
    • {CURRENT_MAP}
    • {NEXT_MAP}
    • {GAMEDIR}
    • {CURPLAYERS}
    • {MAXPLAYERS}
    • {BOTPLAYERS}
    • {STEAM2_ID} (explicit Steam2 format, ex. STEAM_0:1:4153990 or STEAM_1:1:4153990)
    • {STEAM3_ID} (explicit Steam3 format, ex. [U:1:8307981])
    • {STEAM_ACCTID} (Steam account id, ex. 8307981)
    • {SERVER_STEAM_ID} (server 64-bit Steam ID)
    • {SERVER_STEAM3_ID} (server Steam3-formatted id, ex. [A:1293500416:8019] or [G:1:123])
    • {SERVER_STEAM_ACCT_ID} (server Steam account id)

    And for those with SteamWorks or SteamTools installed:
    • {VAC_STATUS} (0/1)
    • {SERVER_PUB_IP} (the server's public ip)
    • {STEAM_CONNSTATUS} (0/1)

    Example Url: http://example.com/motd.php?communityid={FRIEND_ID}&name={NAME}

    I've only personally tested this on TF2 and CS:S, but it should work on all games that support a regular MOTD.

    Note: Due to limitations in the engine, the expanded url has a max length of 255 characters.

    The Get Plugin link will not work due to the SteamWorks and SteamTools includes being required at compile-time.
    Attached Files
    File Type: smx dynamic_motd.smx (15.8 KB, 894 views)
    File Type: sp Get Plugin or Get Source (dynamic_motd.sp - 962 views - 30.3 KB)

    Last edited by psychonic; 01-22-2017 at 10:48. Reason: added {BOTPLAYERS}, plugin now respects sv_visiblemaxplayers
    psychonic is offline
    Monkeys
    Veteran Member
    Join Date: Jan 2010
    Old 01-06-2011 , 10:43   Re: Dynamic MOTD
    Reply With Quote #2

    This is quite awesome, and it isn't hard to add even more substitutes.
    __________________
    Get a lid on that zombie,
    he's never gonna be alri-i-ight.
    Oooh get a lid on that zombie,
    or he's gonna feed all night.
    Monkeys is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 01-06-2011 , 11:18   Re: Dynamic MOTD
    Reply With Quote #3

    Quote:
    Originally Posted by Monkeys View Post
    This is quite awesome, and it isn't hard to add even more substitutes.
    If you have any suggestions for more, I'd be happy to hear them.
    psychonic is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: 90's
    Old 01-06-2011 , 11:35   Re: Dynamic MOTD
    Reply With Quote #4

    finally can show in motd user-specific information.
    __________________
    Leonardo is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 01-06-2011 , 21:05   Re: Dynamic MOTD
    Reply With Quote #5

    Uploaded version 1.1.0 which adds more shiz to ensure compatibility with more games as well as proper url encoding of the vars.

    Ex.
    Code:
    http://example.com/test.php?name={NAME}&steam={STEAM_ID}
    with name "[SMACK] BP{N}" and steamid "STEAM_0:1:4153990"
    becomes
    Code:
    http://example.com/test.php?name=%5bSMACK%5d%20%20BP%7bN%7d&steam=STEAM_0%3a1%3a4153990
    to guarantee proper interpretation by the web server.

    Also added {SERVER_NAME} token to resolve to current server hostname.

    Last edited by psychonic; 01-06-2011 at 22:02.
    psychonic is offline
    Samantha
    SourceMod Donor
    Join Date: Feb 2010
    Location: Madagascar
    Old 01-06-2011 , 21:11   Re: Dynamic MOTD
    Reply With Quote #6

    Very useful
    __________________
    "I give sopport and knolage in making extractions"
    "MASTER(D) - dun0: are you mocing me?" -Master the grate

    Plugins
    Godmode Until Attack | No Block Team Filter
    Extensions
    Rcon Hooks

    Last edited by Samantha; 02-20-2011 at 13:22.
    Samantha is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 01-06-2011 , 22:04   Re: Dynamic MOTD
    Reply With Quote #7

    Yet another minor update, 1.1.1, adding more functionality.

    New {SERVER_CUSTOM} tag will resolve to whatever the new cvar, dynamicmotd_custom, is set to.

    This is useful for people who number their servers. (1, 2, 3, etc.)
    psychonic is offline
    Munra
    Senior Member
    Join Date: May 2004
    Old 01-07-2011 , 11:43   Re: Dynamic MOTD
    Reply With Quote #8

    Can I get

    UR Bad ass
    __________________
    http://anbservers.net
    My Plugins
    PMs for support will be ignored please use the plugin topic for support.
    Munra is offline
    Thraka
    AlliedModders Donor
    Join Date: Aug 2005
    Old 01-07-2011 , 14:20   Re: Dynamic MOTD
    Reply With Quote #9

    Very awesome!

    This little snippet will add the l4d game mode as a parameter. Just insert it into the DoReplacements method

    Code:
    	new Handle:cvarHGameMode = FindConVar("mp_gamemode");
    	if (cvarHGameMode != INVALID_HANDLE)
    	{
    		decl String:gameMode[16];
    		GetConVarString(cvarHGameMode, gameMode, sizeof(gameMode));
    		ReplaceString(motdtitle, sizeof(motdtitle), "{L4D_GAMEMODE}", gameMode);
    		ReplaceString(motdurl, sizeof(motdurl), "{L4D_GAMEMODE}", gameMode);
    	}
    Now you can easily determine for your web page if the game is versus, coop, etc..
    Thraka is offline
    psychonic

    BAFFLED
    Join Date: May 2008
    Old 01-07-2011 , 14:25   Re: Dynamic MOTD
    Reply With Quote #10

    Quote:
    Originally Posted by Thraka View Post
    Very awesome!

    This little snippet will add the l4d game mode as a parameter. Just insert it into the DoReplacements method

    Code:
    	new Handle:cvarHGameMode = FindConVar("mp_gamemode");
    	if (cvarHGameMode != INVALID_HANDLE)
    	{
    		decl String:gameMode[16];
    		GetConVarString(cvarHGameMode, gameMode, sizeof(gameMode));
    		ReplaceString(motdtitle, sizeof(motdtitle), "{L4D_GAMEMODE}", gameMode);
    		ReplaceString(motdurl, sizeof(motdurl), "{L4D_GAMEMODE}", gameMode);
    	}
    Now you can easily determine for your web page if the game is versus, coop, etc..
    Is this for L4D, L4D2, or both? I know that (at least at one point) setting game mode was different for each, but can mp_gamemode be read to get it on both?
    psychonic is offline
    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 10:06.


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