AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Webpanel opening in game (https://forums.alliedmods.net/showthread.php?t=308231)

krikus62 06-11-2018 16:48

Webpanel opening in game
 
So I was wondering what kind of access does the webpanel in game have? Is there any info about the player sent to the website which is opened?

maqi 06-11-2018 18:34

Re: Webpanel opening in game
 
I think he means the motd window, maybe im wrong.

fysiks 06-12-2018 20:36

Re: Webpanel opening in game
 
Think of the MOTD window as a simple web browser. If you want to send a particular player's information to a website that is being shown, you'd need to encode that information into the URL.

For example, if you want to send a player's SteamID, you'd send them to a url like this:

Code:

show_motd(id, "http://www.website.com/webpage.php?steamid=STEAM_0:0:123456")
But you would dynamically format the URL string to include the player's actual SteamID. Also, if you are going to be sending generic text (text which you are not 100% all of the characters it might contain) then you need to first URL encode the text before putting it in the URL.

If you don't do this then there won't be any game-specific information sent. However, as with all websites, the website can still get your IP address and anything therefore derived.

krikus62 06-13-2018 08:26

Re: Webpanel opening in game
 
Ah that is not great news, I expected that by opening a motd window from within a game, the game would pass in an object or something with some info of who or what opened the window.

fysiks 06-13-2018 22:37

Re: Webpanel opening in game
 
Quote:

Originally Posted by krikus62 (Post 2596707)
Ah that is not great news, I expected that by opening a motd window from within a game, the game would pass in an object or something with some info of who or what opened the window.

Well, its the only news.

It's simply a web browser and is not directly linked into the game or its data.

maqi 06-14-2018 12:22

Re: Webpanel opening in game
 
However this can be achieved, if you own a web-server, making a php script that retrieves data from the game server, in your example, the player name/id or w/e, then you can use meta refresh to show it in your motd screen.


All times are GMT -4. The time now is 01:24.

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