Raised This Month: $ Target: $400
 0% 

absolute nub and menu formatting


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SuperMechaCow
Junior Member
Join Date: May 2005
Location: At my computer
Old 06-11-2005 , 18:19  
Reply With Quote #8

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.
__________________
~Moo
SuperMechaCow is offline
Send a message via AIM to SuperMechaCow Send a message via MSN to SuperMechaCow Send a message via Yahoo to SuperMechaCow
 



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 16:42.


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