Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include < amxmodx >
- #include < ColorChat >
- #define szPrefix "AMXX"
- enum _: mData
- {
- iMenu[ 32 ],
- iMenuHandler[ 32 ],
- iMenuMessage[ 64 ],
- iMenuCommand[ 32 ]
- }
- new MainCvar;
- new const mMenusData [ ] [ mData ] =
- {
- { "\rMenu\d #1", "MenuHandler1", "You have ^3enterd^1 to the Blabla #1 ^3Menu", "/help" },
- { "\rMenu\d #2", "MenuHandler2", "You have ^3enterd^1 to the Blabla #2 ^3Menu", "/help1" },
- { "\rMenu\d #3", "MenuHandler3", "You have ^3enterd^1 to the Blabla #3 ^3Menu", "/help2" },
- { "\rMenu\d #4", "MenuHandler4", "You have ^3enterd^1 to the Blabla #4 ^3Menu", "/help3" }
- }
- public plugin_init()
- {
- register_plugin( "Simple Menu", "1.0", "Xdoctor" );
- register_clcmd( "say /menu", "CmdMenu" );
- MainCvar = register_cvar( "mainmenu_status", "0" ) // 0 == Menu // 1 == Command //
- }
- public CmdMenu( client )
- {
- new szText[ 128 ];
- formatex( szText, charsmax( szText ), "\d[ \y%s\d ]\r Main\y Help\w Menu:", szPrefix );
- new Menu = menu_create( szText, "CmdMainHandler" );
- for( new i; i < sizeof( mMenusData ); i++ )
- {
- formatex( szText, charsmax( szText ), "%s", mMenusData[ i ][ iMenu ] );
- menu_additem( Menu, szText );
- }
- menu_display( client, Menu, 0 );
- return 1;
- }
- public CmdMainHandler( client, Menu, Item )
- {
- if( Item == MENU_EXIT )
- {
- menu_destroy( Menu );
- return 1;
- }
- ColorChat( client, RED, "%s", mMenusData[ Item ][ iMenuMessage ] );
- switch( MainCvar )
- {
- case 0: set_task( 0.5, mMenusData[ Item ][ iMenuHandler ] );
- case 1: client_cmd( client, "say %s", mMenusData[ Item ][ iMenuCommand ] );
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement