Code:
//right now this is just basically a copy/paste job of one of the exapmles
//in the amxmodx documentation.
//i've been adding to it, but the stuff i'm adding is like mashing a square
//block into a circular hole, cuz i have NO idea what i'm doing anymore.
//I need to find an absolute newb guide, not have somebody fix all my
//problems for me as i come across them.
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
new PLUGIN[]="Extra Buy Menu"
new AUTHOR[]="SuperMechaCow"
new VERSION[]="0.1"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4
register_menucmd(register_menuid("Extra Buy Menu"), keys, "giveWeapon")
register_clcmd("extrabuymenu", "showExtraMenu")
}
public showExtraMenu(id)
{
new menu[192]
new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4
format(menu, 191, "\yExtra Buy Menu^n^n\w1. AK47\R3750^n2. M4A1\R4650^n3. AWP\R7125^n4. Respawn\R5000^n^n3. Exit Menu")
show_menu(id, keys, menu)
return PLUGIN_HANDLED
}
public giveWeapon(id, key)
{
new moolah = cs_get_user_money(id)
if (key == 0)
{
if (moolah >= 3750) {
new thecost = -3750;
new moolah = cs_get_user_money(id);
new pricetotal = moolah + thecost;
give_item(id, "weapon_ak47");
cs_set_user_money(id, pricetotal, 1);
} else {
client_print(id, print_chat, "[AMXX] You do not have enough money");
return PLUGIN_HANDLED;
}
} else if (key == 1) {
if (moolah >= 4650) {
new thecost = -4650;
new moolah = cs_get_user_money(id);
new pricetotal = moolah + thecost;
give_item(id, "weapon_m4a1");
cs_set_user_money(id, pricetotal, 1);
} else {
client_print(id, print_chat, "[AMXX] You do not have enough money");
return PLUGIN_HANDLED;
}
} else if (key == 2) {
if (moolah >= 7125) {
new thecost = -7125;
new moolah = cs_get_user_money(id);
new pricetotal = moolah + thecost
give_item(id, "weapon_awp");
cs_set_user_money(id, pricetotal, 1);
} else {
client_print(id, print_chat, "[AMXX] You do not have enough money");
return PLUGIN_HANDLED;
}
} else if (key == 3) {
if (moolah >= 5000) {
new thecost = -5000;
new moolah = cs_get_user_money(id);
new pricetotal = moolah + thecost;
spawn(id);
cs_set_user_money(id, pricetotal, 1);
} else {
client_print(id, print_chat, "[AMXX] You do not have enough money");
return PLUGIN_HANDLED;
}
} else if (key == 4) {
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
Nothing happens when I press keys 3, 4, 5 except the menu disappears. i don't think it's running the functions there at all.