AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [CS:GO] Open MOTD window without redirect page (javascript) (https://forums.alliedmods.net/showthread.php?t=292478)

boomix 01-07-2017 11:51

[CS:GO] Open MOTD window without redirect page (javascript)
 
Hello, here is small code, that will open up for you the HTML MOTD page in CS:GO without making a custom redirect page.

PHP Code:

void OpenMOTD(int clientchar url[500])
{
    
char UrlJS[500];
    
Format(UrlJS500"javascript: var x = screen.width * 0.90;var y = screen.height * 0.90;window.open(\"%s\", \"Really boomix, JS?\",\"scrollbars=yes, width='+x+',height='+y+'\");"url);
    
ShowMOTDPanel(client"Open HTML MOTD"UrlJSMOTDPANEL_TYPE_URL );



This feature supporting javascript can be really useful, you can pretty much do alot of things that I couldnt figure out how to do before with only the motd. Atleast so far I haven't seen anyone using this method, thats why I tought it might be cool to show it to you.

If you have any ideas for what more this could be useful, just write bellow.

hadesownage 01-07-2017 13:11

Re: [CS:GO] Open MOTD window without redirect page (javascript)
 
Thanks for sharing this with us!

Neuro Toxin 01-09-2017 18:17

Re: [CS:GO] Open MOTD window without redirect page (javascript)
 
This is great!!!

DarkDeviL 01-09-2017 19:31

Re: [CS:GO] Open MOTD window without redirect page (javascript)
 
I was actually thinking about testing this out sometime ago, when a lot of people were claiming that Web Shortcuts wasn't working.

Just been too busy, and never got around to try it. :'(

But eh, have this been tried with extremely long web addresses? In my memory, there something about CS:S or TF2 was breaking when URL's were too long?

Neuro Toxin 01-09-2017 20:24

Re: [CS:GO] Open MOTD window without redirect page (javascript)
 
Solid point. U can check protobuf docs in the SDK to check string size.

psychonic 01-10-2017 07:45

Re: [CS:GO] Open MOTD window without redirect page (javascript)
 
Quote:

Originally Posted by Neuro Toxin (Post 2485181)
Solid point. U can check protobuf docs in the SDK to check string size.

Protobuf messages don't have explicit string lengths. The url does get read into a buffer of 255 bytes in the client, but you'd hit the usermessage max size of 256 before hitting.

_GamerX 01-20-2017 14:21

Re: [CS:GO] Open MOTD window without redirect page (javascript)
 
on last update not work...

Addicted. 01-21-2017 12:19

Re: [CS:GO] Open MOTD window without redirect page (javascript)
 
Quote:

Originally Posted by _GamerX (Post 2488432)
on last update not work...

Works fine for my servers still.

_GamerX 01-22-2017 07:31

Re: [CS:GO] Open MOTD window without redirect page (javascript)
 
So Valve get agin 'GO update and now work ....

me-Shoe 05-13-2018 11:59

Re: [CS:GO] Open MOTD window without redirect page (javascript)
 
Hello,

how is this working? Is this for compilingn which will open a motd or how should it work?

Thanks for help!


All times are GMT -4. The time now is 18:33.

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