AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Dynamic Join MOTD (https://forums.alliedmods.net/showthread.php?t=126365)

LumiStance 05-08-2010 15:42

Dynamic Join MOTD
 
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

Scone 05-08-2010 17:36

Re: Dynamic MOTD
 
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)?

LumiStance 05-08-2010 20:42

Re: Dynamic MOTD
 
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.

Sammy-ROCK! 05-08-2010 22:27

Re: Dynamic MOTD
 
You mean when a player joins a team?

LumiStance 05-08-2010 22:35

Re: Dynamic MOTD
 
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.

Sammy-ROCK! 05-08-2010 22:50

Re: Dynamic MOTD
 
I don't think there's a way to detect a motd closing.

rcarm 05-08-2010 22:56

Re: Dynamic MOTD
 
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);
    }



LumiStance 05-08-2010 23:32

Re: Dynamic MOTD
 
No.

LumiStance 05-08-2010 23:38

Re: Dynamic MOTD
 
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.

psychonic 05-09-2010 13:29

Re: Dynamic Join MOTD
 
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.


All times are GMT -4. The time now is 04:10.

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