Thread: [Solved] Limit
View Single Post
Author Message
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 12-09-2020 , 18:24   Limit
Reply With Quote #1

Hi i like this menu can use:
Quote:
1.item1 can use 2 time in round
2.item2 can use 3time in round
Code:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>

#define PLUGIN " Shop"
#define VERSION "1.0"
#define AUTHOR "mmd" 

#define ADMIN_JBVIP ADMIN_LEVEL_F

new const PREFIX[] = { "!g[!tShop!g]!n" };

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd("say /shop""Vipshop");
}

public 
Vipshop(id)
{
    if(!(
get_user_flags(id) & ADMIN_JBVIP))
    {
        
client_printc(id"!tYou dont Have access")
        
        return 
PLUGIN_HANDLED;
    }
    if( !
is_user_aliveid ) )
    {
        
client_printcid"!gYou must be alive to Use Shop.");
        return 
PLUGIN_HANDLED;
    }
    new 
text100 ]
    new 
iMoney cs_get_user_money(id)
         
formatextextcharsmaxtext ), "\rSuper Vip Shop \w| \d[\wYoure Money: \y%i \y$\d]^n\d[Coded By Heisenberg] \rPage:"iMoney )

         new 
menu menu_createtext"shop_handler" )

    
menu_additem(menu"\w100 Hp \d[\r1000 \y$\d]""1"cs_get_user_money(id) >= 1000 1<<31);
    
menu_additem(menu"\w100 Armor \d[\r1000 \y$\d]""2"cs_get_user_money(id) >= 1000 1<<31);
    
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

public 
shop_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    new 
name[33]
         
get_user_name(idname32)
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);

    new 
key str_to_num(data);

    switch(
key)
    {
        case 
1:
        {
            
cs_set_user_money(idcs_get_user_money(id) - 1000);
            
set_user_health(idget_user_health(id) + 100);
        }
        case 
2:
        {
            
cs_set_user_money(idcs_get_user_money(id) - 1000);            
            
set_user_armor(idget_user_armor(id) + 100);
            
        }    
    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

// Colour Chat
stock client_printc(const id, const input[], any:...)
{
    new 
count 1players[32];
    static 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190"!g""^x04"); // Green Color
    
replace_all(msg190"!n""^x01"); // Default Color
    
replace_all(msg190"!t""^x03"); // Team Color
    
    
if (idplayers[0] = id; else get_players(playerscount"ch");
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1065\\ f0\\ fs16 \n\\ par }
*/ 
Thanks.

Last edited by ho83; 12-10-2020 at 09:17.
ho83 is offline