Raised This Month: $51 Target: $400
 12% 

Solved Making item gray (disabled)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nG_getwreck
Senior Member
Join Date: Oct 2020
Location: Philippines from South K
Old 02-08-2021 , 22:57   Making item gray (disabled)
Reply With Quote #1

Hello, how can I make this item gray, I mean it will turn to gray if the player reached the limit.

it's like ZP_ITEM_NOT_AVAILABLE.

How can I do it?

Code:
PHP Code:
else if(key == 4)
    {
        if(
limit_frostm4[id] >= 2)
        {
            
limit_frostm4[id]++
            
client_printcolored(id"!g[=SG=] !nYou've reached the limit !t[2/2]")
        }
        else if(
zp_ammopacks_get(id) >= 25)
        {
            
ze_give_frostm4(id)
            
zp_ammopacks_set(idzp_ammopacks_get(id) - 25)
        }
        else
        {
            
client_printcolored(id"!g[=SG=] !nYou don't have enough !gAmmoPacks to buy !tFrost M4A1")
        }
    } 
__________________

Last edited by nG_getwreck; 02-09-2021 at 05:42.
nG_getwreck is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 02-08-2021 , 23:07   Re: Making item gray (disabled)
Reply With Quote #2

Not enough code to work with (serious)
__________________
My plugin:
Celena Luna is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-09-2021 , 00:55   Re: Making item gray (disabled)
Reply With Quote #3

What is the context of this request? What text is needing to be set as grey? Please provide enough context/code to know what you are talking about.

If you're referencing menu items, you should use callbacks and return ITEM_DISABLED in the callback function.

If you're talking about client_printcolored() then look at the function definition and see if grey is a supported color.
__________________
fysiks is offline
nG_getwreck
Senior Member
Join Date: Oct 2020
Location: Philippines from South K
Old 02-09-2021 , 05:42   Re: Making item gray (disabled)
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
What is the context of this request? What text is needing to be set as grey? Please provide enough context/code to know what you are talking about.

If you're referencing menu items, you should use callbacks and return ITEM_DISABLED in the callback function.

If you're talking about client_printcolored() then look at the function definition and see if grey is a supported color.
I'm referring to menu call back, thanks for that. Problem solved.
__________________
nG_getwreck is offline
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 16:46.


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