RSSy MYGO.pl Opublikowano Lipiec 30, 2022 o 15:12 RSSy Udostępnij Opublikowano Lipiec 30, 2022 o 15:12 About:Creates extended menus with various features. On it's own this plugin does nothing, it requires other plugins to utilize the features provided. Details:Creates more than 1-7 selectable entries compared to default menus. Various menu types:Selectable option only Toggle option on/off Select through a list of options Increment and decrement by a value, with default, minimum and maximum values Supports translations (the whole menu needs to be added to the translations to function). Supports adding multiple pages to select through, specify where a new page starts. Thanks:flash_cat - For the request. Sreaper - For various feature suggestions and testing. Psykotik - For reviewing the code and coding suggestions. Cvars: Saved to extra_menu_api.cfg in your servers \cfg\sourcemod\ folder. PHP Code: // Path to the sound to play when moving through the menu. Or \"\" for no sound. extra_menu_sound_move "buttons/button14.wav" // Path to the sound to play when clicking a menu option. Or \"\" for no sound. extra_menu_sound_click "buttons/combine_button7.wav" Example Plugins: Extra Menu API - Test PluginShows all the different selectable menu types Shows adding an extra page of menu options Shows usage for other plugins, to add and delete the menu Creates the command sm_menutest to open the menu Extra Menu API - Test TranslationsShows a basic menu using translations. Shows opening another menu when selecting an entry Shows usage for other plugins, to add and delete the menu Creates the command sm_menutrans to open the menu Natives and Forwards for developers: (see the extra_menu.inc include file for details) Spoiler PHP Code: // Different row types allowed in the menu enum EXTRA_MENU_TYPE { MENU_ENTRY, // Simple row of text, not selectable MENU_SELECT_ONLY, // Entry that can be selected MENU_SELECT_ONOFF, // Entry that will turn on/off when selected MENU_SELECT_LIST, // Scroll through a list of entries MENU_SELECT_ADD, // Entry that will increment and decrement a value } // Creates a new menu native int ExtraMenu_Create(bool back = false, char[] translation = ""); // Deletes the specified menu native bool ExtraMenu_Delete(int menu_id); // Adds a row entry to the menu, either non-selectable text or an option to select. native bool ExtraMenu_AddEntry(int menu_id, char[] entry, EXTRA_MENU_TYPE type, bool close = false, int default_value = 0, any add_value = 0, any add_min = -999999, any add_max = 999999); // Adds a set of options to scroll through, for use with the "MENU_SELECT_LIST" type. native bool ExtraMenu_AddOptions(int menu_id, char[] entry); // Adds the next "ExtraMenu_AddEntry" data to a new page and creates the "Next Page" and "Previous Page" options native void ExtraMenu_NewPage(int menu_id); // Displays a menu to a client. native bool ExtraMenu_Display(int client, int menu_id, int time = MENU_TIME_FOREVER); // Triggers whenever any menu item is selected, verify the ID with your known menus. forward void ExtraMenu_OnSelect(int client, int menu_id, int option, int value); Changes: Code: 1.0 (30-Jul-2022) - Initial release. Installation:Download the .zip and extract the files to their respective folders in your servers \addons\sourcemod\ folder. Only the \sourcemod\plugins\extra_menu.smx is required to use the plugin, all other files are for developers to use. Attached Files extra_menu.zip (26.0 KB) Wyświetl pełny artykuł Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi