Raised This Month: $ Target: $400
 0% 

[Solved] client_cmd, print_chat MENU_EXIT problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Baws
Veteran Member
Join Date: Oct 2012
Old 03-30-2014 , 18:35   [Solved] client_cmd, print_chat MENU_EXIT problem
Reply With Quote #1

When i click 0 which is the exit, nothing of it happens. Any reason why?

Code:
#include < amxmodx > #include < amxmisc > new const g_szPlugin[ ]  = "Surf Help"; new const g_szVersion[ ] = "1.0"; new const g_szAuthor[ ]  = "Baws"; enum Color {         NORMAL = 1,         GREEN,         TEAM_COLOR,         GREY,         RED,         BLUE }; new const g_szLearnedSound[ ] = "sound/misc/learnedsurfing.wav"; new const g_szTitle[ ] = "Advanced Surf Help"; public plugin_init( ) {     register_plugin( g_szPlugin, g_szVersion, g_szAuthor )         register_clcmd( "say /surfhelp", "SurfHelpMenu" );     register_clcmd( "say_team /surfhelp", "SurfHelpMenu" );         register_dictionary( "SurfHelp.txt" ); } public SurfHelpMenu( id ) {     new hMenu = menu_create( "Surf Help Menu:", "SurfHelpMenu_Handler" );     menu_additem( hMenu, "Learn by: \rText", "", 0 );     menu_additem( hMenu, "Learn by: \rVideo", "", 0 );     menu_additem( hMenu, "\yStop The Video!", "", 0 );         menu_display( id, hMenu, 0 ); } public SurfHelpMenu_Handler( id, hMenu, item ) {     if( item == MENU_EXIT )     {         new szName[ 33 ];         get_user_name( id, szName, charsmax( szName ) );         client_print_color( id, NORMAL, "^3%s^1, you are now a good surfer. Ask questions to be even better. Good Luck!" );         client_cmd( id, "spk %s", g_szLearnedSound );                 menu_destroy( hMenu );         return PLUGIN_HANDLED;     }         switch( item )     {         case 0:         {             new Motd[ 2056 ], Len;             Len = formatex( Motd, charsmax( Motd ), "<html><head><style type=^"text/css^"><span style=^"color:#cdcccb;^">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:d7d5d2;^"><strong>- Surf Help - </strong></span></p>^n" );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<p>&nbsp;</p>^n" );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<p>To surf, jump or walk on to one of the curved walls <span style=^"color:#00ff00;^">(</span> Hereby referred to as " );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<span style=^"color:#ff0000;^">'</span>ramps<span style=^"color:#ff0000;^">'</span> <span style=^"color:#00ff00;^">)</span>.</p>^n" )             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<p>Then simply hold strafe <span style=^"color:#00ff00;^">(</span> Default are the <em><span style=^"color:#ff0000;^">A</span></em> and " );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<em><span style=^"color:#ff0000;^">D</span></em> keys <span style=^"color:#00ff00;^">)</span>. This will cause you to glide along the walls, or " );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<span style=^"color:#ff0000;^">'</span>surf<span style=^"color:#ff0000;^">'</span>.</p>^n" );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<p>While surfing, never press up, down, or crouch; pressing those will cause you to slide off the wall and fall, which,</p>^n" );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<p>in most surf maps, will cause you to get sent back to your spawn. To change direction <span style=^"color:#00ff00;^">(</span> In order to make it to the next ramp <span style=^"color:#00ff00;^">)</span>,</p>^n" );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<p>press the button for the direction you wish to go before flying off of your current ramp. Maps with water surfaces, allow you</p>^n" );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<p>to ski across them, while holding <span style=^"color:#00ff00;^">(</span> Duck <span style=^"color:#ff0000;^">+</span> Jump <span style=^"color:#00ff00;^">)</span> key together. Surfing takes practice, so don't be discouraged if you don't</p>^n" );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<p>get it right the first time.</p>^n" );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<p>&nbsp;</p>^n" );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<p><span style=^"color:#ff0000;^">*</span> If you still got problems with surfing go watch the video by closing this screen and clicking #<span style=^"color:#00ff00;^">2</span>! <span style=^"color:#ff0000;^">*</span></p>^n" );             formatex( Motd[ Len ], charsmax( Motd ) - Len, "</span></body></html>" );             show_motd( id, Motd, g_szTitle )                 SurfHelpMenu( id );         }         case 1:         {             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>%s</strong></em>.</span></p>^n", g_szAuthor );             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" );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<pre><center><object type=^"application/x-shockwave-flash^" data=^"http://allied-gamers.com/player.swf^" height=^"200^" width=^"500^" quality=^"high^">^n" );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<param name=^"movie^" value=^"http://allied-gamers.com/player.swf^">^n" );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<param name=^"FlashVars^" value=^"backcolor=0x000000&amp;frontcolor=0xCCCCCC&amp;lightcolor=0x996600&amp;autostart=true&amp;volume=50&amp;file=http://www.youtube.com/watch?v=opdR6MVNIE4^">^n" );             formatex( Motd[ Len ], charsmax( Motd ) - Len, "</object></EMBED></OBJECT></pre></body></html>" );             show_motd( id, Motd, g_szTitle )             SurfHelpMenu( id );         }         case 2:         {             new Motd[ 386 ], Len;             Len = formatex( Motd, charsmax( Motd ), "<html><head><style type=^"text/css^">pre{color:#cdcccb;}body{background:#000000;margin-left:8px;margin-top:0px;}</style></head><pre><body><center>" );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "<b>Video Stopped.</b>^n" );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "This has been brought you by %s.^n", g_szAuthor );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "%s plugin is here to help you out.^n", g_szPlugin );             Len += formatex( Motd[ Len ], charsmax( Motd ) - Len, "Hope you learned something from this!^n" );             formatex( Motd[ Len ], charsmax( Motd ) - Len, "</center></body></pre></html>" );             show_motd( id, Motd, g_szTitle );                             SurfHelpMenu( id );         }     }         return PLUGIN_HANDLED; } client_print_color( id, Color:type, const msg[ ], { Float, Sql, Result, _ }:... ) {     static SayText;     if( !SayText )     SayText = get_user_msgid( "SayText" );     static message[ 256 ];     switch( type )     {         case GREEN: // Green         {             message[ 0 ] = 0x04;         }         case TEAM_COLOR: // Team Color. Ie. Red (Terrorist) or blue (Counter-Terrorist).         {             message[ 0 ] = 0x03;         }         default: // Yellow.         {             message[ 0 ] = 0x01;         }     }     vformat( message[ 1 ], 251, msg, 4 );     message[ 192 ] = '^0';     if( id )     {         if( is_user_connected( id ) )         {             message_begin( MSG_ONE, SayText, { 0, 0, 0 }, id );             write_byte( id );             write_string( message );             message_end( );         }     }     else     {         static Players[ 32 ]; new Count, Index;         get_players( Players, Count );         for( new i = 0 ; i < Count ; i++ )         {             Index = Players[ i ];             message_begin( MSG_ONE, SayText, { 0, 0, 0 }, Index );             write_byte( Index );             write_string( message );             message_end( );         }     } } /*register_dictionary_colored( const iFile[ ] ) {     if( !register_dictionary( iFile ) )         return 0;     new iLangDir[ 128 ];     get_localinfo( "amxx_datadir", iLangDir, charsmax( iLangDir ) );     formatex( iLangDir, charsmax( iLangDir ), "%s/lang/%s", iLangDir, iFile );     new iTempFile = fopen( iLangDir, "rt" );     if( !iTempFile )     {         log_amx( "Failed to open: %s", iLangDir );         return 0;     }     new szBuffer[ 512 ], szLang[ 3 ], szKey[ 64 ], szTranslation[ 256 ], TransKey:iKey;     while( !feof( iTempFile ) )     {         arrayset( szBuffer, 0, sizeof szBuffer );         fgets( iTempFile, szBuffer, 511 );         trim( szBuffer );         if( szBuffer[ 0 ] == '[' )         {             strtok( szBuffer[ 1 ], szLang, 2, szBuffer, 1, ']' );         }         else if( szBuffer[ 0 ] )         {             strbreak( szBuffer, szKey, 63, szTranslation, 255 );             iKey = GetLangTransKey( szKey );                 if( iKey != TransKey_Bad )             {                 replace_all( szTranslation, 255, "!g", "^4" );                 replace_all( szTranslation, 255, "!t", "^3" );                 replace_all( szTranslation, 255, "!n", "^1" );                         AddTranslation( szLang, iKey, szTranslation[ 2 ] );             }         }     }     fclose( iTempFile );     return 1; }*/
__________________
Like my clean plugins and work?

Last edited by Baws; 03-30-2014 at 22:16.
Baws is offline
 



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 06:01.


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