Raised This Month: $ Target: $400
 0% 

Displaying info in MOTD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EvgenKo423
Member
Join Date: Apr 2011
Location: Russia
Old 05-01-2013 , 06:30   Displaying info in MOTD
Reply With Quote #1

Since maximum motd message length (as a usermessage field) is 255 chars, there are 2 appropriate ways to display custom info in it: from the url and from client-side file.
My question is: is there any way to force a single client to download some file from the server during the game?
__________________
Everything that has a beginning has an end.
War... War never changes.....
EvgenKo423 is offline
Send a message via Skype™ to EvgenKo423
V952
Member
Join Date: Jan 2012
Location: Odessa, Ukraine
Old 05-01-2013 , 06:59   Re: Displaying info in MOTD
Reply With Quote #2

Yes the method exists and is confirmed in pre-orangebox HL2DM, but i realy don't know how to do this. I was trying to make some progress on it, but i failed. Also for your purpose it'd be much easier to use dynamic webpage (webserver+php) to display different images/info on the page.
__________________
HL2DM Real-Life Server: 195.138.78.198:27015
V952 is offline
Send a message via Skype™ to V952
EvgenKo423
Member
Join Date: Apr 2011
Location: Russia
Old 05-01-2013 , 08:55   Re: Displaying info in MOTD
Reply With Quote #3

Quote:
Originally Posted by V952 View Post
Yes the method exists and is confirmed in pre-orangebox HL2DM, but i realy don't know how to do this.
Do you know any plugin example, that is doing that?

Quote:
Originally Posted by V952 View Post
For your purpose it'd be much easier to use dynamic webpage (webserver+php) to display different images/info on the page.
I think you don't actually understood what I want to do: I want to use the MOTD panel to display a kind of player's stats (like it was in cs 1.6), and I don't wanna make my plugin webserver-dependent...
__________________
Everything that has a beginning has an end.
War... War never changes.....

Last edited by EvgenKo423; 05-01-2013 at 08:59.
EvgenKo423 is offline
Send a message via Skype™ to EvgenKo423
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 05-01-2013 , 09:28   Displaying info in MOTD
Reply With Quote #4

You need to add your message to the stringtable that the infopanel uses. I have the code at home, I'll get it for you when I get home if I remember and if nobody beats me to it.
__________________
Dr. McKay is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 05-01-2013 , 19:50   Re: Displaying info in MOTD
Reply With Quote #5

You can probably figure out where to go from here.

PHP Code:
public Action:test(clientargs) {
    new 
bool:locked LockStringTables(false);
    new 
table FindStringTable("InfoPanel");
    
decl String:data[4096];
    
Format(datasizeof(data), "Here's my super awesome MOTD data text.");
    new 
index FindStringIndex(table"mymotddata");
    if(
index || index GetStringTableMaxStrings(table)) {
        
AddToStringTable(table"mymotddata"datasizeof(data));
    } else {
        
SetStringTableData(tableindexdatasizeof(data));
    }
    
LockStringTables(locked);
    
CreateTimer(0.1Timer_PopPanelclient);
    return 
Plugin_Handled;
}

public 
Action:Timer_PopPanel(Handle:timerany:client) {
    
ShowMOTDPanel(client"MOTD Title""mymotddata");

__________________
Dr. McKay is offline
EvgenKo423
Member
Join Date: Apr 2011
Location: Russia
Old 05-02-2013 , 10:00   Re: Displaying info in MOTD
Reply With Quote #6

Quote:
Originally Posted by Dr. McKay View Post
You can probably figure out where to go from here.
Thanks a lot, it works just fine!!
__________________
Everything that has a beginning has an end.
War... War never changes.....
EvgenKo423 is offline
Send a message via Skype™ to EvgenKo423
Reply



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 07:46.


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