Raised This Month: $ Target: $400
 0% 

[Help] what I do wrong?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Milano
Junior Member
Join Date: Oct 2009
Old 10-12-2009 , 11:27   [Help] what I do wrong?
Reply With Quote #1

What I do wrong? I dont know, I new to script. Here is Code:

Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <cstrike>
#include <fun>
#include <fakemeta_util>
#define PLUGIN "Weaponmod"
#define VERSION "1.0"
#define AUTHOR "Milano"
new g_CvarOn
new szPrefix[19] = "[WM]"
new g_MaxPlayers;
public plugin_init() {
 register_plugin(PLUGIN, VERSION, AUTHOR)
 
 register_clcmd( "say /weapons", "MenuWeapons" )
 register_clcmd( "say_team /weapons", "MenuWeapons" )
 
 g_CvarOn = register_cvar( "wm_enable", "1" )
 register_cvar("wm_blockbuy", "1") 
 register_cvar("wm_prefix", szPrefix)
 
 g_MaxPlayers = get_maxplayers( );
 
 
 if (get_cvar_num("wm_blockbuy"))
 {
  register_clcmd("buy", "bblocked");
  register_clcmd("cl_autobuy", "bblocked");
  register_clcmd("cl_rebuy", "bblocked");
  register_clcmd("cl_setautobuy", "bblocked");
  register_clcmd("cl_setrebuy", "bblocked");
  
  register_clcmd("glock", "bblocked");
  register_clcmd("usp", "bblocked");
  register_clcmd("p228", "bblocked");
  register_clcmd("deagle", "bblocked");
  register_clcmd("elites", "bblocked");
  register_clcmd("fn57", "bblocked");
  
  register_clcmd("mp5", "bblocked");
  register_clcmd("smg", "bblocked");
  register_clcmd("mac10", "bblocked");
  register_clcmd("tmp", "bblocked");
  register_clcmd("ump45", "bblocked");
  register_clcmd("p90", "bblocked");
  
  register_clcmd("m3", "bblocked");
  register_clcmd("xm1014", "bblocked");
  
  register_clcmd("famas", "bblocked");
  register_clcmd("m4a1", "bblocked");
  register_clcmd("ak47", "bblocked");
  register_clcmd("sg552", "bblocked");
  register_clcmd("galil", "bblocked"); 
  register_clcmd("aug", "bblocked");
  
  register_clcmd("scout", "bblocked");
  register_clcmd("awp", "bblocked");
  register_clcmd("sg550", "bblocked");
  register_clcmd("g3sg1", "bblocked");
  
  register_clcmd("m249", "bblocked");
  
  register_clcmd("hegren", "bblocked");
  register_clcmd("flash", "bblocked");
  register_clcmd("sgren", "bblocked");
  register_clcmd("vest", "bblocked");
  register_clcmd("vesthelm", "bblocked");
  register_clcmd("shield", "bblocked");
  register_clcmd("buyammo1", "bblocked");
  register_clcmd("buyammo1", "bblocked");
  register_clcmd("buyequip", "bblocked");
 }
}
public MenuWeapons( id )
{
 if( get_user_team( id ) == CS_TEAM_CT 
 && get_pcvar_num( g_CvarOn ) 
 && is_user_alive( id ) )
{
 new menu = menu_create( "Weapons", "WeaponsHandle" )
 
 menu_additem( menu, "Rifleman", "1", 0 )
 menu_additem( menu, "Support Infantry", "2", 0 )
 menu_additem( menu, "Assault", "3", 0 )
 menu_additem( menu, "Light Infantry", "4", 0 )
 menu_additem( menu, "Sniper", "5", 0 )
 menu_additem( menu, "Machine Gunner", "6", 0 ) 
 
 menu_setprop( menu, MPROP_EXIT, MEXIT_NEVER ); 
 menu_display( id, menu, 0 )
 return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE
}
public WeaponsHandle( id, menu, item )
{
if( item == MENU_EXIT )
{
 menu_destroy( menu )
 return PLUGIN_HANDLED
}
new szData[ 6 ], szName[ 64 ], iAccess, iCallback, szWeapon[ 33 ][ 32 ], szPrint[ 33 ][ 32 ]
menu_item_getinfo( menu, item, iAccess, szData, 5, szName, 63, iCallback )
new key = str_to_num( szData )
switch( key )
{
 case 1: 
 {
  szWeapon[ id ] = "weapon_m4a1"
  szWeapon[ id ] = "weapon_usp"
  szPrint[ id ] = "M4A1 & Usp"
 }
 case 2:
 {
  szWeapon[ id ] = "weapon_m3"
  szWeapon[ id ] = "weapon_deagle"
  szPrint[ id ] = "M3 & Deagle"
 }
 case 3:
 {
  szWeapon[ id ] = "weapon_famas"
  szWeapon[ id ] = "weapon_glock18"
  szPrint[ id ] = "Famas & Glock"
 }
 case 4:
 {
  szWeapon[ id ] = "weapon_mp5"
  szWeapon[ id ] = "weapon_usp"
  szPrint[ id ] = "MP5 & Usp"
 }
 case 5:
 {
  szWeapon[ id ] = "weapon_awp"
  szWeapon[ id ] = "weapon_glock18"
  szPrint[ id ] = "AWP & Glock"
 }
 case 6:
 {
  szWeapon[ id ] = "weapon_m249"
  szWeapon[ id ] = "weapon_fiveseven"
  szPrint[ id ] = "Para & Fiveseven"
 }
 
 strip_user_weapons( id )
 give_item( id, szWeapon[ id ] )
 client_print( id, print_chat, "You now have %s", szPrint )
 
 menu_destroy( menu )
 return PLUGIN_HANDLED;
}  
public MenuWeapons1( id )
{
 if( get_user_team( id ) == CS_TEAM_T 
 && get_pcvar_num( g_CvarOn ) 
 && is_user_alive( id ) )
{
 new menu = menu_create( "Weapons", "WeaponsHandle1" )
 
 menu_additem( menu, "Rifleman", "1", 0 )
 menu_additem( menu, "Support Infantry", "2", 0 )
 menu_additem( menu, "Assault", "3", 0 )
 menu_additem( menu, "Light Infantry", "4", 0 )
 menu_additem( menu, "Sniper", "5", 0 )
 menu_additem( menu, "Machine Gunner", "6", 0 ) 
 
 menu_setprop( menu, MPROP_EXIT, MEXIT_NEVER ); 
 menu_display( id, menu, 0 )
 return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE
}
public WeaponsHandle1( id, menu, item )
{
if( item == MENU_EXIT )
{
 menu_destroy( menu )
 return PLUGIN_HANDLED
}
new szData[ 6 ], szName[ 64 ], iAccess, iCallback, szWeapon[ 33 ][ 32 ], szPrint[ 33 ][ 32 ]
menu_item_getinfo( menu, item, iAccess, szData, 5, szName, 63, iCallback )
new key = str_to_num( szData )
switch( key )
{
 case 1: 
 {
  szWeapon[ id ] = "weapon_AK47"
  szWeapon[ id ] = "weapon_glock18"
  szPrint[ id ] = "AK47 & Glock"
 }
 case 2:
 {
  szWeapon[ id ] = "weapon_xm1014"
  szWeapon[ id ] = "weapon_deagle"
  szPrint[ id ] = "XM1014 & Deagle"
 }
 case 3:
 {
  szWeapon[ id ] = "weapon_galil"
  szWeapon[ id ] = "weapon_fiveseven"
  szPrint[ id ] = "Galil & Fiveseven"
 }
 case 4:
 {
  szWeapon[ id ] = "weapon_ump45"
  szWeapon[ id ] = "weapon_elite"
  szPrint[ id ] = "UMP45 & Dualies"
 }
 case 5:
 {
  szWeapon[ id ] = "weapon_awp"
  szWeapon[ id ] = "weapon_usp"
  szPrint[ id ] = "AWP & Usp"
 }
 case 6:
 {
  szWeapon[ id ] = "weapon_m249"
  szWeapon[ id ] = "weapon_p228"
  szPrint[ id ] = "Para & P228"
 }
 
 strip_user_weapons( id )
 give_item( id, szWeapon[ id ] )
 client_print( id, print_chat, "You now have %s", szPrint )
 
 menu_destroy( menu )
 return PLUGIN_HANDLED;
}  
public bblocked(id)
{
 show_motd(id,GREEN, "%L", id, "%s Buy and Buy Bind's are Blocked.", szPrefix);
 return PLUGIN_HANDLED
}
I want weaponshandle1 and menuweapons1 to be for Terrorist only, and WeaponsHandle and menuweapons to be for CT only. Please help, sorry for bad english.
Milano 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 22:36.


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