Raised This Month: $ Target: $400
 0% 

Max Usage Of A Item In Shop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Crackhead69
Member
Join Date: Feb 2021
Old 03-25-2021 , 06:35   Re: Max Usage Of A Item In Shop
Reply With Quote #6

That's just one way of doing it
PHP Code:
#include <amxmodx>

new ItemUsed // its purpose is Global
new ItemId[33// its purpose is to hold the items

public plugin_init()    
    
register_clcmd"say /menu","AwesomeMenu" );

public 
AwesomeMenuid )
{
    new 
menu menu_create"Look at this awesome Menu!:""menu_handler" );

    
menu_additemmenu"I'm Selection #1""");
    
menu_additemmenu"I'm Selection #2""");

    
menu_setpropmenuMPROP_EXITMEXIT_ALL );

    
menu_displayidmenu);

}

public 
menu_handleridmenuitem )
{
    if(
ItemId[item] == ItemUsed//if the selected item equals 5 (gItemUsed) we return
    
{
        
client_print(id,print_chat,"Limit reached")
        return
    }
    
    
ItemId[item]++ //we increase the picked item's number by 1

    
switch(item)
    {
        case 
0:client_printidprint_chat"Item 1 can be used: %i/%i times"ItemId[item],ItemUsed)
        case 
1:client_printidprint_chat"Item 2 can be used: %i/%i times"ItemId[item],ItemUsed)
    }

Crackhead69 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 23:47.


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