AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Motd doesn't show all the text (https://forums.alliedmods.net/showthread.php?t=278977)

KiLLeR. 02-12-2016 14:55

Motd doesn't show all the text
 
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.

wickedd 02-12-2016 19:47

Re: Motd doesn't show all the text
 
Read this

fysiks 02-13-2016 00:05

Re: Motd doesn't show all the text
 
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.

siriusmd99 02-13-2016 02:45

Re: Motd doesn't show all the text
 
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"

KiLLeR. 02-13-2016 07:30

Re: Motd doesn't show all the text
 
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.

siriusmd99 02-13-2016 08:50

Re: Motd doesn't show all the text
 
Quote:

Originally Posted by KiLLeR. (Post 2392512)
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 как скриншот каторый сделаеш с браузера где у тебя показывает весь текст, удачи!.

KiLLeR. 02-13-2016 13:17

Re: Motd doesn't show all the text
 
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.

fysiks 02-13-2016 13:29

Re: Motd doesn't show all the text
 
The server will only transmit 1536 characters. Period. The only solutions are to reduce your message to 1536 characters or use an external URL.

klippy 02-13-2016 13:30

Re: Motd doesn't show all the text
 
Quote:

Originally Posted by fysiks (Post 2392462)
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.


All times are GMT -4. The time now is 09:30.

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