Raised This Month: $51 Target: $400
 12% 

[CS:GO]How can i show the Motd on a chat message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Reeley
Member
Join Date: Jan 2017
Location: 127.0.0.1
Old 11-14-2017 , 12:24   [CS:GO]How can i show the Motd on a chat message
Reply With Quote #1

im trying to display the Motd when a user types !motd in the chat, but nothing happens when i call ShowMOTDPanel am i doing something wrong?

Code:
public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs){
   if (strcmp(sArgs, "!motd", false) == 0){
     PrintToChatAll("Trying to display Motd!");
     ShowMOTDPanel(client, "Google", "http://www.google.com/", MOTDPANEL_TYPE_URL);
     PrintToChatAll("Motd should be displayed now!");
   }
}
i can see the motd when joining the server, but not when typing !motd in chat

Last edited by Reeley; 11-14-2017 at 12:24.
Reeley is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 11-15-2017 , 05:45   Re: [CS:GO]How can i show the Motd on a chat message
Reply With Quote #2

CS:GO is finicky when it comes to using ShowMOTDPanel, from what I hear. Your code works fine in TF2.

You'll probably want to integrate WebFix or just use any of the multiple working web shortcuts plugins out there, though (shameless plug) I'd like it if you tried out my URL Cache Buster plugin beta with that code (I don't have CS:GO to test and most CS:GO-centric plugins use one of those workarounds).
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 11-15-2017 at 05:47.
nosoop is offline
Reeley
Member
Join Date: Jan 2017
Location: 127.0.0.1
Old 11-15-2017 , 06:21   Re: [CS:GO]How can i show the Motd on a chat message
Reply With Quote #3

Good to know, that this works with tf2. I will test webfix and will try your plugin when i get Home today

EDIT:

This is driving me absolutely crazy. I did get webfix to work, then changed something and now it doesnt work anymore, although i completely reinstalled sourcemod.

Also webfix is showing the VGUIPanel and not the MotdPanel. VGUI looks kinda ugly, but i can live with that

Last edited by Reeley; 11-15-2017 at 14:56.
Reeley is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 11-16-2017 , 02:18   Re: [CS:GO]How can i show the Motd on a chat message
Reply With Quote #4

Try the WebLync_OpenUrl Native in WebLync.
__________________
Neuro Toxin is offline
Reeley
Member
Join Date: Jan 2017
Location: 127.0.0.1
Old 11-16-2017 , 03:02   Re: [CS:GO]How can i show the Motd on a chat message
Reply With Quote #5

Sounds promising, but i dont like all those dependencies i have with Weblync.
Reeley is offline
Reply



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 13:11.


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