Raised This Month: $ Target: $400
 0% 

Menu problem


Post New Thread Reply   
 
Thread Tools Display Modes
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
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 03-31-2009 , 16:58   Re: Code is compiling but plugin doesn't works
Reply With Quote #2

this is the problem
PHP Code:
formatex(yes199"Yes")
menu_additem(menuyes"1")
    
formatex(no199"No")
menu_additem(menuno"2"
look at this

https://forums.alliedmods.net/showth...6364#BasicMenu
__________________
alan_el_more is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-31-2009 , 17:03   Re: Code is compiling but plugin doesn't works
Reply With Quote #3

i think its better when u add a new if.
if(get_user_health < 99)

there are many idiots that copies all things what another player says..

for example i need just to write /rank in my server... all player says /rank

or i say /sex u must just see howmuch players says this.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Reply



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