AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Solved] Compiler Stopped Compiling! (https://forums.alliedmods.net/showthread.php?t=237846)

Baws 03-30-2014 15:09

[Solved] Compiler Stopped Compiling!
 
Whenever i try to compile this code the compiler crashes i have no idea why.
Or the code is wrong? I couldn't test as i can't even compile the code.

Code:
/* Plugin generated by AMXX-Studio */ #include < amxmodx > #include < amxmisc > #define PLUGIN "Surf Help" #define VERSION "1.0" #define AUTHOR "Baws" public plugin_init( ) {     register_plugin( PLUGIN, VERSION, AUTHOR )         register_clcmd( "say /surfhelp", "Cmd_SurfHelp" );     register_clcmd( "say_team /surfhelp", "Cmd_SurfHelp" ); } public Cmd_SurfHelp( id ) {     new Motd[ 1056 ], Len;     Len = formatex( Motd, charsmax( Motd ), "<html><head><style type=^"text/css^">body{background:#000000;margin-left:8px;margin-top:0px;}</style></head><body>" );     Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<p style=^"text-align: center;^"><span style=^"color:cdcccb;^">This video is brought to you by <em><strong>Baws</strong></em>.</span></p>^n" );     Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<h3 style=^"text-align: center;^"><span style=^"color:d7d5d2;^"><strong>Advanced Surfing Help Video</strong></span></h3>^n" );     Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<p style=^"text-align: center;^"><span style=^"color:cdcccb;^">Note: Loading time depends on your internet speed.</span></p>^n" );     Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<p style=^"text-align: center;^"><span style=^"color:cdcccb;^">Make sure to follow these steps! Or you will end up in jail.</span></p>^n" );     formatex( Motd[ Len ], charsmax( Motd ) - Len, "</body></html>" );         Len = formatex( Motd, charsmax( Motd ), "<pre><center><object type=^"application/x-shockwave-flash^" data=^"http://allied-gamers.com/player.swf^" height=^"200^" width=^"500^" quality=^"high^"><param name=^"movie^" value=^"http://allied-gamers.com/player.swf^"><param name=^"FlashVars^" value=^"backcolor=0x000000&amp;frontcolor=0xCCCCCC&amp;lightcolor=0x996600&amp;searchbar=false&amp;autostart=true&amp;repeat=never&amp;shuffle=false&amp;volume=50&amp;file=http://www.youtube.com/watch?v=opdR6MVNIE4^"></object></EMBED></OBJECT></body></pre></html>" );         show_motd( id, Motd, "Advanced Surf Help" )         return PLUGIN_HANDLED; }

YamiKaitou 03-30-2014 15:18

Re: Compiler Stopped Compiling!
 
It is your last formatex line that is causing it

minato 03-30-2014 15:20

Re: Compiler Stopped Compiling!
 
HTML Code:

Len = formatex( Motd, charsmax( Motd ), "<pre><center><object type=^"application/x-shockwave-flash^" data=^"http://allied-gamers.com/player.swf^" height=^"200^" width=^"500^" quality=^"high^"><param name=^"movie^" value=^"http://allied-gamers.com/player.swf^"><param name=^"FlashVars^" value=^"backcolor=0x000000&amp;frontcolor=0xCCCCCC&amp;lightcolor=0x996600&amp;searchbar=false&amp;autostart=true&amp;repeat=never&amp;shuffle=false&amp;volume=50&amp;file=http://www.youtube.com/watch?v=opdR6MVNIE4^"></object></EMBED></OBJECT></body></pre></html>" );
the line is very long

Baws 03-30-2014 15:32

Re: Compiler Stopped Compiling!
 
Any possible way to make it shorter?

Yami, You mean last Len?

fysiks 03-30-2014 15:32

Re: Compiler Stopped Compiling!
 
Quote:

Originally Posted by baws (Post 2117998)
Any possible way to make it shorter?

Yami, You mean last Len?

You can break it up into multiple formats (exactly like you did above).

Baws 03-30-2014 15:54

Re: Compiler Stopped Compiling!
 
Thanks it works! <3

Black Rose 03-30-2014 16:35

Re: [Solved] Compiler Stopped Compiling!
 
If you don't format anything you can use a simpler function, like copy() or add().

Baws 03-30-2014 18:07

Re: [Solved] Compiler Stopped Compiling!
 
I see.

claudiuhks 03-30-2014 19:41

Re: [Solved] Compiler Stopped Compiling!
 
Furthermore, loading text from a file when map starts seems amazing.

Baws 03-30-2014 21:02

Re: [Solved] Compiler Stopped Compiling!
 
Quote:

Originally Posted by claudiuhks (Post 2118104)
Furthermore, loading text from a file when map starts seems amazing.

I will be not needing that as i will be doing multilingual with the plugin. But thanks anyways!


All times are GMT -4. The time now is 06:01.

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