Hi, I want to use HTML in a MOTD to display things nicely, and finally display a webpage with meta refresh when I have the webpage done and some more database things implemented.
I need help with the MOTD, because it's not rendering any HTML. I'm guessing it should at least just display the text inside it with some formating like any basic web browser, but here it just leaves the HTML tags and everything, as plain text.
I created a tiny plugin to reproduce this. In the attached screenshot it can be seen the MOTD that pops up when saying
/mymotdhtml. The other 2 commands show the an equal MOTD, no HTML rendered.
PHP Code:
#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
register_plugin("Testing MOTD", "0.0.1", "naz");
register_clcmd("say /mymotd", "CmdMOTD");
register_clcmd("say /mymotdtxt", "CmdMOTDFromTxt");
register_clcmd("say /mymotdhtml", "CmdMOTDFromHTML");
}
// Passing a string to the show_motd
public CmdMOTD(id)
{
show_motd(id, "<html><head></head><body><p>Test text</p></body></html>");
}
// Passing a .txt file to the show_motd
public CmdMOTDFromTxt(id)
{
new motdPath[32];
get_configsdir(motdPath, charsmax(motdPath));
formatex(motdPath, charsmax(motdPath), "%s/motd.txt", motdPath);
show_motd(id, motdPath);
}
// Passing an HTML file to the show_motd
public CmdMOTDFromHTML(id)
{
new motdPath[33];
get_configsdir(motdPath, charsmax(motdPath));
formatex(motdPath, charsmax(motdPath), "%s/motd.html", motdPath);
show_motd(id, motdPath);
}
I tried this in 2 different setups, but can't get it to display correctly in any of them:
- Client: Open Adrenaline Gamer (HL mod). Server: public (remote) ReHLDS server with AMXModX 1.8.3-dev+5154 and Metamod-r v1.3.0.126.
- Client: Half-Life. Server: listenserver with AMXModX 1.8.3-dev+5154 and Metamod 1.21.1-am.
Is it the plugin wrong? is there anything in those clients that prevent HTML from being rendered? because I've seen plugins in CS 1.6 render HTML in MOTD windows
am I missing anything else?
Thanks for your attention!