|
Senior Member
|

07-28-2008
, 10:47
Compile errors - not again! :(
|
#1
|
I don't know why this doesn't compile, the errors make no sense to me.. 
Here's the plugin:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define PLUGIN "CS Shop"
#define VERSION "1.1"
#define AUTHOR "PvtSmithFSSF"
new Pcvar[27]
new money
new shopmenu, tgunmenu, ctgunmenu, hpmenu, invismenu, gravmenu;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /shop", "shopmenudisplay")
register_clcmd("say_team /shop", "shopmenudisplay")
money = cs_get_user_money(id)
Pcvar[0] = register_cvar("amx_200grav", "8000");
Pcvar[1] = register_cvar("amx_300grav", "6000");
Pcvar[2] = register_cvar("amx_400grav", "4000");
Pcvar[3] = register_cvar("amx_500grav", "3000");
Pcvar[4] = register_cvar("amx_lowinvis", "4000");
Pcvar[5] = register_cvar("amx_normalinvis", "7000");
Pcvar[6] = register_cvar("amx_highinvis", "10000");
Pcvar[7] = register_cvar("amx_15hp", "4000");
Pcvar[8] = register_cvar("amx_30hp", "6000");
Pcvar[9] = register_cvar("amx_50hp", "8000");
Pcvar[10] = register_cvar("amx_70hp", "10000");
Pcvar[11] = register_cvar("amx_90hp", "12000");
Pcvar[12] = register_cvar("amx_m4a1", "5000");
Pcvar[13] = register_cvar("amx_tmp", "1000");
Pcvar[14] = register_cvar("amx_fiveseven", "2000");
Pcvar[15] = register_cvar("amx_bullpup", "4000");
Pcvar[16] = register_cvar("amx_ctauto", "8000");
Pcvar[16] = register_cvar("amx_ak47", "5000");
Pcvar[17] = register_cvar("amx_mac10", "1000");
Pcvar[18] = register_cvar("amx_elites", "2000");
Pcvar[19] = register_cvar("amx_kreig", "4000");
Pcvar[20] = register_cvar("amx_tauto", "8000");
Pcvar[21] = register_cvar("amx_shop", "1");
Pcvar[22] = register_cvar("amx_tguns", "1");
Pcvar[23] = register_cvar("amx_ctguns", "1");
Pcvar[24] = register_cvar("amx_grav", "1");
Pcvar[25] = register_cvar("amx_health", "1");
Pcvar[26] = register_cvar("amx_invis", "1");
}
public plugin_cfg()
{
shopmenu = menu_create("\rCS Shop Menu", "shopmenu_handler")
menu_additem(shopmenu, "Health", "1", 0)
menu_additem(shopmenu, "Invisibility", "2", 0)
menu_additem(shopmenu, "Gravity", "3", 0)
menu_additem(shopmenu, "CT Guns", "4", 0)
menu_additem(shopmenu, "Terrorist Guns", "5", 0)
menu_setprop(shopmenu, MPROP_EXIT, MEXIT_ALL)
tgunmenu = menu_create("\rTerrorist Guns", "tgunmenu_handler")
menu_additem(tgunmenu, "Ak-47", "1", 0)
menu_additem(tgunmenu, "Mac10", "2", 0)
menu_additem(tgunmenu, "Elites", "3", 0)
menu_additem(tgunmenu, "Kreig", "4", 0)
menu_additem(tgunmenu, "Kreig Autosniper", "5", 0)
ctgunmenu = menu_create("\rCT Guns", "ctgunmenu_handler")
menu_additem(ctgunmenu, "M4a1", "1", 0)
menu_additem(ctgunmenu, "TMP", "2", 0)
menu_additem(ctgunmenu, "Fiveseven", "3", 0)
menu_additem(ctgunmenu, "Bullpup", "4", 0)
menu_additem(ctgunmenu, "CT Autosniper", "5", 0)
hpmenu = menu_create("\rHealth Menu", "hpmenu_handler")
menu_additem(hpmenu, "+15 Health", "1", 0)
menu_additem(hpmenu, "+30 Health", "2", 0)
menu_additem(hpmenu, "+50 Health", "3", 0)
menu_additem(hpmenu, "+70 Health", "4", 0)
menu_additem(hpmenu, "+90 Health", "5", 0)
invismenu = menu_create("\rInvisibility Menu", "invismenu_handler")
menu_additem(invismenu, "Low Invis", "1", 0)
menu_additem(invismenu, "Normal Invis", "2", 0)
menu_additem(invismenu, "High Invis", "3", 0)
gravmenu = menu_create("\rGravity Menu", "gravmenu_handler")
menu_additem(gravmenu, "200 Gravity", "1", 0)
menu_additem(gravmenu, "300 Gravity", "2", 0)
menu_additem(gravmenu, "400 Gravity", "3", 0)
menu_additem(gravmenu, "500 Gravity", "4", 0)
}
public dropcurweapon(id)
{
engclient_cmd(id, "drop", "weapon_shield")
engclient_cmd(id, "drop", "weapon_m3")
engclient_cmd(id, "drop", "weapon_xm1014")
engclient_cmd(id, "drop", "weapon_mp5navy")
engclient_cmd(id, "drop", "weapon_p90")
engclient_cmd(id, "drop", "weapon_mac10")
engclient_cmd(id, "drop", "weapon_tmp")
engclient_cmd(id, "drop", "weapon_ump45")
engclient_cmd(id, "drop", "weapon_galil")
engclient_cmd(id, "drop", "weapon_famas")
engclient_cmd(id, "drop", "weapon_m4a1")
engclient_cmd(id, "drop", "weapon_aug")
engclient_cmd(id, "drop", "weapon_ak47")
engclient_cmd(id, "drop", "weapon_sg552")
engclient_cmd(id, "drop", "weapon_scout")
engclient_cmd(id, "drop", "weapon_awp")
engclient_cmd(id, "drop", "weapon_sg550")
engclient_cmd(id, "drop", "weapon_g3sg1")
engclient_cmd(id, "drop", "weapon_m249")
}
public dropsecweapon(id)
{
engclient_cmd(id, "drop", "weapon_elite")
engclient_cmd(id, "drop", "weapon_fiveseven")
engclient_cmd(id, "drop", "weapon_usp")
engclient_cmd(id, "drop", "weapon_glock18")
engclient_cmd(id, "drop", "weapon_deagle")
engclient_cmd(id, "drop", "weapon_p90")
}
public shopmenudisplay(id)
{
if (get_pcvar_num(Pcvars[21]) == 1)
{
menu_display(id, shopmenu, 0)
}
}
public shopmenu_handler(id, shopmenu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(shopmenu)
return PLUGIN_HANDLED
}
new data[6], iName[64]
new access, callback
menu_item_getinfo(shopmenu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch (key)
{
case 1:
{
if (get_pcvar_num(Pcvars[25]) == 1)
{
menu_display(id, gravmenu, 0)
return PLUGIN_HANDLED
}
}
case 2:
{
if (get_pcvar_num(Pcvars[26]) == 1)
{
menu_display(id, gravmenu, 0)
return PLUGIN_HANDLED
}
}
case 3:
{
if (get_pcvar_num(Pcvars[24]) == 1)
{
menu_display(id, gravmenu, 0)
return PLUGIN_HANDLED
}
}
case 4:
{
if (get_pcvar_num(Pcvars[23]) == 1)
{
menu_display(id, gravmenu, 0)
return PLUGIN_HANDLED
}
}
case 5:
{
if (get_pcvar_num(Pcvars[22]) == 1)
{
menu_display(id, gravmenu, 0)
return PLUGIN_HANDLED
}
}
}
menu_destroy(shopmenu)
return PLUGIN_HANDLED
}
public tgunmenu_handler(id, tgunmenu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(tgunmenu)
return PLUGIN_HANDLED
}
new akcost = get_pcvar_num(Pcvar[16])
new mac10cost = get_pcvar_num(Pcvar[17])
new elitescost = get_pcvar_num(Pcvar[18])
new kreigcost = get_pcvar_num(Pcvar[19])
new tautocost = get_pcvar_num(Pcvar[20])
new data[6], iName[64]
new access, callback
menu_item_getinfo(tgunmenu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch (key)
{
case 1:
{
if(money < akcost)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - akcost);
client_print(id, print_chat,"[CS Shop] Have fun with your Ak-47")
dropcurweapon(id)
give_item(id,"weapon_ak47");
give_item(id, "ammo_762nato");
give_item(id, "ammo_762nato");
give_item(id, "ammo_762nato");
}
}
case 2:
{
if(money < mac10cost)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - mac10cost);
client_print(id, print_chat,"[CS Shop] Have fun with your Mac10")
dropcurweapon(id)
give_item(id,"weapon_mac10");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
}
}
case 3:
{
if(money < elitescost)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - elitescost);
client_print(id, print_chat,"[CS Shop] Have fun with your Elites")
dropsecweapon(id)
give_item(id,"weapon_elite");
give_item(id, "ammo_9mm");
give_item(id, "ammo_9mm");
give_item(id, "ammo_9mm");
}
}
case 4:
{
if(money < kreigcost)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - kreigcost);
client_print(id, print_chat,"[CS Shop] Have fun with your Kreig")
dropcurweapon(id)
give_item(id,"weapon_sg552");
give_item(id, "ammo_556nado");
give_item(id, "ammo_556nado");
give_item(id, "ammo_556nado");
}
}
case 5:
{
if(money < tautocost)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - tautocost);
client_print(id, print_chat,"[CS Shop] Have fun with your Auto Sniper")
dropcurweapon(id)
give_item(id,"weapon_g3sg1");
give_item(id, "ammo_762nado");
give_item(id, "ammo_762nado");
give_item(id, "ammo_762nado");
}
}
}
menu_destroy(tgunmenu)
return PLUGIN_HANDLED
}
public ctgunmenu_handler(id, ctgunmenu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(ctgunmenu)
return PLUGIN_HANDLED
}
new m4cost = get_pcvar_num(Pcvar[12])
new tmpcost = get_pcvar_num(Pcvar[13])
new fivesevencost = get_pcvar_num(Pcvar[14])
new bullpupcost = get_pcvar_num(Pcvar[15])
new ctautocost = get_pcvar_num(Pcvar[16])
new data[6], iName[64]
new access, callback
menu_item_getinfo(ctgunmenu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch (key)
{
case 1:
{
if(money < m4cost)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - m4cost);
client_print(id, print_chat,"[CS Shop] Have fun with your M4a1")
dropcurweapon(id)
give_item(id,"weapon_m4a1");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
give_item(id, "ammo_556nato");
}
}
case 2:
{
if(money < tmpcost)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - tmpcost);
client_print(id, print_chat,"[CS Shop] Have fun with your TMP")
dropcurweapon(id)
give_item(id,"weapon_tmp");
give_item(id, "ammo_9mm");
give_item(id, "ammo_9mm");
give_item(id, "ammo_9mm");
}
}
case 3:
{
if(money < fivesevencost)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - fivesevencost);
client_print(id, print_chat,"[CS Shop] Have fun with your five-seven")
dropsecweapon(id)
give_item(id,"weapon_fiveseven");
give_item(id, "ammo_57mm");
give_item(id, "ammo_57mm");
give_item(id, "ammo_57mm");
}
}
case 4:
{
if(money < bullpupcost)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - bullpupcost);
client_print(id, print_chat,"[CS Shop] Have fun with your Bullpup")
dropcurweapon(id)
give_item(id,"weapon_aug");
give_item(id, "ammo_556nado");
give_item(id, "ammo_556nado");
give_item(id, "ammo_556nado");
}
}
case 5:
{
if(money < ctautocost)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - tautocost);
client_print(id, print_chat,"[CS Shop] Have fun with your Auto Sniper")
dropcurweapon(id)
give_item(id,"weapon_g3sg1");
give_item(id, "ammo_762nado");
give_item(id, "ammo_762nado");
give_item(id, "ammo_762nado");
}
}
}
menu_destroy(ctgunmenu)
return PLUGIN_HANDLED
}
public hpmenu_handler(id, hpmenu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(hpmenu)
return PLUGIN_HANDLED
}
new health = get_user_health(id)
new 15price = get_pcvar_num(Pcvar[7])
new 30price = get_pcvar_num(Pcvar[8])
new 50price = get_pcvar_num(Pcvar[9])
new 70price = get_pcvar_num(Pcvar[10])
new 90price = get_pcvar_num(Pcvar[11])
new data[6], iName[64]
new access, callback
menu_item_getinfo(hpmenu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch (key)
{
case 1:
{
if(money < 15price)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - 15price);
client_print(id, print_chat,"[CS Shop] You just purchased +15 health")
set_user_health(id, health + 15);
}
}
case 2:
{
if(money < 30price)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - 30price);
client_print(id, print_chat,"[CS Shop] You just purchased +30 health")
set_user_health(id, health + 30);
}
}
case 3:
{
if(money < 50price)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - 50price);
client_print(id, print_chat,"[CS Shop] You just purchased +50 health")
set_user_health(id, health + 50);
}
}
case 4:
{
if(money < 70price)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - 70price);
client_print(id, print_chat,"[CS Shop] You just purchased +70 health")
set_user_health(id, health + 70);
}
}
case 5:
{
if(money < 90price)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - 90price);
client_print(id, print_chat,"[CS Shop] You just purchased +90 health")
set_user_health(id, health + 90);
}
}
}
menu_destroy(hpmenu)
return PLUGIN_HANDLED
}
public invismenu_handler(id, invismenu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(invismenu)
return PLUGIN_HANDLED
}
new lowprice = get_pcvar_num(Pcvar[4])
new normprice = get_pcvar_num(Pcvar[5])
new highprice = get_pcvar_num(Pcvar[6])
new data[6], iName[64]
new access, callback
menu_item_getinfo(invismenu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch (key)
{
case 1:
{
if(money < lowprice)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - lowprice);
client_print(id, print_chat,"[CS Shop] You just purchased level 1 invisibility")
set_user_rendering(id,kRenderFxGlowShell,0,0, 0,kRenderTransAlpha, 150);
}
}
case 2:
{
if(money < normprice)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - normprice);
client_print(id, print_chat,"[CS Shop] You just purchased level 2 invisibility")
set_user_rendering(id,kRenderFxGlowShell,0,0, 0,kRenderTransAlpha, 100);
}
}
case 3:
{
if(money < highprice)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - highprice);
client_print(id, print_chat,"[CS Shop] You just purchased level 3 invisibility")
set_user_rendering(id,kRenderFxGlowShell,0,0, 0,kRenderTransAlpha, 50);
}
}
}
menu_destroy(invismenu)
return PLUGIN_HANDLED
}
public gravmenu_handler(id, gravmenu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(gravmenu)
return PLUGIN_HANDLED
}
new data[6], iName[64]
new access, callback
new 200price = get_pcvar_num(Pcvar[0])
new 300price = get_pcvar_num(Pcvar[1])
new 400price = get_pcvar_num(Pcvar[2])
new 500price = get_pcvar_num(Pcvar[3])
menu_item_getinfo(gravmenu, item, access, data,5, iName, 63, callback)
new key = str_to_num(data)
switch (key)
{
case 1:
{
if(money < 200price)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - 200price);
client_print(id, print_chat,"[CS Shop] You just purchased 200 gravity")
set_user_gravity (id,0.25);
}
}
case 2:
{
if(money < 300price)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - 300price);
client_print(id, print_chat,"[CS Shop] You just purchased 300 gravity")
set_user_gravity (id,0.38);
}
}
case 3:
{
if(money < 400price)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - 400price);
client_print(id, print_chat,"[CS Shop] You just purchased 400 gravity")
set_user_gravity (id,0.50);
}
}
case 4:
{
if(money < 500price)
{
client_print(id, print_chat,"[CS Shop] You don't have enough money")
}
else
{
cs_set_user_money(id, money - 500price);
client_print(id, print_chat,"[CS Shop] You just purchased 500 gravity")
set_user_gravity (id,0.63);
}
}
}
menu_destroy(gravmenu)
return PLUGIN_HANDLED
}
Errors:
Code:
/home/groups/amxmodx/tmp3/phpTbCBZd.sma(22) : error 017: undefined symbol "msg_time"
/home/groups/amxmodx/tmp3/phpTbCBZd.sma(45) : error 017: undefined symbol "TASK_ID"
/home/groups/amxmodx/tmp3/phpTbCBZd.sma(54) : error 017: undefined symbol "TASK_ID"
/home/groups/amxmodx/tmp3/phpTbCBZd.sma(59) : error 017: undefined symbol "TASK_ID"
/home/groups/amxmodx/tmp3/phpTbCBZd.sma(96) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/phpTbCBZd.sma(96) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/phpTbCBZd.sma(96) : error 017: undefined symbol "menu_handler"
/home/groups/amxmodx/tmp3/phpTbCBZd.sma(96) : error 017: undefined symbol "item"
/home/groups/amxmodx/tmp3/phpTbCBZd.sma(96) : fatal error 107: too many error messages on one line
Compilation aborted.
8 Errors.
Sorry for the noobiness!
I'm thinking I should rewrite this from scratch, maybe with fakemeta.
Last edited by PvtSmithFSSF; 07-28-2008 at 14:50.
|
|