Raised This Month: $ Target: $400
 0% 

Help with Code ..


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
EpicFail.
Senior Member
Join Date: May 2010
Old 08-24-2010 , 20:23   Re: Help with Code ..
Reply With Quote #9

This maybe ?

PHP Code:
public health_handleridhmenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroyhmenu );
        
CmdMainMenuid );
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfohmenuitemaccessdata5iName63callback );
    
    new 
picked str_to_numdata );
    new 
iMoney cs_get_user_moneyid );
    
    switch( 
picked )
    {
             case 
1:
        {
            if( 
iMoney >= HEALTH25_COST )
            {
                if( 
is_user_aliveid ) )
                {
                    if( !
g_bHas25HP[id] )
                    {
                        
cs_set_user_moneyidiMoney HEALTH25_COST );
                    
                        new 
health get_user_healthid ) + 25;
                        
set_user_healthidhealth );
                        
g_bHas25HP[id] = true;
                    
                        
client_cmdid"spk items/medshot4" );
                    }
                    else
                    {
                        
ChatColor0"%s You already bought this item!"CLAN_TAG );
                        return 
PLUGIN_HANDLED;
                    }
                }
                else
                {
                    
ChatColor0"%s You must be alive to use the shop!"CLAN_TAG );
                    return 
PLUGIN_HANDLED;
                }
            }
            else
            {
                
ChatColor0"%s You don't have enough money for this!"CLAN_TAG );
                return 
PLUGIN_HANDLED;
            }
        }
        case 
2:
        {
            if( 
iMoney >= HEALTH50_COST )
            {
                if( 
is_user_aliveid ) )
                {
                    if( !
g_bHas25HP[id] )
                    {
                        
cs_set_user_moneyidiMoney HEALTH50_COST );
                    
                        new 
health get_user_healthid ) + 50;
                        
set_user_healthidhealth );
                        
g_bHas25HP[id] = true;
                    
                        
client_cmdid"spk items/medshot4" );
                    }
                    else
                    {
                        
ChatColor0"%s You already bought this item!"CLAN_TAG );
                        return 
PLUGIN_HANDLED;
                    }
                }
                else
                {
                    
ChatColor0"%s You must be alive to use the shop!"CLAN_TAG );
                    return 
PLUGIN_HANDLED;
                }
            }
            else
            {
                
ChatColor0"%s You don't have enough money for this!"CLAN_TAG );
                return 
PLUGIN_HANDLED;
            }
        }

         }        
    
    
menu_destroyhmenu );
    
CmdMainMenuid );
    return 
PLUGIN_HANDLED;

EpicFail. is offline
 



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 21:50.


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