Raised This Month: $ Target: $400
 0% 

How to make it simpler?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Gasior
Member
Join Date: Mar 2012
Old 08-13-2013 , 04:31   How to make it simpler?
Reply With Quote #1

I have /funshop and I want ADMIN_FLAG_X to have a price off, I know how to do this but I'm sure it can be simpler.
PHP Code:
         case 4:
         {
         
                new 
usermoney cs_get_user_money(id)
        if(
get_user_flags(id) & ADMIN_FLAG_X) {
            if(
usermoney 4900 ){
                
ColorChat(id,RED,"^3 [FNUSHOP] ^4 Nie stac Cie na to."0
                return 
PLUGIN_HANDLED
                
}
            else {
                if(
get_user_health(id) > 150){
                
ColorChat(id,RED,"^3 [FUNSHOP] ^4 Juz zakupiles ta usluge. "0)
                return 
PLUGIN_HANDLED
                
}
                else{
                    
set_user_health(id, (get_user_health(id) + 100))
                    
cs_set_user_money(idcs_get_user_money(id) - 4900)
                    
ColorChat(id,RED,"^3 [FUNSHOP] ^4 Zakupiles ^3 100 HP ^4!"0
                    return 
PLUGIN_HANDLED
                    
}
                }
            }
        else {
            if(
usermoney 7000 ){
                
ColorChat(id,RED,"^3 [FNUSHOP] ^4 Nie stac Cie na to."0
                return 
PLUGIN_HANDLED
            
}
            else {
                if(
get_user_health(id) > 150){
                
ColorChat(id,RED,"^3 [FUNSHOP] ^4 Juz zakupiles ta usluge. "0)
                return 
PLUGIN_HANDLED
                
}
                else{
                    
set_user_health(id, (get_user_health(id) + 100))
                    
cs_set_user_money(idcs_get_user_money(id) - 7000)
                    
ColorChat(id,RED,"^3 [FUNSHOP] ^4 Zakupiles ^3 100 HP ^4!"0
                    return 
PLUGIN_HANDLED
                    
}
                }
            }
    } 
Is there a way to put (get_user_flags(id) & ADMIN_FLAG_X) into cs_set_user_money(id, cs_get_user_money(id) - 7000) ? It would make my life so much easier.
Gasior 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 15:54.


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