Raised This Month: $ Target: $400
 0% 

Menu and spawn stuff


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vL.
Senior Member
Join Date: Aug 2009
Location: Estonia
Old 06-11-2010 , 18:05   Re: Menu and spawn stuff
Reply With Quote #1

Ok here's the full code without the modifications you told me to make.

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

public plugin_init()
{
    
register_plugin"Weapons""1.0""vL." )
    
    
RegisterHam(Ham_Spawn"player""Fwd_Ham_Spawn_Post"1);
    
    
register_clcmd("say /weapons""Weapons");
}

public 
Fwd_Ham_Spawn_Post(id)
{  
    if(
is_user_connected(id) && is_user_alive(id))
    {
        
give_item(id"weapon_m4a1");
        
cs_set_user_bpammo(idCSW_M4A190);
    }
 
    return 
PLUGIN_HANDLED;
}

public 
Weapons(id)
{    
    new 
menu menu_create("\yWeapons""menu_handler");
    
    
menu_additem(menu"M4A1""1"0); // The Default weapon
    
menu_additem(menu"AK47""2"0);
    
menu_additem(menu"AWP""3"0);
    
menu_additem(menu"Scout""4"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_m4a1");
            
cs_set_user_bpammo(idCSW_M4A190);        
        }
        case 
2:
        {
            
give_item(id"weapon_ak47");
            
cs_set_user_bpammo(idCSW_AK4790);        
        }
        case 
3:
        {
            
give_item(id"weapon_awp");
            
cs_set_user_bpammo(idCSW_AWP30);        
        }
        case 
4:
        {
            
give_item(id"weapon_scout");
            
cs_set_user_bpammo(idCSW_SCOUT90);        
        }
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;


Last edited by vL.; 06-11-2010 at 18:11.
vL. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-11-2010 , 19:10   Re: Menu and spawn stuff
Reply With Quote #2

No, show the code that doesn't work. Show what you tried. I'm not going to do it all for you.
__________________
fysiks 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 05:23.


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