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