Raised This Month: $7 Target: $400
 1% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
boomix
Senior Member
Join Date: May 2015
Location: Latvia
Old 01-07-2017 , 11:51   [CS:GO] Open MOTD window without redirect page (javascript)
Reply With Quote #1

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.
__________________
boomix is offline
hadesownage
AlliedModders Donor
Join Date: Jun 2013
Location: Romania, Iași
Old 01-07-2017 , 13:11   Re: [CS:GO] Open MOTD window without redirect page (javascript)
Reply With Quote #2

Thanks for sharing this with us!
hadesownage is offline
Send a message via Yahoo to hadesownage Send a message via Skype™ to hadesownage
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-09-2017 , 18:17   Re: [CS:GO] Open MOTD window without redirect page (javascript)
Reply With Quote #3

This is great!!!
__________________
Neuro Toxin is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 01-09-2017 , 19:31   Re: [CS:GO] Open MOTD window without redirect page (javascript)
Reply With Quote #4

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?
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 01-09-2017 , 20:24   Re: [CS:GO] Open MOTD window without redirect page (javascript)
Reply With Quote #5

Solid point. U can check protobuf docs in the SDK to check string size.
__________________
Neuro Toxin is offline
psychonic

BAFFLED
Join Date: May 2008
Old 01-10-2017 , 07:45   Re: [CS:GO] Open MOTD window without redirect page (javascript)
Reply With Quote #6

Quote:
Originally Posted by Neuro Toxin View Post
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.
psychonic is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 01-20-2017 , 14:21   Re: [CS:GO] Open MOTD window without redirect page (javascript)
Reply With Quote #7

on last update not work...
__________________
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
Addicted.
AlliedModders Donor
Join Date: Dec 2013
Location: 0xA9D0DC
Old 01-21-2017 , 12:19   Re: [CS:GO] Open MOTD window without redirect page (javascript)
Reply With Quote #8

Quote:
Originally Posted by _GamerX View Post
on last update not work...
Works fine for my servers still.
Addicted. is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 01-22-2017 , 07:31   Re: [CS:GO] Open MOTD window without redirect page (javascript)
Reply With Quote #9

So Valve get agin 'GO update and now work ....
__________________
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
me-Shoe
Senior Member
Join Date: Apr 2008
Old 05-13-2018 , 11:59   Re: [CS:GO] Open MOTD window without redirect page (javascript)
Reply With Quote #10

Hello,

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

Thanks for help!
__________________
me-Shoe 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 22:28.


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