Raised This Month: $ Target: $400
 0% 

Menu problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Emilioneri
Senior Member
Join Date: Feb 2009
Location: Georgia, Tbilisi
Old 03-31-2009 , 16:52   Menu problem
Reply With Quote #1

I tried to edit my "Heal for Money" plugin, but the plugin doesn't works. whats wrong?
Code:
/* Plugin generated by Emilioneri */ #include <amxmodx> #include <cstrike> #include <fun> #define PLUGIN "Heal for money" #define VERSION "1.1" #define AUTHOR "Emilioneri" new g_Cost new yes[200] new no[200] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         g_Cost = register_cvar("amx_healcost", "7000")         register_clcmd("say /buyheal", "cmd_buyheal") } public cmd_buyheal(id) {     new menu = menu_create("\rDo you want to restore your health ??", "heal_menu")         formatex(yes, 199, "Yes")     menu_additem(menu, yes, "1")         formatex(no, 199, "No")     menu_additem(menu, no, "2")         menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)     menu_display(id, menu, 0) } public heal_menu(id, menu, item) {     if (item == MENU_EXIT)     {         menu_destroy(menu)         return PLUGIN_HANDLED     }         new Data[6];     new Access;     new Name[64];     new Callback;         new Key = str_to_num(Data);     menu_item_getinfo(menu, item, Access, Data, 5, Name, 63, Callback)         switch (Key)     {         case 1:         {             if ( !is_user_alive (id) )             {                 client_print(id, print_chat, "You can't buy health cuz you are dead!")                 return PLUGIN_HANDLED             }                 new iMoney = cs_get_user_money(id)             new iCost = get_pcvar_num(g_Cost)                         if(iMoney >= iCost)             {                 set_user_health(id, 100)                         cs_set_user_money(id, iMoney - iCost)                         client_print(id, print_chat, "Your health have been restored for $%i", iCost)                 return PLUGIN_HANDLED             }                 else             {                 client_print(id, print_chat, "You don't have enaugh money! $%i needed!", iCost)             }                 return PLUGIN_HANDLED         }                 case 2:         {             menu_destroy(menu)             return PLUGIN_HANDLED         }     }     return PLUGIN_HANDLED }

Last edited by Emilioneri; 04-01-2009 at 07:36.
Emilioneri is offline
Send a message via Skype™ to Emilioneri
 



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 02:17.


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