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

[Solved] Constructing html motd in code?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 07-07-2016 , 05:29   [Solved] Constructing html motd in code?
Reply With Quote #1

Title. Can you show me an example in amxx code of an html motd containing some styled text?

No, I don't want to use show_motd(id, "blah/file.html");, I want to know how to construct the motd inside the code, not make an .html and load it from the amxx.

No, I did search, but I only get motds loading from html files.

Last edited by redivcram; 07-07-2016 at 05:38.
redivcram is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-07-2016 , 05:36   Re: Constructing html motd in code?
Reply With Quote #2

Something like this?
PHP Code:
new szBuffer[1536];

new 
iLen formatex(szBuffercharsmax(szBuffer), "<html><head><title>My MOTD</title></head><body>");
iLen += formatex(szBuffer[iLen], charsmax(szBuffer) - iLen"<p>Paragraph! Yay!</p><br/>");
iLen += formatex(szBuffer[iLen], charsmax(szBuffer) - iLen"<div>DIV! WOAAH!</div>");
iLen += formatex(szBuffer[iLen], charsmax(szBuffer) - iLen"</body></html>");

show_motd(idszBuffer); 

Last edited by klippy; 07-07-2016 at 05:36.
klippy is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 07-07-2016 , 05:38   Re: Constructing html motd in code?
Reply With Quote #3

ty
redivcram 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 19:50.


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