Raised This Month: $ Target: $400
 0% 

how to do off/on in the menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
anakonda001
Member
Join Date: Jul 2020
Old 08-21-2020 , 14:41   how to do off/on in the menu
Reply With Quote #1

hello everyone as do in 5 point of off/on grenade sound, that would when clicked on point the on/off (and that would be written there on or off sound)

Code:
menu_additem(g_iMenu, "\r[\ysound grenade\r]", "5");
Code:
#include <amxmodx>

new g_iMenu;

public plugin_init() {
    register_plugin("Server Menu", "0.1", "maFFyoZZyk");
    register_clcmd("say /menu", "CmdMenu");
    register_clcmd("menu", "CmdMenu");
    register_clcmd("nightvision", "CmdMenu");
}

public plugin_cfg() {
    g_iMenu = menu_create("\wМеню", "MenuHandler")
    menu_additem(g_iMenu, "\r[\yanew\r]", "1");
    menu_additem(g_iMenu, "\r[\yreset score\r]", "2");
    menu_additem(g_iMenu, "\r[\ytest \rVIP]", "3");
    menu_additem(g_iMenu, "\r[\yvote for ban\r]", "4");
    menu_additem(g_iMenu, "\r[\ysound grenade\r]", "5");
    menu_additem(g_iMenu, "\r[\ymute\r]", "6");
    menu_additem(g_iMenu, "\r[\yadmin menu\r]", "7");
    menu_additem(g_iMenu, "\r[\ytop 15\r]", "8");
    
    menu_setprop(g_iMenu, MPROP_NEXTNAME, "further");
    menu_setprop(g_iMenu, MPROP_BACKNAME, "back");
    menu_setprop(g_iMenu, MPROP_EXITNAME, "exit");
    menu_setprop(g_iMenu, MPROP_EXIT,MEXIT_ALL);
}

public plugin_end() {
    menu_destroy(g_iMenu);
}

public CmdMenu(id) {
    menu_display(id, g_iMenu);
    return PLUGIN_HANDLED;
}

public MenuHandler(id, menu, item) {
    if (item == MENU_EXIT) {
        return;
    }
        
    new data[7];
    menu_item_getinfo(menu, item, .info = data, .infolen = charsmax(data));
    switch (str_to_num(data)) {
        case 1: client_cmd(id, "say /anew");
        case 2: client_cmd(id, "say /rs");
        case 3: client_cmd(id, "say /viptest");
        case 4: client_cmd(id, "say /voteban");
        case 5: client_cmd(id, "say /gsound");
	case 6: client_cmd(id, "say /mute");
        case 7:client_cmd(id, "amxmodmenu");
	case 8: client_cmd(id, "say /top15");
    }
}
anakonda001 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 13:46.


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