Raised This Month: $ Target: $400
 0% 

[HTML] Lang File + HTML - Something Wrong?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Baws
Veteran Member
Join Date: Oct 2012
Old 03-31-2014 , 21:40   [HTML] Lang File + HTML - Something Wrong?
Reply With Quote #1

Every time i try to like test, there's some unknown symbols in the MOTD with a white screen.
Something wrong with this?

Here is the code: ( It's the lang file )

Code:
[en]
SH_MENU_TITLE = Surf Help Menu:
SH_MENU_LEARN_TEXT = Learn by: \rText
SH_MENU_LEARN_VIDEO = Learn by: \rVideo
SH_MENU_STOP_VIDEO = \r[\yStop The Video\r]

SH_CASE_EXIT = !g* !nYaaaayyy! !t%s!n, you are now a good surfer. Ask questions to be even better. Good Luck! !g*

SH_CASE_ZERO_LEARN_TEXT :
<html>
	<head>
		<style type="^&quot;text/css^&quot;">
<!--{cke_protected}{C}%3C!%2D%2D.sty1%20%7Bcolor%3A%20%23cdcccb%3Bfont-family%3A%20Arial%2C%20Helvetica%2C%20sans-serif%3B%7D%2D%2D%3E-->		</style>
	</head>
	<body bgcolor="^&quot;#000000^&quot;">
		<div align="^&quot;center^&quot;">
			<span class="^&quot;sty1^&quot;"><strong>- Surf Help -</strong></span></div>
		<p>
			&nbsp;</p>
		<table border="^&quot;1^&quot;" width="^&quot;100%%^&quot;">
		</table>
		<table border="^&quot;1^&quot;" width="^&quot;100%%^&quot;">
			<tbody>
				<tr>
					<td>
						<span class="^&quot;sty1^&quot;">To surf, jump or walk onto one of the curved walls (hereby referted to as 'ramps'). Then simply hold strafe (Default are the A and D keys). This will cause you to glide along the walls, or &quot;surf&quot;.</span></td>
				</tr>
				<tr>
					<td>
						<span class="^&quot;sty1^&quot;">While surfing, never press up, down, or crouch; pressing those will cause you to slide off the wall and fall, which, in most surf maps, will cause you to get sent back to your spawn.</span></td>
				</tr>
				<tr>
					<td>
						<span class="^&quot;sty1^&quot;">To change direction (in order to make it to the next ramp), press the button for the direction you wish to go before flying off of your current ramp.</span></td>
				</tr>
				<tr>
					<td>
						<span class="^&quot;sty1^&quot;">Surfing takes pratice, so don't be discouraged if you don't get it right the first time.</span></td>
				</tr>
			</tbody>
		</table>
		<p align="^&quot;center^&quot;">
			<span class="^&quot;sty1^&quot;"><strong>* For more help, check out the video by closing this screen and clicking #2! *</strong></span></p>
	</body>
</html>
:

SH_CASE_ONE_LEARN_VIDEO :
<html>
	<head>
		<title></title>
		<style type="^&quot;text/css^&quot;">
body{background:#000000;margin-left:8px;margin-top:0px;}		</style>
	</head>
	<body>
		<p brought="" by="" h3="" is="" n="" span="" style="^&quot;text-align:" this="" to="" video="" you="">
			<span style="^&quot;color:d7d5d2;^&quot;"><strong>Advanced Surfing Help Video</strong></span>^n</p>
		<p depends="" internet="" loading="" n="" note:="" on="" p="" span="" style="^&quot;text-align:" time="" your="">
			<span style="^&quot;color:cdcccb;^&quot;">Make sure to follow these steps, or you will end up in jail!</span></p>
		<p>
			^n</p>
		<pre>
		</pre>
		<center>
			<pre>
			<object data="^&quot;http://allied-gamers.com/player.swf^&quot;" height="^&quot;350^&quot;" quality="^&quot;high^&quot;" type="^&quot;application/x-shockwave-flash^&quot;" width="^&quot;400^&quot;">^n
<param name="^&quot;movie^&quot;" value="^&quot;http://allied-gamers.com/player.swf^&quot;" />^n
<param name="^&quot;FlashVars^&quot;" value="^&quot;backcolor=0x000000&amp;frontcolor=0xCCCCCC&amp;lightcolor=0x996600&amp;autostart=true&amp;volume=50&amp;file=http://www.youtube.com/watch?v=opdR6MVNIE4^&quot;" />^n
</object></pre>
		</center>
	</body>
</html>
:

SH_CASE_TWO_STOP_VIDEO :
<html>
	<head>
		<title></title>
		<style type="^&quot;text/css^&quot;">
pre{color:#cdcccb;}body{background:#000000;margin-left:8px;margin-top:0px;}		</style>
	</head>
	<body>
		<pre>
		</pre>
		<center>
			<pre>
			<b>Video Stopped.</b>
This has been brought you by Baws.
%s plugin is here to help you out.
Hope you learned something from this!</pre>
		</center>
	</body>
</html>
:
__________________
Like my clean plugins and work?

Last edited by Baws; 03-31-2014 at 21:42.
Baws is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-31-2014 , 23:16   Re: [HTML] Lang File + HTML - Something Wrong?
Reply With Quote #2

Doesn't look like a lang file to me, it doesn't follow the correct format afaik.

Also, you shouldn't put HTML in a lang file (HTML structure is only interpreted in one language).
__________________
fysiks is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 04-01-2014 , 06:44   Re: [HTML] Lang File + HTML - Something Wrong?
Reply With Quote #3

Put all the HTML in a file. Leave %L placeholders where the translated text should be. Read the text file and use that as the format[] arg of formatex(). Add all ML arguments afterwards.
__________________
Black Rose is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 04-01-2014 , 16:52   Re: [HTML] Lang File + HTML - Something Wrong?
Reply With Quote #4

But i saw Biohazzard mod and it did the same thing as me. Why mine didn't work?
__________________
Like my clean plugins and work?
Baws is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 04-01-2014 , 17:06   Re: [HTML] Lang File + HTML - Something Wrong?
Reply With Quote #5

Quote:
Originally Posted by baws View Post
But i saw Biohazzard mod and it did the same thing as me. Why mine didn't work?
Because you aren't following the right format. Btw, you should only use lang format for text, not whole html code.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 04-01-2014 , 17:36   Re: [HTML] Lang File + HTML - Something Wrong?
Reply With Quote #6

You are not escaping all the % correctly.
Code:
<!--{cke_protected}{C}%3C!%2D%2D.sty1%20%7Bcolor%3A%20%23cdcccb%3Bfont-family%3A%20Arial%2C%20Helvetica%2C%20sans-serif%3B%7D%2D%2D%3E-->		</style>
%20sans-serif will be read as an input. Numerical values between the selection of the data type will be read as limits. For example %.20s will force the input to be cut off after 20 characters. Exactly like %.2f that will only use 2 decimals for floats.
Example:
Code:
server_print("%.2s", "1234");
Code:
12


Code:
"^&quot;
That makes no sense at all. Especially when it's used on parameters:
Code:
<body bgcolor="^&quot;#000000^&quot;">
This would be fine as long as the text is defined outside of the pawn script.
Code:
<body bgcolor="#000000">
It's only the compiler that is reading " and defining them as termination of strings. If reading from any other source, like a file or a variable the runtime functions will only see this as 100010 / 0x22 / 34.

What happens when you save a string in pawn containing ^" is that the compiler replaces that with one cell only containing ". The ^ is just to tell the compiler to do so.

I would however leave it without quotes since you're almost touching that MOTD limit of 1536 characters, making ML very limited. Save all the space you can.
__________________

Last edited by Black Rose; 04-01-2014 at 17:46.
Black Rose is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 04-01-2014 , 17:54   Re: [HTML] Lang File + HTML - Something Wrong?
Reply With Quote #7

@Neee....l, you can use whole html code in a lang file, instead of line by line.
Code:
new iTest[ 1052 ]; formatex( iTest, charsmax( iTest ), "%L", id, "LANG_HTML_MOTD" ) show_motd( id, iTest, "Title or Something here" )

Then in the lang file you put the html code.


@Black Rose, Nothing worked, it's not just 1 html code in the lang file. Nothing of those html codes works.
And is there a way to remove those %? Or just put more characters?
__________________
Like my clean plugins and work?

Last edited by Baws; 04-01-2014 at 17:55.
Baws is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 04-01-2014 , 18:49   Re: [HTML] Lang File + HTML - Something Wrong?
Reply With Quote #8

I tested the first 4 and the first big one. Works just fine.
Escape % with %% because the escape is for a runtime function, not the compiler.
__________________
Black Rose is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-01-2014 , 18:49   Re: [HTML] Lang File + HTML - Something Wrong?
Reply With Quote #9

If you've seen it done in another plugin (the version of Biohazzard that I was able to get did not have any HTML in the lang file). If you have a version that does it, you should post the lang file so we can see how they do it (in fact, if you knew of a source that already did it, you should have used that as your template/example).

If it was going to work, you would probably need to put it all on one line with NO whitespace (i.e. all a single line) and make sure to escape all reserved characters (e.g. %).
__________________

Last edited by fysiks; 04-01-2014 at 18:50.
fysiks is offline
Baws
Veteran Member
Join Date: Oct 2012
Old 04-01-2014 , 19:03   Re: [HTML] Lang File + HTML - Something Wrong?
Reply With Quote #10

I saw this one:
Code:
HELP_MOTD :
<html>
	<head>
		<style type="text/css">
			pre
			{
				font-family:Verdana,Tahoma;
				color:#FFFFFF;
			}

			body
			{
				background:#000000;
				margin-left:8px;
				margin-top:0px;
			}
		</style>
	</head>

	<body scroll="no">
		<pre>
			<img src="http://img182.**************/img182/904/bio3od0.jpg">^n
			Biohazard v#Version# by cheap_suit^n^n^n
			Biohazard gameplay is a classic zombie outbreak scenario. Your goal is to^n^n
			fight off the zombies and avoid getting infected. If you're unlucky and^n^n
			become infected, your new goal is to infect/kill the remaining survivors.^n^n
			^n^n^n
			Chat Commands:^n^n
			say /help to open this motd.^n^n
			say /class to open the class menu.^n^n
			say /guns to enable the equip menu.^n^n
		</pre>
	</body>
</html>
:
I will try and add another % to the % so it will be like %%.
That's escape right?

Plus, i will remove the
Code:
&quot;
and remove the ^ from them. After that i will see if it will work, if not i will just post here again.
__________________
Like my clean plugins and work?
Baws 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 05:58.


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