This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[Request] item menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kartush
Junior Member
Join Date: Sep 2023
Old 11-03-2023 , 17:47   [Request] item menu
Reply With Quote #1

Hello g-mans, can someone make a plugin that *sends commands to client console* like:

register_clcmd("item_LongAk", "Get_Weapon")

item_LongAk its the command that needs to be send in client's (player's) console in order to equip the thing
To be more specific a menu that pops up when the player its respawned , like when round begins , something like the menu from csdm(respawn mode), or ZP4.3(start menu) with Previous selection and Remember selection.
I want this for adding guns for players *Any team* .

Something like (just an example) :

[Grenades]
1. Frost Grenade
2. Pumpkin Grenade
3. Molotov Grenade

[Pistols]
1. Colt Anaconda
2. Dart Pistol
3. Knife Pistol

[Primary Weapons]
1. Ak47 Long
2. Plasma gun
3. Drill Gun
4. Thanatos5
5. MG3
6. M4a1 Scope
7. Quad Barrel

8. Previous Selection
9. Remember Selection

and a command on chat like /guns to re-enable the menu

I have try'd making this myself but i don't have knowledge for making such things.

if possible a .ini file , something like

[Rifles]
1. <AkLong> item_Aklong // The command that will be send
2. <Gun> item_gun

Last edited by Kartush; 11-03-2023 at 17:51.
Kartush is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 11-03-2023 , 18:29   Re: [Request] item menu
Reply With Quote #2

if all these items you listed have their own command then this might come handy
https://forums.alliedmods.net/showthread.php?t=284324
__________________
bigdaddy424 is offline
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 11-06-2023 , 00:44   Re: [Request] item menu
Reply With Quote #3

Yes, i have something similar for you here. But you need to modify it based on ur options. Here is a basic example

PHP Code:
#include <amxmodx> 

public plugin_init() 

    
register_plugin("Open Menu : Commands Menu","1.0","Critmedin"
    
    
register_clcmd("say /menu""m_menu");


public 
m_menu(id

    if(
<= get_user_team(id) <= 2)
    {
        
show_command_menu(id
    }
    else
    {
        
client_print(idprint_chat"You can not open this menu!")
    }
    return 
PLUGIN_HANDLED 


public 
show_command_menu(id

    new 
menu menu_create("Gun Menu:","command_menu_handler"
    
    
// Gun name
    
menu_additem(menu"Ak47 Long")
    
menu_additem(menu"Plasma gun")
    
menu_additem(menu"Quad Barrel")

    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
    
menu_display(idmenu0);
    
    return 
PLUGIN_HANDLED;


public 
command_menu_handler(idmenuitem
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    switch(
item)
    {
        
//Gun Item
        
case 0: { client_cmd(id"item_Aklong"); }
        case 
1: { client_cmd(id"item_PlasmaGun"); }
        case 
2: { client_cmd(id"item_QuadBarrel"); }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;  

elmedin is offline
Kartush
Junior Member
Join Date: Sep 2023
Old 11-07-2023 , 00:56   Re: [Request] item menu
Reply With Quote #4

Thank you for your answer.
Very good plugins , both are working perfect .
It is possible to add an option [Previous Setup] and [Remember Selection] like those from CSDM equip menu ?
Also if is possible to make it come forward when you get respawned? without any command like this from
Kartush is offline
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 11-08-2023 , 17:56   Re: [Request] item menu
Reply With Quote #5

Quote:
Originally Posted by Kartush View Post
Thank you for your answer.
Very good plugins , both are working perfect .
It is possible to add an option [Previous Setup] and [Remember Selection] like those from CSDM equip menu ?
Also if is possible to make it come forward when you get respawned? without any command like this from
I think with remember selection there would be a lot of use cases for me to do, but you can modify it urself further.

Down here there are 3 different menus you can choose, add as many as u want like previously.

PHP Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init() 

    
register_plugin("Open Menu: Commands Menu""1.1""Critmedin");
    
    
register_clcmd("say /menu""m_menu");

    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);



public 
m_menu(id

    if(
<= get_user_team(id) <= && is_user_alive(id))
    {
        
show_main_menu(id);
    }
    else
    {
        
client_print(idprint_chat"You cannot open this menu!");
    }
    return 
PLUGIN_HANDLED;


public 
fwHamPlayerSpawnPost(iPlayer) {
    if (
is_user_alive(iPlayer)) {
        
show_main_menu(iPlayer);
    }
    return 
HAM_IGNORED;
}

public 
show_main_menu(id

    new 
menu menu_create("Main Menu:""main_menu_handler");
    
menu_additem(menu"Knives");
    
menu_additem(menu"Assault Rifles");
    
menu_additem(menu"Pistols");
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    
    return 
PLUGIN_HANDLED;
}

public 
show_knives_menu(id

    new 
menu menu_create("Knives Menu:""command_menu_handler");
    
menu_additem(menu"Butterfly Knife");
    
menu_additem(menu"Karambit");
    
menu_additem(menu"Bayonet");
    
// Add more knife items if needed
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    
    return 
PLUGIN_HANDLED;
}

public 
show_assault_rifles_menu(id

    new 
menu menu_create("Assault Rifles Menu:""command_menu_handler");
    
menu_additem(menu"AK47");
    
menu_additem(menu"M4A1");
    
menu_additem(menu"Famas");
    
// Add more assault rifle items if needed
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    
    return 
PLUGIN_HANDLED;
}

public 
show_pistols_menu(id

    new 
menu menu_create("Pistols Menu:""command_menu_handler");
    
menu_additem(menu"Desert Eagle");
    
menu_additem(menu"Glock");
    
menu_additem(menu"USP");
    
// Add more pistol items if needed
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    
    return 
PLUGIN_HANDLED;
}

public 
main_menu_handler(idmenuitem
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    switch(
item)
    {
        case 
0show_knives_menu(id);
        case 
1show_assault_rifles_menu(id);
        case 
2show_pistols_menu(id);
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
command_menu_handler(idmenuitem
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    switch(
menu)
    {
        
// Knives Menu
        
case 0:
            switch(
item)
            {
                case 
0client_cmd(id"item_ButterflyKnife");
                case 
1client_cmd(id"item_Karambit");
                case 
2client_cmd(id"item_Bayonet");
                
// Add more knife cases if needed
            
}
            

        
// Assault Rifles Menu
        
case 1:
            switch(
item)
            {
                case 
0client_cmd(id"item_AK47");
                case 
1client_cmd(id"item_M4A1");
                case 
2client_cmd(id"item_Famas");
                
// Add more assault rifle cases if needed
            
}
            

        
// Pistols Menu
        
case 2:
            switch(
item)
            {
                case 
0client_cmd(id"item_DesertEagle");
                case 
1client_cmd(id"item_Glock");
                case 
2client_cmd(id"item_USP");
                
// Add more pistol cases if needed
            
}
            
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;  

elmedin is offline
Kartush
Junior Member
Join Date: Sep 2023
Old 11-08-2023 , 18:30   Re: [Request] item menu
Reply With Quote #6

its perfect , enough for me , thank you all :*
Kartush is offline
Reply



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 19:56.


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