Raised This Month: $32 Target: $400
 8% 

Weapon menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
STr!ker
Senior Member
Join Date: Jun 2009
Location: Germany
Old 04-09-2011 , 11:24   Weapon menu
Reply With Quote #1

Hey world.

I have maked for me a weaponmenu only for the ctīs.

I have the problem, that when they close their menu, they canīt reopen it. It would be great, if someone can make a check, if they have already a weapon from the weapon menu or not. If yes, the canīt reopen the menu. If not, they can reopen the menu.

Another nice idea is, that the weapon menu overwrite all other menus

Here my weapon menu:

PHP Code:
 #include <amxmodx>
 #include <cstrike>
 #include <fun>
 
 #define PLUGINNAME    "WeaponsforCT"
#define VERSION        "0.1b"
#define AUTHOR        "STrike"

 
public plugin_init()
 {
    
register_plugin(PLUGINNAMEVERSIONAUTHOR)
    
register_event"ResetHUD""Event_ResetHUD""be" );
    
register_clcmd"AntiFurien WaffenMenu","WeaponMenuforCt");
 }
public 
Event_ResetHUD(id)
{
    if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
    {
        
WeaponMenuforCt(id)
    }
}
 public 
WeaponMenuforCt(id)
 {
    new 
menu menu_create("\rAntiFurien WaffenMenu:""menu_handler");
   
    
menu_additem(menu"\wak47 + Deagle""1"0);
    
menu_additem(menu"\wM4A1 + Deagle""2"0);
    
menu_additem(menu"\wMP5 Navy + Deagle""3"0);
    
menu_additem(menu"\wXM1014  + Deagle""4"0); 
    
menu_additem(menu"\wM3  + Deagle""5"0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
   
    
menu_display(idmenu0);
 
 }
 public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    new 
key str_to_num(data);
 
    switch(
key)
    {
        case 
1:
        {
    
give_item(id"weapon_ak47")
    
give_item(id"weapon_deagle")
    
cs_set_user_bpammo(id,CSW_AK47,90)  
    
cs_set_user_bpammo(id,CSW_DEAGLE,35
        }
        case 
2:
        {
    
give_item(id"weapon_m4a1")
    
give_item(id"weapon_deagle")
    
cs_set_user_bpammo(id,CSW_M4A1,90)  
    
cs_set_user_bpammo(id,CSW_DEAGLE,35
        }
        case 
3
        {
    
give_item(id"weapon_mp5navy")
    
give_item(id"weapon_deagle")
    
cs_set_user_bpammo(id,CSW_MP5NAVY,120)  
    
cs_set_user_bpammo(id,CSW_DEAGLE,35
       }
case 
4
        {
    
give_item(id"weapon_xm1014")
    
give_item(id"weapon_deagle")
    
cs_set_user_bpammo(id,CSW_XM1014,32)  
    
cs_set_user_bpammo(id,CSW_DEAGLE,35
        }
case 
5
        {
    
give_item(id"weapon_m3")
    
give_item(id"weapon_deagle")
    
cs_set_user_bpammo(id,CSW_M3,32)  
    
cs_set_user_bpammo(id,CSW_DEAGLE,35
        }
    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 } 
STr!ker is offline
STr!ker
Senior Member
Join Date: Jun 2009
Location: Germany
Old 05-14-2011 , 09:08   Re: Weapon menu
Reply With Quote #2

Bumb.

How to add a command, called /guns, that the menu reopen, when the ct hasnīt got already a weapon?
STr!ker is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 05-14-2011 , 09:22   Re: Weapon menu
Reply With Quote #3

Remove the Exit item maybe?
bibu is offline
capozblack
Member
Join Date: Mar 2011
Location: Portugal
Old 05-14-2011 , 09:34   Re: Weapon menu
Reply With Quote #4

register_clcmd( "say /guns","WeaponMenuforCt")
__________________
capozblack is offline
Send a message via MSN to capozblack
STr!ker
Senior Member
Join Date: Jun 2009
Location: Germany
Old 05-14-2011 , 09:35   Re: Weapon menu
Reply With Quote #5

thx capozblack, but then they can reopen it all the time. They should reopen it, when they havenīt got a weapon, because they overwrite this menu with another menu :/
STr!ker is offline
STr!ker
Senior Member
Join Date: Jun 2009
Location: Germany
Old 05-14-2011 , 10:52   Re: Weapon menu
Reply With Quote #6

Hello, i have tried this now:

But know nothings work

PHP Code:
    #include <amxmodx>
    #include <cstrike>
    #include <fun>
     
    #define PLUGINNAME    "WeaponsforCT"
    #define VERSION        "0.1b"
    #define AUTHOR        "STrike"
     
    
new bool:g_HasAlready[33]=true
     
    
public plugin_init()
    {
            
register_plugin(PLUGINNAMEVERSIONAUTHOR)
            
register_event"ResetHUD""Event_ResetHUD""be" );
            
register_clcmd"say /guns","WeaponMenuforCt");
            
register_dictionary("waffenmenu.txt");
    }
    public 
Event_ResetHUD(id)
    {
            if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
            {
                    
WeaponMenuforCt(id)
            }
            
g_HasAlready[id] = false
    
}
    public 
WeaponMenuforCt(id)
    {
           
           
           
            new 
menu menu_create("\rAntiFurien WaffenMenu:""menu_handler");
           
            
menu_additem(menu"\wak47 + Deagle""1"0);
            
menu_additem(menu"\wM4A1 + Deagle""2"0);
            
menu_additem(menu"\wMP5 Navy + Deagle""3"0);
            
menu_additem(menu"\wXM1014  + Deagle""4"0);
            
menu_additem(menu"\wM3  + Deagle""5"0);
           
            
menu_setprop(menuMPROP_EXITMEXIT_ALL);
           
            
menu_display(idmenu0);
            return 
PLUGIN_HANDLED
           
    
}
    public 
menu_handler(idmenuitem)
    {
            if( 
item == MENU_EXIT )
            {
                    
menu_destroy(menu);
                    return 
PLUGIN_HANDLED;
            }
            new 
data[6], iName[64];
            new 
accesscallback;
            
menu_item_getinfo(menuitemaccessdata,5iName63callback);
            new 
key str_to_num(data);
           
            switch(
key)
            {
                    case 
1:
                    {
                            if(
g_HasAlready[id])
                            {
                                    return 
PLUGIN_CONTINUE
                            
}
                            else
                            {
                                    
client_print (idprint_chat"%L"LANG_PLAYER"HAVE_ALREADY")
                                    return 
PLUGIN_HANDLED
                                   
                                   
                            
}
                           
                            
give_item(id"weapon_ak47")
                            
give_item(id"weapon_deagle")
                            
cs_set_user_bpammo(id,CSW_AK47,90)  
                            
cs_set_user_bpammo(id,CSW_DEAGLE,35)
                            
g_HasAlready[id] = true
                           
                    
}
                    case 
2:
                    {
                            if(
g_HasAlready[id])
                            {
                                    return 
PLUGIN_CONTINUE
                            
}
                            else
                            {
                                    
client_print (idprint_chat"%L"LANG_PLAYER"HAVE_ALREADY")
                                    return 
PLUGIN_HANDLED
                                   
                            
}
                           
                            
give_item(id"weapon_m4a1")
                            
give_item(id"weapon_deagle")
                            
cs_set_user_bpammo(id,CSW_M4A1,90)  
                            
cs_set_user_bpammo(id,CSW_DEAGLE,35)
                            
g_HasAlready[id] = true
                    
}
                    case 
3:
                    {
                            if(
g_HasAlready[id])
                            {
                                    return 
PLUGIN_CONTINUE
                            
}
                            else
                            {
                                    
client_print (idprint_chat"%L"LANG_PLAYER"HAVE_ALREADY")
                                    return 
PLUGIN_HANDLED
                            
}
                           
                            
give_item(id"weapon_mp5navy")
                            
give_item(id"weapon_deagle")
                            
cs_set_user_bpammo(id,CSW_MP5NAVY,120)  
                            
cs_set_user_bpammo(id,CSW_DEAGLE,35)
                            
g_HasAlready[id] = true
                    
}
                    case 
4:
                    {
                            if(
g_HasAlready[id])
                            {
                                    return 
PLUGIN_CONTINUE
                            
}
                            else
                            {
                                    
client_print (idprint_chat"%L"LANG_PLAYER"HAVE_ALREADY")
                                    return 
PLUGIN_HANDLED
                                   
                            
}
                           
                            
give_item(id"weapon_xm1014")
                            
give_item(id"weapon_deagle")
                            
cs_set_user_bpammo(id,CSW_XM1014,32)  
                            
cs_set_user_bpammo(id,CSW_DEAGLE,35)
                            
g_HasAlready[id] = true
                    
}
                    case 
5:
                    {
                            if(
g_HasAlready[id])
                            {
                                    return 
PLUGIN_CONTINUE
                            
}
                            else
                            {
                                    
client_print (idprint_chat"%L"LANG_PLAYER"HAVE_ALREADY")
                                    return 
PLUGIN_HANDLED
                                   
                            
}
                           
                            
give_item(id"weapon_m3")
                            
give_item(id"weapon_deagle")
                            
cs_set_user_bpammo(id,CSW_M3,32)  
                            
cs_set_user_bpammo(id,CSW_DEAGLE,35)
                            
g_HasAlready[id] = true
                    
}
            }
           
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
    } 
Hello, i have tried this now:
STr!ker is offline
capozblack
Member
Join Date: Mar 2011
Location: Portugal
Old 05-14-2011 , 12:17   Re: Weapon menu
Reply With Quote #7

register_clcmd( "say /guns","Event_ResetHUD");

Modifies

You want to use for only one per round?
__________________
capozblack is offline
Send a message via MSN to capozblack
STr!ker
Senior Member
Join Date: Jun 2009
Location: Germany
Old 05-14-2011 , 12:27   Re: Weapon menu
Reply With Quote #8

I want this. At the spawn, the menu is open (have already).
I someone close this menu, because he has opened a other menu, so he can reopen it at once
STr!ker is offline
Old 05-15-2011, 01:14
Kreation
This message has been deleted by Kreation. Reason: fail. i should read more.
Old 05-16-2011, 12:20
STr!ker
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
21Gramm
Junior Member
Join Date: Aug 2010
Old 05-24-2011 , 11:53   Re: Weapon menu
Reply With Quote #9

Would also like the!
21Gramm is offline
Old 05-31-2011, 09:02
STr!ker
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
STr!ker
Senior Member
Join Date: Jun 2009
Location: Germany
Old 06-09-2011 , 12:26   Re: Weapon menu
Reply With Quote #10

bumb
STr!ker 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 15:50.


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