Viewing Website in MOTD?
Not really Sourcemod scripting, but related.
How can I tell if a player is viewing a webpage from in game via the MOTD screen? I want to display certain text if they are, or hide it if they are not. |
Re: Viewing Website in MOTD?
Good question.
Isnt it easier to create two? Dont really know what its for, but sounds easier. |
Re: Viewing Website in MOTD?
AFAIK there is no native / event for knowing when a player is viewing or has closed an MOTD screen. Would be useful though (or maybe there is and I just don't know about it).
|
Re: Viewing Website in MOTD?
Quote:
If you manually create the motd with ShowVGUIPanel instead of ShowMOTDPanel, you can add the "cmd" key with a value for the command that you want the client to execute when it closes. In some games (CS:S, TF2, DOD:S, HL2DM), this is an integer value, mapping to an enum of valid command, one being "closed_htmlpage". On other games, it's a string of whatever command you want (usually "closed_htmlpage" for consistency. You can then use AddCommandListener to watch for the command. You can find the enum and an example in Dynamic MOTD https://forums.alliedmods.net/showthread.php?p=1387386 or in the Pinion plugin https://github.com/PinionTech/Pinion...ion_adverts.sp As for knowing on the site when they're viewing it, you can check the user agent to see if they're from in-game. |
Re: Viewing Website in MOTD?
I wrote a method a while ago in the MOTD Backpack plugin which detects opening/closing too, if you want to give that a look at. Link's in my sig.
|
Re: Viewing Website in MOTD?
If you want to be a bit lazy, you could pass an argument through the url such as ?ingame=true. Then check for that and possibly save it as a cookie for when they lurk around your site some more.
|
Re: Viewing Website in MOTD?
LOL
|
Re: Viewing Website in MOTD?
Quote:
|
Re: Viewing Website in MOTD?
1. Your kitty face
2. Your code 3. Awww |
Re: Viewing Website in MOTD?
Quote:
Its kinda what he's looking for. I see |
All times are GMT -4. The time now is 02:47. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.