Raised This Month: $ Target: $400
 0% 

[PROBLEM SOLVED] Need help fixing this code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
MetalSkater92
Member
Join Date: Mar 2013
Old 03-13-2013 , 00:24   [PROBLEM SOLVED] Need help fixing this code
Reply With Quote #1

So I am making this plugin, and I get strange compiler errors shown below:


PHP Code:
//amxmodx\scripting\buy2.sma<84> : error 017: undefined symbol "give item"
//amxmodx\scripting\buy2.sma<105> : error 017: undefined symbol "give item"
//amxmodx\scripting\buy2.sma<126> : error 017: undefined symbol "give item"
//amxmodx\scripting\buy2.sma<178> : error 017: undefined symbol "give item"
//amxmodx\scripting\buy2.sma<199> : error 017: undefined symbol "give item"
//amxmodx\scripting\buy2.sma<220> : error 017: undefined symbol "give item" 

Here is the plugin code:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#define PLUGIN "Black Market Plugin"
#define VERSION "1.0"
#define AUTHOR "Nemesis"



public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
register_clcmd"say /buy2""CTorT" );
}
public 
CTorT()
{
 new 
iPlayers[32]
 new 
iNum
 
new id
 
 get_players
iPlayersiNum"a" )
 
 for( new 
0iNumi++ )
 {
  
id iPlayers[i]
  
  if (
cs_get_user_team(id) == CS_TEAM_CT)
  {
   
CT(id)
  } 
  else if (
cs_get_user_team(id) == CS_TEAM_T)
  {
   
T(id)
  }
  
 }
}
public 
T(id)
{
 new 
menu menu_create("\yBloodStorm Warfare Black Market""menu_handlerT");
 
 
menu_additem(menu"\wM4A1 [3100$]""1"0);
 
menu_additem(menu"\wFamas [2250$]""2"0);
 
menu_additem(menu"\wAUG [3500$]""3"0);
 
 
menu_setprop(menuMPROP_EXITMEXIT_ALL);
 
menu_display(idmenu0)
}
public 
menu_handlerT(idmenuitement)
{
 if( 
item == MENU_EXIT )
 {
  return;
 }
 
 new 
data[6], iName[64];
 new 
accesscallback;
 
 
menu_item_getinfo(menuitemaccessdata,5iName63callback);
 
menu_destroy(menu);
 
 new 
key str_to_num(data);
 
 switch(
key)
 {
  case 
1
  {
   
   if (!(
is_user_alive(id)))
   {
    
client_print(idprint_chat"You must be alive to buy this!")
   }
   if (!(
cs_get_user_money(id) >= 3100))
   {
    
client_print(idprint_chat"You can't afford this weapon!")
   }
   if (
get_user_weapon(id) == CSW_M4A1)
   {
    
client_print(idprint_chat"You already own this weapon!")
   }
   
   
client_print(idprint_chat"You bought a M4A1.")
   
cs_set_user_money(idcs_get_user_money(id)  - 3100)
   
give_item(id"weapon_m4a1"
   
cs_set_user_bpammoidCSW_M4A190 )
  }
  case 
2:
  {
   
   if (!(
is_user_alive(id)))
   {
    
client_print(idprint_chat"You must be alive to buy this!")
   }
   if (!(
cs_get_user_money(id) >= 2250))
   {
    
client_print(idprint_chat"You can't afford this weapon!")
   }
   if (
get_user_weapon(id) == CSW_FAMAS)
   {
    
client_print(idprint_chat"You already own this weapon!")
   }
   
   
client_print(idprint_chat"You bought a Famas")
   
cs_set_user_money(idcs_get_user_money(id)  - 2250)
   
give_item(id"weapon_famas"
   
cs_set_user_bpammoidCSW_FAMAS90 )
  }
  case 
3:
  {
   
   if (!(
is_user_alive(id)))
   {
    
client_print(idprint_chat"You must be alive to buy this!")
   }
   if (!(
cs_get_user_money(id) >= 3500))
   {
    
client_print(idprint_chat"You can't afford this weapon!")
   }
   if (
get_user_weapon(id) == CSW_AUG)
   {
    
client_print(idprint_chat"You already own this weapon!")
   }
   
   
client_print(idprint_chat"You bought a AUG")
   
cs_set_user_money(idcs_get_user_money(id)  - 3500)
   
give_item(id"weapon_aug"
   
cs_set_user_bpammoidCSW_AUG90 )
  }
 }
}

public 
CT(id)
{
 new 
menu menu_create("\yBloodStorm Warfare Black Market""menu_handlerCT");
 
 
menu_additem(menu"\wAK-47 [2500$]""1"0);
 
menu_additem(menu"\wGalil [2000$]""2"0);
 
menu_additem(menu"\wKrieg 552 [4200$]""3"0);
 
 
menu_setprop(menuMPROP_EXITMEXIT_ALL);
 
menu_display(idmenu0)
}
public 
menu_handlerCT(idmenuitement)
{
 if( 
item == MENU_EXIT )
 {
  return;
 }
 
 new 
data[6], iName[64];
 new 
accesscallback;
 
 
menu_item_getinfo(menuitemaccessdata,5iName63callback);
 
menu_destroy(menu);
 
 new 
key str_to_num(data);
 
 switch(
key)
 {
  case 
1
  {
   
   if (!(
is_user_alive(id)))
   {
    
client_print(idprint_chat"You have to be alive to buy this!")
   }
   if (!(
cs_get_user_money(id) >= 2500))
   {
    
client_print(idprint_chat"You can't afford this weapon!")
   }
   if (
get_user_weapon(id) == CSW_AK47)
   {
    
client_print(idprint_chat"You already own this weapon!")
   }
   
   
client_print(idprint_chat"You bough a AK-47")
   
cs_set_user_money(idcs_get_user_money(id)  - 2500)
   
give_item(id"weapon_ak47"
   
cs_set_user_bpammoidCSW_AK4790 )
  }
  case 
2:
  {
   
   if (!(
is_user_alive(id)))
   {
    
client_print(idprint_chat"You have to be alive to buy this!")
   }
   if (!(
cs_get_user_money(id) >= 2000))
   {
    
client_print(idprint_chat"You can't afford this weapon!")
   }
   if (
get_user_weapon(id) == CSW_GALIL)
   {
    
client_print(idprint_chat"You already own this weapon!")
   }
   
   
client_print(idprint_chat"You bough a Galil.")
   
cs_set_user_money(idcs_get_user_money(id)  - 2000)
   
give_item(id"weapon_galil"
   
cs_set_user_bpammoidCSW_GALIL90 )
  }
  case 
3:
  {
   
   if (!(
is_user_alive(id)))
   {
    
client_print(idprint_chat"You have to be alive to buy this!")
   }
   if (!(
cs_get_user_money(id) >= 4200))
   {
    
client_print(idprint_chat"You can't afford this weapon!")
   }
   if (
get_user_weapon(id) == CSW_SG550)
   {
    
client_print(idprint_chat"You already own this weapon!")
   }
   
   
client_print(idprint_chat"You bough a Krieg 550.")
   
cs_set_user_money(idcs_get_user_money(id)  - 4200)
   
give_item(id"weapon_sg552"
   
cs_set_user_bpammoidCSW_SG55090 )
  }
 }

Any help on this will be appreciated, quite frankly, I can't see what went wrong here. :S

Last edited by MetalSkater92; 03-13-2013 at 01:43. Reason: Problem was fixed
MetalSkater92 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 21:42.


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