Raised This Month: $ Target: $400
 0% 

Simple Weapon menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zpoke
Senior Member
Join Date: Aug 2009
Location: Sweden
Old 10-16-2009 , 12:09   Simple Weapon menu
Reply With Quote #1

hello, can someone tell me how to make a simple weapon menu.

i mean a weapon menu that looks like CSDM's weapon menu


sorry for my english
Zpoke is offline
FaktuM
Junior Member
Join Date: Oct 2009
Location: Sweden
Old 10-16-2009 , 12:54   Re: Simple Weapon menu
Reply With Quote #2

Here you go, I didnt make the "menu". I hope that you know how to make it.
PHP Code:
#include < amxmodx >
#include < fun >

new const VERSION[ ] = "1.0"

new const WEAPONS[ ][ ] = 
{
    
"weapon_p228",
    
"weapon_scout",
    
"weapon_xm1014",
    
"weapon_mac10",
    
"weapon_aug",
    
"weapon_elite",
    
"weapon_fiveseven",
    
"weapon_ump45",
    
"weapon_sg550",
    
"weapon_galil",
    
"weapon_famas",
    
"weapon_usp",
    
"weapon_glock18",
    
"weapon_awp",
    
"weapon_mp5navy",
    
"weapon_m249",
    
"weapon_m3",
    
"weapon_m4a1",
    
"weapon_tmp",
    
"weapon_g3sg1",
    
"weapon_deagle",
    
"weapon_sg552",
    
"weapon_ak47",
    
"weapon_p90"
};

public 
plugin_init( )

    
register_plugin"Give Weapon"VERSION"FaktuM")
    
    
register_clcmd"say /weapons""GiveWeapons" );
}

public 
GiveWeaponsid )
{
    if ( 
is_user_aliveid ) )
        for ( new 
sizeofWEAPONS ) ; i++ )
            
give_itemidWEAPONS] );

FaktuM is offline
vitorrd
Senior Member
Join Date: Jul 2009
Old 10-16-2009 , 13:03   Re: Simple Weapon menu
Reply With Quote #3

Don't forget to give the player some ammo with cs_set_user_bpammo.
vitorrd is offline
FaktuM
Junior Member
Join Date: Oct 2009
Location: Sweden
Old 10-16-2009 , 13:14   Re: Simple Weapon menu
Reply With Quote #4

Quote:
Originally Posted by vitorrd View Post
Don't forget to give the player some ammo with cs_set_user_bpammo.
If you wish, you can add that. Zpoke (talked to him @ steam) just want this code snippet to hes Kz training plugin, so I dont think its necessary with ammo.
FaktuM is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-16-2009 , 14:20   Re: Simple Weapon menu
Reply With Quote #5

Code:
#include < amxmodx > #include < fun > new const VERSION[ ] = "0.1.0"; new const g_szWeaponConstNames[ ][ ] = {     "weapon_usp",     "weapon_hegrenade",     "weapon_m4a1",     "weapon_awp",     "weapon_deagle" }; new const g_szWeaponNames[ ][ ] = {     "USP",     "HE Grenade",     "M4A1",     "AWP",     "Deagle" }; new g_hWeaponMenu; public plugin_init( ) {     register_plugin( "Weapon Menu", VERSION, "Xellath" );         register_clcmd( "say /weapons", "weaponMenu" );         new szNumber[ 3 ];         g_hWeaponMenu = menu_create( "Weapon Menu", "weaponHandler" );         for ( new i; i < sizeof( g_szWeaponNames ); i++ )     {         num_to_str( i, szNumber, charsmax( szNumber ) );                 menu_additem( g_hWeaponMenu, g_szWeaponNames[ i ], szNumber );     } } public weaponMenu( iClient ) {     if ( is_user_alive( iClient ) )     {         menu_display( iClient, g_hWeaponMenu, 0 );     } } public weaponHandler( iClient, hMenu, iItem ) {     if ( iItem == MENU_EXIT )     {         menu_destroy( hMenu );         return PLUGIN_HANDLED;     }         new szData[ 6 ];     new iAccess, iCallback;         menu_item_getinfo( hMenu, iItem, iAccess, szData, 5, _, _, iCallback );         if ( is_user_alive( iClient ) )         give_item( iClient, g_szWeaponConstNames[ str_to_num( szData ) ] );         return PLUGIN_HANDLED; }

EDIT: Fixed, thanks Exo.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!

Last edited by Xellath; 10-16-2009 at 18:01.
Xellath 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 22:37.


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