Raised This Month: $ Target: $400
 0% 

Motd doesn't show all the text


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 02-12-2016 , 14:55   Motd doesn't show all the text
Reply With Quote #1

What is wrong with this?
PHP Code:
static motd[4096], len;
            
len formatex(motdcharsmax(motd), "<html>");
len += formatex(motd[len], charsmax(motd) - len"<head>");
len += formatex(motd[len], charsmax(motd) - len"<meta charset=^"UTF-8^" content=^"text/html^" http-equiv=^"content-type^">");
len += formatex(motd[len], charsmax(motd) - len"</head>");
len += formatex(motd[len], charsmax(motd) - len"<body>");
len += formatex(motd[len], charsmax(motd) - len"<img src=^"http://static2.cs-bg.net/images/csbg-35.png^">");
len += formatex(motd[len], charsmax(motd) - len"<h1>Правила на сървъра</h1>");
len += formatex(motd[len], charsmax(motd) - len"<ol>");
len += formatex(motd[len], charsmax(motd) - len"<b><li>Забранено е използването на помощни средства.</li></b>"); // 1st point
len += formatex(motd[len], charsmax(motd) - len"- <i>Наказва се с бан до 30 дни.</i>");
len += formatex(motd[len], charsmax(motd) - len"<b><li>Забранено е арогантното поведение към останалите играчи.</li></b>"); // 2nd point
len += formatex(motd[len], charsmax(motd) - len"- <i>Наказва се с гаг или бан до един ден по преценка на администратора.</i>");
len += formatex(motd[len], charsmax(motd) - len"<b><li>Забранено е рекламирането на друг сайт или сървър.</li></b>"); // 3rd point
len += formatex(motd[len], charsmax(motd) - len"- <i>Наказва се с гаг или бан до един ден по преценка на администратора.</i>");
len += formatex(motd[len], charsmax(motd) - len"<b><li>Забранено е повторното свързане към сървъра в рамките на една минута.</li></b>"); // 4th point
len += formatex(motd[len], charsmax(motd) - len"- <i>Наказва се с бан до един ден.</i>");
len += formatex(motd[len], charsmax(motd) - len"<b><li>Така нареченият 'block' е забранен.</li></b>"); // 5th point
len += formatex(motd[len], charsmax(motd) - len"- <i>Наказва се със слей или бан до пет дни по преценка на администратора.</i>");
len += formatex(motd[len], charsmax(motd) - len"<b><li>Така нареченият 'boost' е забранен.</li></b>"); // 6th point
len += formatex(motd[len], charsmax(motd) - len"- <i>Наказва се със слей или бан до три дни по преценка на администратора.</i>");
len += formatex(motd[len], charsmax(motd) - len"<b><li>Така нареченият 'camp' е забранен.</li></b>"); // 7th point
len += formatex(motd[len], charsmax(motd) - len"- <i>Наказва се със слей или бан до пет дни по преценка на администратора.</i>");
len += formatex(motd[len], charsmax(motd) - len"<b><li>Така нареченият 'nk' е забранен.</li></b>"); // 8th point
len += formatex(motd[len], charsmax(motd) - len"- <i>Наказва се със слап или слей по преценка на администратора.</i>");
len += formatex(motd[len], charsmax(motd) - len"<b><li>Така нареченият 'stab' е забранен.</li></b>"); // 9th point
len += formatex(motd[len], charsmax(motd) - len"- <i>Наказва се със слей или бан до пет дни по преценка на администратора.</i>");
len += formatex(motd[len], charsmax(motd) - len"<ol>");
len += formatex(motd[len], charsmax(motd) - len"</body>");
len += formatex(motd[len], charsmax(motd) - len"</html>");

client_print(idprint_chat"%d"len); // the output here is 2077

show_motd(idmotd"Rules [BG]"); 
http://i.imgur.com/NJDC4q1.png
As can you see from the image above, after 7th point text doesn't appear.

Last edited by KiLLeR.; 02-12-2016 at 15:40.
KiLLeR. is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 02-12-2016 , 19:47   Re: Motd doesn't show all the text
Reply With Quote #2

Read this
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-13-2016 , 00:05   Re: Motd doesn't show all the text
Reply With Quote #3

An MOTD like this can only be 1536 characters so your maximum array size is actually 1537.

Anything longer needs to be an external URL.
__________________

Last edited by fysiks; 02-13-2016 at 00:05.
fysiks is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 02-13-2016 , 02:45   Re: Motd doesn't show all the text
Reply With Quote #4

try to make it .html in configs folder and then use show motd on that html file. To implement your html code , use visual editor. You can search on Google for "online html editor"
siriusmd99 is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 02-13-2016 , 07:30   Re: Motd doesn't show all the text
Reply With Quote #5

I try this.
PHP Code:
show_motd(id"addons/amxmodx/configs/rules_bg.html""Rules [BG]"); 
When I open 'rules_bg.html' file with Google Chrome the whole text is shown, but when I open in server with motd, still all the text doesn't appear.

Last edited by KiLLeR.; 02-13-2016 at 07:35.
KiLLeR. is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 02-13-2016 , 08:50   Re: Motd doesn't show all the text
Reply With Quote #6

Quote:
Originally Posted by KiLLeR. View Post
I try this.
PHP Code:
show_motd(id"addons/amxmodx/configs/rules_bg.html""Rules [BG]"); 
When I open 'rules_bg.html' file with Google Chrome the whole text is shown, but when I open in server with motd, still all the text doesn't appear.
[EN] Dude, this is because you use russian and every russian symbol is not one because when is decodified it looks like : Г - this is just a symbol, so when you write a russian letter it's length is 5-6 symbols.
Take a look here : http://symbolcodes.tlt.psu.edu/bylanguage/cyrchart.html

Try to put rules in english just to test it , let it be the same lenght but english characters.
To make it work with russian characters just go on your browser and take a screenshot and put it in the .html file as sa screenshot, like you've put the ad image in your script. Succes.


[RU] Чувак , это потому что ты написал на руском и как англииский это базовый язык в html то другие языки распазнаются как симболы , и то как один руский симбол это 5-6 в html ,это значит что длина текста намного больше. Я знаю что это пиздец но такова ряльность, попробуй на английский написать такой же длиной.
Карочи,чтоб руский текс сработал просто ставь в html как скриншот каторый сделаеш с браузера где у тебя показывает весь текст, удачи!.

Last edited by siriusmd99; 02-13-2016 at 08:52.
siriusmd99 is offline
KiLLeR.
Senior Member
Join Date: Jul 2014
Location: Bulgaria
Old 02-13-2016 , 13:17   Re: Motd doesn't show all the text
Reply With Quote #7

I'm not Russian, but never mind. The rules are in two language - BG and EN, and the problem is in both. The only one difference between both language is that the rules of EN show a bit more than rules of BG. I found a solution to this problem and it is to reduce the text of rules.

Last edited by KiLLeR.; 02-13-2016 at 13:18.
KiLLeR. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-13-2016 , 13:29   Re: Motd doesn't show all the text
Reply With Quote #8

The server will only transmit 1536 characters. Period. The only solutions are to reduce your message to 1536 characters or use an external URL.
__________________

Last edited by fysiks; 02-13-2016 at 13:29.
fysiks is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-13-2016 , 13:30   Re: Motd doesn't show all the text
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
An MOTD like this can only be 1536 characters so your maximum array size is actually 1537.

Anything longer needs to be an external URL.
It's just what Fysiks said. You need an external URL (http://example.com) if you want to display more text. Sending a local file from server is just AMXX's little addition to make it easier for users. show_motd() doesn't send a file, it just reads file's contents and sends them over network message, so you are stuck with 1536 limit anyway.
klippy 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 09:30.


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