Raised This Month: $32 Target: $400
 8% 

Dynamic MOTD 3.0


Post New Thread Reply   
 
Thread Tools Display Modes
Thraka
AlliedModders Donor
Join Date: Aug 2005
Old 01-07-2011 , 14:33   Re: Dynamic MOTD
Reply With Quote #11

It should be for both. I think the mp_gamemode used to be something different on l4d1, then changed to mp_gamemode, but that was before l4d2 came out. I took the code from my gamemode config loader plugin that no one has reported doesn't work for l4d1.
Thraka is offline
psychonic

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

Quote:
Originally Posted by Thraka View Post
It should be for both. I think the mp_gamemode used to be something different on l4d1, then changed to mp_gamemode, but that was before l4d2 came out. I took the code from my gamemode config loader plugin that no one has reported doesn't work for l4d1.
Excellent.

Version 1.1.2 posted. Only difference from 1.1.1 is new {L4D_GAMEMODE} token. Thank you.
psychonic is offline
Thraka
AlliedModders Donor
Join Date: Aug 2005
Old 01-07-2011 , 15:13   Re: Dynamic MOTD
Reply With Quote #13

No! Thank you! I'm really happy about this.. I wanted a dynamic motd for a long time but changing the cvar that controls the file for motd seemed to be cached at some point so I could never get the motd to inform people of how VERSUS worked or COOP worked in L4D, so I had to have a HUGE motd that covered both.
Thraka is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 01-09-2011 , 11:06   Re: Dynamic MOTD
Reply With Quote #14

psychonic, can you add 2 tokens: current_map and user_lang? just don't want to choose lang by ip (takes a long time).
__________________
Leonardo is offline
psychonic

BAFFLED
Join Date: May 2008
Old 01-09-2011 , 12:53   Re: Dynamic MOTD
Reply With Quote #15

Quote:
Originally Posted by Leonardo View Post
psychonic, can you add 2 tokens: current_map and user_lang? just don't want to choose lang by ip (takes a long time).
Updated first post with version 1.1.3, added {CURRENT_MAP} and {NEXT_MAP}.

At the motd screen, it's too soon to get the cvar query callback with the client's language.
psychonic is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 01-09-2011 , 13:46   Re: Dynamic MOTD
Reply With Quote #16

hmm, I've tried to do it myself
in DoReplacements()
PHP Code:
    decl String:clientFlag[3];
    
decl String:clientLang[46];
    
GetLanguageInfo(GetClientLanguage(client), clientFlagsizeof(clientFlag), clientLangsizeof(clientLang));
    
ReplaceString(motdtitlesizeof(motdtitle), "{USER_FLAG}"clientFlag);
    
ReplaceString(motdurl,   sizeof(motdurl),   "{USER_FLAG}"clientFlag);
    
ReplaceString(motdtitlesizeof(motdtitle), "{USER_LANG}"clientLang);
    
ReplaceString(motdurl,   sizeof(motdurl),   "{USER_LANG}"clientLang); 
and it works fine ...
but I trust you're right

EDIT:
and yeah, I think there is no differences, send IP via plugin or get it with PHP's global variable $_SERVER['REMOTE_ADDR'].
__________________

Last edited by Leonardo; 01-09-2011 at 13:52.
Leonardo is offline
psychonic

BAFFLED
Join Date: May 2008
Old 01-09-2011 , 13:51   Re: Dynamic MOTD
Reply With Quote #17

Quote:
Originally Posted by Leonardo View Post
hmm, I've tried to do it myself
in DoReplacements
PHP Code:
    decl String:clientFlag[3];
    
decl String:clientLang[46];
    
GetLanguageInfo(GetClientLanguage(client), clientFlagsizeof(clientFlag), clientLangsizeof(clientLang));
    
ReplaceString(motdtitlesizeof(motdtitle), "{USER_FLAG}"clientFlag);
    
ReplaceString(motdurl,   sizeof(motdurl),   "{USER_FLAG}"clientFlag);
    
ReplaceString(motdtitlesizeof(motdtitle), "{USER_LANG}"clientLang);
    
ReplaceString(motdurl,   sizeof(motdurl),   "{USER_LANG}"clientLang); 
and it works fine ...
but I trust you're right
http://docs.sourcemod.net/api/index....d=show&id=152&
Quote:
Retrieves the language number of a client. Currently this simply returns the server language index.
To get the language, you need to query the cl_language cvar on the client.

Last edited by psychonic; 01-09-2011 at 13:53.
psychonic is offline
psychonic

BAFFLED
Join Date: May 2008
Old 01-09-2011 , 13:56   Re: Dynamic MOTD
Reply With Quote #18

Quote:
Originally Posted by psychonic View Post
Currently this simply returns the server language index.
Upon further inspection, it appears that is not correct. I'll give it a try.

It also makes sense that you wouldn't need to do the normal cvar query since cl_language is one of the 'info' vars that the client already sends to the server.

Last edited by psychonic; 01-09-2011 at 13:59.
psychonic is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 01-09-2011 , 14:05   Re: Dynamic MOTD
Reply With Quote #19

What I'm doing wrong?!
__________________
Leonardo is offline
psychonic

BAFFLED
Join Date: May 2008
Old 01-09-2011 , 14:11   Re: Dynamic MOTD
Reply With Quote #20

Quote:
Originally Posted by Leonardo View Post
Nothing (aside from that reading cl_language directly is better in case the server is set to force everyone to the server language). See above. It appears that the message on the docs page was incorrect/outdated.
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 19:31.


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