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

Dynamic Join MOTD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LumiStance
AlliedModders Donor
Join Date: Jan 2009
Location: Northern California
Old 05-08-2010 , 15:42   Dynamic Join MOTD
Reply With Quote #1

Solved! See:
http://forums.alliedmods.net/showthread.php?t=126414

--------------------------
I want to have a join MOTD that shows a dynamic url.
I have been successful in using CreateTimer and ShowMOTDPanel.
But the Select Team Panel doesn't come up after dismissing the MOTD Panel.

I've searched on here, google, and even dug through the SourceSDK Base to no avail.

I would like to know:
1) How the MOTD, Team, Class Panel sequence works
2) How I could specify a dynamic url when a player connects


I can use ShowVGUIPanel(client_index, "team"); to show the Team and Class Panels, but I how can I tell when a player dismisses the motd?

Thanks
__________________

Last edited by LumiStance; 05-09-2010 at 04:01. Reason: Found solution
LumiStance is offline
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 05-08-2010 , 17:36   Re: Dynamic MOTD
Reply With Quote #2

By "dynamic URL", do you mean one that relies on their SteamID/some other in-game characteristic, or is this something that could be done serverside (e.g. in PHP)?
__________________
Scone is offline
LumiStance
AlliedModders Donor
Join Date: Jan 2009
Location: Northern California
Old 05-08-2010 , 20:42   Re: Dynamic MOTD
Reply With Quote #3

The url will be specific to each player connecting, determined when they connect.

Can I tell the MOTD panel that automatically comes up to change what page is shows?
Currently, I suspect that my call to ShowMOTDPanel replaces the first panel.
__________________

Last edited by LumiStance; 05-08-2010 at 20:49.
LumiStance is offline
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 05-08-2010 , 22:27   Re: Dynamic MOTD
Reply With Quote #4

You mean when a player joins a team?
Sammy-ROCK! is offline
LumiStance
AlliedModders Donor
Join Date: Jan 2009
Location: Northern California
Old 05-08-2010 , 22:35   Re: Dynamic MOTD
Reply With Quote #5

When a player joins a plain old sever, they are typically presented with three panels, MOTD, Team, and Team Class.

I want the MOTD to show content that is unique to each player joining. And I want the Team Panel to be shown after the MOTD panel is dismissed.
__________________
LumiStance is offline
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 05-08-2010 , 22:50   Re: Dynamic MOTD
Reply With Quote #6

I don't think there's a way to detect a motd closing.
Sammy-ROCK! is offline
rcarm
Member
Join Date: Feb 2010
Old 05-08-2010 , 22:56   Re: Dynamic MOTD
Reply With Quote #7

Something like this?

PHP Code:

new String:g_MOTDurl_Team1[256]; //Why 256? idk
new String:g_MOTDurl_Team2[256];

public 
OnPluginStart()
{
    
Format(g_MOTDurl_Team1sizeof(g_MOTDurl_Team1), "http://google.com/");
    
Format(g_MOTDurl_Team2sizeof(g_MOTDurl_Team2), "http://alliedmods.net/");
    
HookEvent("player_changeclass"Event_ChangeClassEventHookMode_Post);
    
}

public 
Action:Event_ChangeClass(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
team GetClientTeam(client);
    
    switch(
team)
    {
        case 
1ShowMOTDPanel(client"Team 1"g_MOTDurl_Team1MOTDPANEL_TYPE_URL);
        case 
2ShowMOTDPanel(client"Team 2"g_MOTDurl_Team2MOTDPANEL_TYPE_URL);
    }


Last edited by rcarm; 05-08-2010 at 23:01.
rcarm is offline
LumiStance
AlliedModders Donor
Join Date: Jan 2009
Location: Northern California
Old 05-08-2010 , 23:38   Re: Dynamic MOTD
Reply With Quote #9

What network message is sent by CSS to tell the client to show the MOTD, and can I hook that and modify the message?

By that I mean what is used to show the sequence of panels. Is it one message (I assume different from what SM:ShowMOTDPanel uses), or does the server listen for a message from the client when the user closes the MOTD, to reply with a show Chose Team panel?

Or should I go set up a packet sniffer.
__________________

Last edited by LumiStance; 05-08-2010 at 23:44.
LumiStance is offline
psychonic

BAFFLED
Join Date: May 2008
Old 05-09-2010 , 13:29   Re: Dynamic Join MOTD
Reply With Quote #10

While that method probably works, it should not be publicized as it allows running any command on clients, effectively exploiting them, working around other checks in place limiting you from doing so.
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 21:44.


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