Raised This Month: $32 Target: $400
 8% 

Disable or Delete MOTD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
)v(aster
Junior Member
Join Date: Feb 2008
Old 08-16-2008 , 09:00   Disable or Delete MOTD
Reply With Quote #1

I have a plugin that displays its own MOTD page (with a URL based on the players name).

The problem is the servers MOTD flashes quickly in the background, which I really don't want to happen.

Deleting the MOTD gets round this, but every now and then it comes back. I don't know if its a function of the game, or my server provider, either way I can't stop it.

My prefered (for its simplicity) solution would be to delete the MOTD.txt each time the map starts, but I can't find a way to do that as all of SM's file operations are restricted within the SM folder. Also, I don't know if the delete would occur in time for it not to be displayed when the first player connects, as the server may have already cached it.

Alternatively (and safer), I would like to disable the first occurance of the MOTD window, once that's been trapped, i'll open my MOTD panel. I've done some searching on this, and while it seemd easy(ish) in amxmodx, I am having trouble porting it to SM.

My attempt:

Code:
public OnPluginStart()
{
 new UserMsg:MessageId;
 
 MessageId = GetUserMessageId("VGUIMenu"); amxmodx uses string "MOTD"
 HookUserMessage(MessageId,testfunction);
}
 
public Action:testfunction(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init)
{
    new String:MsgName[256];
    GetUserMessageName(msg_id,MsgName,sizeof(MsgName));
    LogMessage("Message Name [%s], bfHandle: [%i], Players [%s], PlayersNum [%i], Reliable [%b], Init [%b]", MsgName, bf, players,playersNum, reliable, init);
    return Plugin_Handled;
}
What this displays is:
Quote:
Message Name [VGUIMenu], bfHandle: [196611], Players [], PlayersNum [1], Reliable [1], Init [0]
over and over, yet the MOTD (and choosemodel/weapons, which presumably are also MOTD screens), still display.

Any assistance would be appreciated. I'm not harcore at this, so if i'm asked to look at the source SDK i'll be lost.

Cheers
)v(aster is offline
franzcis066
Member
Join Date: Nov 2007
Old 08-16-2008 , 09:21   Re: Disable or Delete MOTD
Reply With Quote #2

Did you try making the MOTD.txt blank and read only file?
franzcis066 is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 08-16-2008 , 11:25   Re: Disable or Delete MOTD
Reply With Quote #3

Quote:
Originally Posted by )v(aster View Post
My prefered (for its simplicity) solution would be to delete the MOTD.txt each time the map starts, but I can't find a way to do that as all of SM's file operations are restricted within the SM folder.
Where did you get that idea from? All file operations are limited to the mod's folder, that's all.

And what game is this for? motd.txt should only be recreated when the server is updated.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
)v(aster
Junior Member
Join Date: Feb 2008
Old 08-16-2008 , 18:10   Re: Disable or Delete MOTD
Reply With Quote #4

Franzcis, making MOTD.txt a blank file did the trick! I expected it to display a blank white HTML page, cheers.

Tsunami, I used the build path function, and found that it showed something like "/sourcemod/test.txt", and I don't know the full directory structure to type the full linux path. - Is there a way to get the mod directory, and go from there (for future reference, Fran's solution works nicely).

It's for CSS, but I think my server provider has an auto update thing whenever the server crashes/other events?, which I suspected as being the reason it comes back.
)v(aster is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 08-16-2008 , 19:34   Re: Disable or Delete MOTD
Reply With Quote #5

Just don't use BuildPath. By default it starts in the mod folder, only if you use BuildPath it will start in the SM folder.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
LordMarqus
Senior Member
Join Date: Sep 2009
Location: Poland
Old 11-22-2010 , 16:45   Re: Disable or Delete MOTD
Reply With Quote #6

Hi. I know that thread is very old but question is almost the same. Is there a way to disable showing MOTD page for players. I want to use radio plugin but on map change MOTD stops playing music. Thanx in advance for an answer
__________________
My public plugins: [CS:S/CS:GO] Last Man Standing
LordMarqus 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 15:27.


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