Raised This Month: $ Target: $400
 0% 

[REQ] Add Code to this script


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
MetalSkater92
Member
Join Date: Mar 2013
Old 01-23-2014 , 07:02   [REQ] Add Code to this script
Reply With Quote #1

So I have this Shop plugin and it's working excellent except everyone can use it instead of only my VIP's, what I like is to have someone add the ADMIN_LEVEL_H (h) flag to it so only registered vips can use the plugin. Also I have to note that the ability to buy CT/T skin function doesn't work even if you do make the buy the player skin is still a CT or T.

PHP Code:
/*
    ChangeLog:
    
    v1.0
    - First Release
    
    v1.5
    - Converted some things to fakemeta
    - Fixed some menus
    
    v2.0
    - Added more menus
    - Added more stocks
    
    v3.0
    - Fixed Menu bugs
    - Fixed Model reset
    - Added new Cvars
    - Added ML Support
    
    v3.5
    - Added cstrike module for the skins
    - Added customizable cfg with cvars
    
    v3.6   
    - Fixed rendering bug with the invisibility menu
    
    v3.7
    - Fixed some fakemeta & cstrike convertions
    
    v3.8
    - Added ML Translations

    v4.0
    - Replaced all with fakemeta and ham modules
    - Fixed a ML Bug
    - Fixed some stocks (thanks to Exolent)
        
    v4.0a
    - Added: is the user alive to open the menu ? 
    - is the plugin enabled to show the msg ?
        
    v4.0b
    - Changed: Ham_Spawn to Post hook (Thanks ConnorMcLeod)
    
    v4.2
    - Now the Fakemeta Utilities are included
    - Removed the Fakemeta Utilities stocks
    - Added one more menu (Speed menu)
    - Added more cvars
    - Updated Multi-Lingual Translations
    
    v4.5
    - The items can be disabled if you set the item cvar to 0
    - Now plugin supports Unlimited Money by Ramono
    - Huge update on the Multi-Lingual translations (sorry translators)
    
    v5.0
    - All Menus Updated using global variables to store the name-weapons-other data
    - CStrike and Fun Modules restored (efficiency > fakemeta conversions)
    
    ------------------------------------------------------------------------
    
    Cvar List:
    
    // Main Cvars
    amx_shop_enable    1/0 - Enable / Disable CS Shop (Default: 1)
    amx_shop_msg    1/0 - Enable / Disable CS Shop Message (Default: 1)
    amx_shop_prefix        - CS Shop Messages Prefix (Default: [CS Shop])
    
    // CT's Guns Menu
    amx_shop_ct    1/0 - Enable / Disable CT's Guns Menu (Default: 1)
    amx_shop_m4a1        - M4A1 Cost (Default: 3100)
    amx_shop_bullpup    - BullPup Cost (Default: 3500)
    amx_shop_tmp        - TMP Cost (Default: 1250)
    amx_shop_fiveseven  - Five Seven Cost (Default: 750)
    amx_shop_famas      - Famas Cost (Default: 2250)
    amx_shop_shield     - Shield Cost (Default: 2200)
    
    // T's Guns Menu
    amx_shop_t    1/0 - Enable / Disable T's Guns Menu (Default: 1)
    amx_shop_ak47        - Ak 47 Cost (Default: 2500)
    amx_shop_sg552        - Sg552 Cost (Default: 3500)
    amx_shop_mac10        - Mac 10 Cost (Default: 1400)
    amx_shop_elites        - Dual Elites Cost (Default: 800)
    amx_shop_galil      - Galil Cost (Default: 2000)
    
    // Invisibility Menu
    amx_shop_invis    1/0 - Enable / Disable Invisibility Menu (Default: 1)
    amx_shop_low        - Low Invisibility Cost (still visible) (Default: 3000)
    amx_shop_medium     - Medium Invisibility Cost (semiclip) (Default: 6000)
    amx_shop_high        - High Invisibility Cost (almost invisible) (Default: 12000)
        
    // Gravity Menu
    amx_shop_grav    1/0 - Enable / Disable Gravity Menu (Default: 1)
    amx_shop_g500        - 500 Gravity Cost (Default: 1500)
    amx_shop_g400       - 400 Gravity Cost (Default: 3000)
    amx_shop_g300       - 300 Gravity Cost (Default: 4500)
    amx_shop_g200       - 200 Gravity Cost (Default: 6000)
        
    // Health Menu
    amx_shop_hp    1/0 - Enable / Disable Health Menu (Default: 1)
    amx_shop_15hp        - +15 Health Cost (Default: 1500)
    amx_shop_35hp       - +35 Health Cost (Default: 3000)
    amx_shop_65hp       - +65 Health Cost (Default: 6000)
    amx_shop_95hp       - +95 Health Cost (Default: 7500)
    
    // Speed Menu
    amx_shop_speed     1/0 - Enable / Disable Speed Menu (Default: 1)
    amx_shop_260speed   - 260 MaxSpeed Cost (Default: 3000)
    amx_shop_300speed   - 300 MaxSpeed Cost (Default: 6000)
    amx_shop_340speed   - 340 MaxSpeed Cost (Default: 9000)
    amx_shop_380speed   - 380 MaxSpeed Cost (Default: 12000)
    amx_shop_420speed   - 420 MaxSpeed Cost (Default: 15000)

    // Skins Menu
    amx_shop_skins     1/0 - Enable / Disable Skins Menu (Default: 1)
    amx_shop_tskin        - Terrorist Skin Cost (Default: 9000)
    amx_shop_ctskin        - Counter-Terrorist Skin Cost (Default: 9000) 

    ---------------------------------------------------------------------
    
    Credits:
    
    PvtSmithFSSF     - Original idea, Principal Code
    VEN         - Fakemeta Utilities
    Dr. Jan Itor     - Gravity Menu help
    Minimiller     - Lot of things
    MeRcyLeZZ     - For his svc_bad and models tutorial (Tutorial Link)
    ConnorMcLeod     - Little fix with user spawn ^.^
    XxAvalanchexX     - Some code of the gungame colored print
    
    ---------------------------------------------------------------------
    
    Plugin Thread: http://forums.alliedmods.net/showthread.php?t=78224
    Licensed under the GPL - http://www.gnu.org/copyleft/gpl.html
    
    ---------------------------------------------------------------------
*/  

// Uncomment this to enable Unlimited Money support by Ramono
//#define UL_COMPAT

#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fun>

#if defined UL_COMPAT
    #include <money_ul>
#endif

/*================================================================================
 [Defines & Variables]
=================================================================================*/

// Plugin Info
#define PLUGIN_NAME "CS Shop"
#define PLUGIN_VERS "5.0"
#define PLUGIN_AUTH "iNeedHelp" // Old Name :(

// Weapons BitSum (drop stocks)
#define PRIMARY_WEAPONS_BITSUM ((1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90))

// Max Players
#define MAX_PLAYERS    32

// Compatibility with Unlimited Money
#if defined UL_COMPAT
    #define get_user_money(%1) cs_get_user_money_ul(%1)
    #define set_user_money(%1,%2) cs_set_user_money_ul(%1,%2)
#else
    #define set_user_money(%1,%2) cs_set_user_money(%1,%2)
    #define get_user_money(%1) cs_get_user_money(%1)
#endif

// Pointers
new g_pGravityCvarPointer

// Main Cvars
new g_pCvarEnable
new g_pCvarMessage
new g_pCvarPrefix

// Menu Cvars
new g_pMenuEnableCvars[7]

new 
g_pCtGunsMenuCvars[6]
new 
g_pTeGunsMenuCvars[5]

new 
g_pInvisibilityMenuCvars[3]
new 
g_pGravityMenuCvars[4]
new 
g_pHealthMenuCvars[4]
new 
g_pSpeedMenuCvars[5]
new 
g_pSkinsMenuCvars[2]

// Menu vars
new g_iHasSpeed[MAX_PLAYERS+1] = { -1, ... }            
new 
bool:g_bHasCustomModel[MAX_PLAYERS+1] = { false, ... }    

// Menus Items
new g_szMainShopMenu[][] = 
{
    
"Counter-Terrorist Menu",
    
"Terrorist Menu",
    
"Invisibility Menu",
    
"Gravity Menu",
    
"Health Menu",
    
"Speed Menu",
    
"Skins Menu"
}

new 
g_szCTGunsMenu[][] =
{
    
"M4A1",
    
"Bullpup",
    
"TMP",
    
"Five Seven",
    
"Famas",
    
"Shield"
}

new 
g_szTGunsMenu[][] =
{
    
"Ak 47",
    
"Krieg 552",
    
"Mac 10",
    
"Dual Elites",
    
"Galil"
}

new 
g_szInvisibilityMenu[][] =
{
    
"Low Invisibility",
    
"Medium Invisibility",
    
"High Invisibility"
}

new 
g_szGravityMenu[][] =
{
    
"500 Gravity",
    
"400 Gravity",
    
"300 Gravity",
    
"200 Gravity"
}

new 
g_szHealthMenu[][] = 
{
    
"+15 Health",
    
"+35 Health",
    
"+65 Health",
    
"+95 Health"
}

new 
g_szSpeedMenu[][] =
{
    
"260 Speed",
    
"300 Speed",
    
"340 Speed",
    
"380 Speed",
    
"420 Speed"
}

new 
g_szSkinsMenu[][] =
{
    
"Terrorist Skin",
    
"Counter-Terrorist Skin"
}

// Menus Data
new g_szCTGunsWeapons[][] =
{
    
"weapon_m4a1",
    
"weapon_aug",
    
"weapon_tmp",
    
"weapon_fiveseven",
    
"weapon_famas",
    
"weapon_shield"
}

new 
g_szTGunsWeapons[][] =
{
    
"weapon_ak47",
    
"weapon_sg552",
    
"weapon_mac10",
    
"weapon_elite",
    
"weapon_galil"
}

new 
g_szCTGunsAmmo[][] = { "556nato""556nato""9mm""57mm""556nato" }
new 
g_szTGunsAmmo[][] = { "762nato""556nato""45acp""9mm""556nato" }

new 
g_iCTGunsLoad[] = { 909012010090 }
new 
g_iTGunsLoad[] = { 909010012090 }

new 
g_iCTGunsMaxAmmo[] = { 909012010090 }
new 
g_iTGunsMaxAmmo[] = { 909010012090 }

new 
g_iInvisibilityLevel[] = { 15010025 }
new 
g_iHealthLevel[] = { 15356595 }

new 
Float:g_flGravityLevel[] = { 500.0400.0300.0200.0 }
new 
Float:g_flSpeedLevel[] = { 260.0300.0340.0380.0420.0 }

new 
g_szSkinsName[][] = { "urban""terror" }

// Message Hooks
new g_iMsgSayText

// Others
new const g_szShopFile[] = "shop.cfg";    // Shop file

/*================================================================================
 [Init]
=================================================================================*/

public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSPLUGIN_AUTH)
    
    
// Multi-Lingual
    
register_dictionary("shop.txt")
    
    
// Commands
    
register_clcmd("say /shop""ClCmd_Say")
    
register_clcmd("say_team /shop""ClCmd_Say")
    
    
// Ham Forwards
    
RegisterHam(Ham_Spawn"player""Fwd_PlayerSpawn_Post"1)
    
    
// FM Forwards
    
register_forward(FM_SetClientKeyValue"Fwd_SetClientKeyValue")
    
    
// Events
    
register_event("CurWeapon""Event_CurWeapon""be""1=1")
    
    
// Variables....
    
    // Messages Hooks
    
g_iMsgSayText            get_user_msgid("SayText")
    
    
// Cvars
    
g_pGravityCvarPointer        get_cvar_pointer("sv_gravity")
    
    
g_pCvarEnable             register_cvar("amx_shop_enable""1")
    
g_pCvarMessage             register_cvar("amx_shop_msg""1")
    
g_pCvarPrefix            register_cvar("amx_shop_prefix""[BloodStorm Warfare]")
    
    
g_pMenuEnableCvars[0]         = register_cvar("amx_shop_ct""1")
    
g_pCtGunsMenuCvars[0]         = register_cvar("amx_shop_m4a1""3100")
    
g_pCtGunsMenuCvars[1]         = register_cvar("amx_shop_bullpup""3500")
    
g_pCtGunsMenuCvars[2]         = register_cvar("amx_shop_tmp""1250")
    
g_pCtGunsMenuCvars[3]         = register_cvar("amx_shop_fiveseven""750")
    
g_pCtGunsMenuCvars[4]         = register_cvar("amx_shop_famas""2250")
    
g_pCtGunsMenuCvars[5]         = register_cvar("amx_shop_shield""2200")
    
    
g_pMenuEnableCvars[1]         = register_cvar("amx_shop_t""1")
    
g_pTeGunsMenuCvars[0]         = register_cvar("amx_shop_ak47""2500")
    
g_pTeGunsMenuCvars[1]         = register_cvar("amx_shop_sg552""3500")
    
g_pTeGunsMenuCvars[2]         = register_cvar("amx_shop_mac10""1400")
    
g_pTeGunsMenuCvars[3]         = register_cvar("amx_shop_elites""800")
    
g_pTeGunsMenuCvars[4]         = register_cvar("amx_shop_galil""2000")
    
    
g_pMenuEnableCvars[2]         = register_cvar("amx_shop_invis""1")
    
g_pInvisibilityMenuCvars[0]     = register_cvar("amx_shop_low""3000")
    
g_pInvisibilityMenuCvars[1]     = register_cvar("amx_shop_medium""6000")
    
g_pInvisibilityMenuCvars[2]     = register_cvar("amx_shop_high""12000")
    
    
g_pMenuEnableCvars[3]         = register_cvar("amx_shop_grav""1")
    
g_pGravityMenuCvars[0]         = register_cvar("amx_shop_g500""1500")
    
g_pGravityMenuCvars[1]         = register_cvar("amx_shop_g400""3000")
    
g_pGravityMenuCvars[2]         = register_cvar("amx_shop_g300""4500")
    
g_pGravityMenuCvars[3]         = register_cvar("amx_shop_g200""6000")
    
    
g_pMenuEnableCvars[4]         = register_cvar("amx_shop_hp""1")
    
g_pHealthMenuCvars[0]         = register_cvar("amx_shop_15hp""1500")
    
g_pHealthMenuCvars[1]         = register_cvar("amx_shop_35hp""3000")
    
g_pHealthMenuCvars[2]         = register_cvar("amx_shop_65hp""6000")
    
g_pHealthMenuCvars[3]         = register_cvar("amx_shop_95hp""7500")
        
    
g_pMenuEnableCvars[5]         = register_cvar("amx_shop_speed""1")
    
g_pSpeedMenuCvars[0]         = register_cvar("amx_shop_260speed""3000")
    
g_pSpeedMenuCvars[1]         = register_cvar("amx_shop_300speed""6000")
    
g_pSpeedMenuCvars[2]         = register_cvar("amx_shop_340speed""9000")
    
g_pSpeedMenuCvars[3]         = register_cvar("amx_shop_380speed""12000")
    
g_pSpeedMenuCvars[4]         = register_cvar("amx_shop_420speed""15000")
    
    
g_pMenuEnableCvars[6]         = register_cvar("amx_shop_skins""1")
    
g_pSkinsMenuCvars[0]         = register_cvar("amx_shop_tskin""9000")
    
g_pSkinsMenuCvars[1]         = register_cvar("amx_shop_ctskin""9000")
}

public 
plugin_precache()
{
    new 
sModels[128]
    
    for (new 
0sizeof(g_szSkinsName); i++)
    {
        
format(sModelssizeof(sModels)-1"models/player/%s/%s.mdl"g_szSkinsName[i], g_szSkinsName[i])
        
precache_model(sModels)
    }
}
        
public 
plugin_cfg()
{
    new 
ConfigsDir[64]
    
get_localinfo("amxx_configsdir"ConfigsDircharsmax(ConfigsDir))
    
format(ConfigsDircharsmax(ConfigsDir), "%s/%s"ConfigsDirg_szShopFile)
    
    if (!
file_exists(ConfigsDir))
    {
        
server_print("CS Shop file [%s] doesn't exists!"ConfigsDir)
        return;
    }
    
server_cmd("exec ^"%s^""ConfigsDir)
}

/*================================================================================
 [Menus]
=================================================================================*/

public ClCmd_Say(id)
{
    if (!
is_user_alive(id))
    {
        
client_print_c(id"%L"id"SHOP_DEAD")
        return 
PLUGIN_HANDLED
    
}
        
    if (!
get_pcvar_num(g_pCvarEnable))
    {
        
client_print_c(id"%L"id"SHOP_DISABLED")
        return 
PLUGIN_HANDLED
    
}
    
Create_Menu(id)
    return 
PLUGIN_HANDLED
}

Create_Menu(id)
{
    new 
Menu menu_create("\rBloodStorm Warfare Shop""MainMenu_Handler")
    new 
Items[32], Position[3]
    
    for (new 
0sizeof(g_szMainShopMenu); i++)
    {
        
formatex(Itemscharsmax(Items), "%s%s",  get_pcvar_num(g_pMenuEnableCvars[i]) ? "\w" "\d"g_szMainShopMenu[i])
        
num_to_str(iPositioncharsmax(Position))
        
        
menu_additem(MenuItemsPosition)
    }
    
menu_setprop(MenuMPROP_EXITMEXIT_ALL)
    
menu_display(idMenu0)        
}

public 
MainMenu_Handler(idMenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(Menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
Data[6], Name[64];
    new 
AccessCallback;
    
menu_item_getinfo(MenuitemAccessData5Name63Callback)
    
    new 
Key str_to_num(Data);
    
    switch (
Key)
    {
        case 
0:
        {
            new 
Cts_Menu menu_create("\rCT's Guns""CtMenu_Handler")
            new 
Items[32], PriceString[32], Position[3]
            
            for (new 
0sizeof(g_szCTGunsMenu); i++)
            {
                
formatex(PriceStringcharsmax(PriceString), "- $%d"get_pcvar_num(g_pCtGunsMenuCvars[i]))
                
formatex(Itemscharsmax(Items), "%s%s %s"get_pcvar_num(g_pCtGunsMenuCvars[i]) > "\w" "\d"g_szCTGunsMenu[i], get_pcvar_num(g_pCtGunsMenuCvars[i]) > PriceString ""
                
                
num_to_str(iPositioncharsmax(Position))
                
                
menu_additem(Cts_MenuItemsPosition)
            }
                
            
menu_setprop(Cts_MenuMPROP_EXITMEXIT_ALL)
            
            if (!
get_pcvar_num(g_pMenuEnableCvars[0]))
            {
                
client_print_c(id"%L"id"SHOP_CT_OFF")
                return 
PLUGIN_HANDLED;
            }
            else    
                
menu_display(idCts_Menu0)    
        }
        
        case 
1:
        {
            new 
Ts_Menu menu_create("\rT's Guns""TeMenu_Handler")
            new 
Items[32], PriceString[32], Position[3]
            
            for (new 
0sizeof(g_szTGunsMenu); i++)
            {
                
formatex(PriceStringcharsmax(PriceString), "- $%d"get_pcvar_num(g_pTeGunsMenuCvars[i]))
                
formatex(Itemscharsmax(Items), "%s%s %s"get_pcvar_num(g_pTeGunsMenuCvars[i]) > "\w" "\d"g_szTGunsMenu[i], get_pcvar_num(g_pTeGunsMenuCvars[i]) > PriceString ""
                
                
num_to_str(iPositioncharsmax(Position))
                
                
menu_additem(Ts_MenuItemsPosition)
            }
                
            
menu_setprop(Ts_MenuMPROP_EXITMEXIT_ALL)

            if (!
get_pcvar_num(g_pMenuEnableCvars[1]))
            {
                
client_print_c(id"%L"id"SHOP_T_OFF")
                return 
PLUGIN_HANDLED
            
}
            else 
                
menu_display(idTs_Menu0)
                
        }
        
        case 
2:
        {
            new 
Inv_Menu menu_create("\rInvisibility Menu""InvisibilityMenu_Handler")
            new 
Items[32], PriceString[32], Position[3]
            
            for (new 
0sizeof(g_szInvisibilityMenu); i++)
            {
                
formatex(PriceStringcharsmax(PriceString), "- $%d"get_pcvar_num(g_pInvisibilityMenuCvars[i]))
                
formatex(Itemscharsmax(Items), "%s%s %s"get_pcvar_num(g_pInvisibilityMenuCvars[i]) > "\w" "\d"g_szInvisibilityMenu[i], get_pcvar_num(g_pInvisibilityMenuCvars[i]) > PriceString ""
                
                
num_to_str(iPositioncharsmax(Position))
                
                
menu_additem(Inv_MenuItemsPosition)
            }
                
            
menu_setprop(Inv_MenuMPROP_EXITMEXIT_ALL)
        
            if (!
get_pcvar_num(g_pMenuEnableCvars[2]))
            {
                
client_print_c(id"%L"id"SHOP_INVIS_OFF")
                return 
PLUGIN_HANDLED
            
}
            else
                
menu_display(idInv_Menu0)    
        }
        
        case 
3:
        {
            new 
Grav_Menu menu_create("\rGravity Menu""GravityMenu_Handler")
            new 
Items[32], PriceString[32], Position[3]
            
            for (new 
0sizeof(g_szGravityMenu); i++)
            {
                
formatex(PriceStringcharsmax(PriceString), "- $%d"get_pcvar_num(g_pGravityMenuCvars[i]))
                
formatex(Itemscharsmax(Items), "%s%s %s"get_pcvar_num(g_pGravityMenuCvars[i]) > "\w" "\d"g_szGravityMenu[i], get_pcvar_num(g_pGravityMenuCvars[i]) > PriceString ""
                
                
num_to_str(iPositioncharsmax(Position))
                
                
menu_additem(Grav_MenuItemsPosition)
            }
                
            
menu_setprop(Grav_MenuMPROP_EXITMEXIT_ALL)
            
            if (!
get_pcvar_num(g_pMenuEnableCvars[3]))
            {
                
client_print_c(id"%L"id"SHOP_GRAV_OFF")
                return 
PLUGIN_HANDLED
            
}
            else
                
menu_display(idGrav_Menu0)    
        }
        
        case 
4:
        {
            new 
Hp_Menu menu_create("\rHealth Menu""HealthMenu_Handler")
            new 
Items[32], PriceString[32], Position[3]
            
            for (new 
0sizeof(g_szHealthMenu); i++)
            {
                
formatex(PriceStringcharsmax(PriceString), "- $%d"get_pcvar_num(g_pHealthMenuCvars[i]))
                
formatex(Itemscharsmax(Items), "%s%s %s"get_pcvar_num(g_pHealthMenuCvars[i]) > "\w" "\d"g_szHealthMenu[i], get_pcvar_num(g_pHealthMenuCvars[i]) > PriceString ""
                
                
num_to_str(iPositioncharsmax(Position))
                
                
menu_additem(Hp_MenuItemsPosition)
            }
                
            
menu_setprop(Hp_MenuMPROP_EXITMEXIT_ALL)
            
            if (!
get_pcvar_num(g_pMenuEnableCvars[4]))
            {
                
client_print_c(id"%L"id"SHOP_HEALTH_OFF")
                return 
PLUGIN_HANDLED
            
}    
            else
                
menu_display(idHp_Menu0)    
        }

        case 
5:
        {
            new 
Speed_Menu menu_create("\rSpeed Menu""SpeedMenu_Handler")
            new 
Items[32], PriceString[32], Position[3]
            
            for (new 
0sizeof(g_szSpeedMenu); i++)
            {
                
formatex(PriceStringcharsmax(PriceString), "- $%d"get_pcvar_num(g_pSpeedMenuCvars[i]))
                
formatex(Itemscharsmax(Items), "%s%s %s"get_pcvar_num(g_pSpeedMenuCvars[i]) > "\w" "\d"g_szSpeedMenu[i], get_pcvar_num(g_pSpeedMenuCvars[i]) > PriceString ""
                
                
num_to_str(iPositioncharsmax(Position))
                
                
menu_additem(Speed_MenuItemsPosition)
            }        
            
            
menu_setprop(Speed_MenuMPROP_EXITMEXIT_ALL)
        
            if (!
get_pcvar_num(g_pMenuEnableCvars[5]))
            {
                
client_print_c(id"%L"id"SHOP_SPEED_OFF")
                return 
PLUGIN_HANDLED
            
}    
            else
                
menu_display(idSpeed_Menu0)    
        }
        
        case 
6:
        {
            new 
Skins_Menu menu_create("\ySkins Menu""SkinsMenu_Handler")
            new 
Items[32], PriceString[32], Position[3]
            
            for (new 
0sizeof(g_szSkinsMenu); i++)
            {
                
formatex(PriceStringcharsmax(PriceString), "- $%d"get_pcvar_num(g_pSkinsMenuCvars[i]))
                
formatex(Itemscharsmax(Items), "%s%s %s"get_pcvar_num(g_pSkinsMenuCvars[i]) > "\w" "\d"g_szSkinsMenu[i], get_pcvar_num(g_pSkinsMenuCvars[i]) > PriceString ""
                
                
num_to_str(iPositioncharsmax(Position))
                
                
menu_additem(Skins_MenuItemsPosition)
            }        
            
            
menu_setprop(Skins_MenuMPROP_EXITMEXIT_ALL)
        
            if (!
get_pcvar_num(g_pMenuEnableCvars[6]))
            {
                
client_print_c(id"%L"id"SHOP_SKINS_OFF")
                return 
PLUGIN_HANDLED
            
}
            else
                
menu_display(idSkins_Menu0)
        }
    }
    
menu_destroy(Menu)
    return 
PLUGIN_HANDLED
}

public 
CtMenu_Handler(idCts_Menuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(Cts_Menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
Data[6], Name[64]
    new 
AccessCallback;
    
menu_item_getinfo(Cts_MenuitemAccessData5Name63Callback)
    
    new 
Key str_to_num(Data)
    
    new 
Money get_user_money(id)
    new 
Pcvar get_pcvar_num(g_pCtGunsMenuCvars[Key])
            
    if (!
Pcvar)
    {
        
client_print_c(id"%L"id"SHOP_ITEM_DISABLED")
        return 
PLUGIN_HANDLED
    
}
            
    if (
Money Pcvar)
        
client_print_c(id"%L"id"SHOP_ITEM_MONEY")
    else
    {
        
client_print_c(id"%L"id"SHOP_ITEM_BUY"g_szCTGunsMenu[Key])
                
        
set_user_money(idMoney-Pcvar)
        
        if (
equali(g_szCTGunsMenu[Key], "Five Seven"))
            
secondary_wpn_drop(id)
        else
            
primary_wpn_drop(id)
        
        
give_item(idg_szCTGunsWeapons[Key])    
        
        if (!
equali(g_szCTGunsMenu[Key], "Shield"))
            
ExecuteHamB(Ham_GiveAmmoidg_iCTGunsLoad[Key], g_szCTGunsAmmo[Key], g_iCTGunsMaxAmmo[Key])
    }
    
menu_destroy(Cts_Menu)
    return 
PLUGIN_HANDLED
}

public 
TeMenu_Handler(idTts_Menuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(Tts_Menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
Data[6], Name[64]
    new 
AccessCallback;
    
menu_item_getinfo(Tts_MenuitemAccessData5Name63Callback)
    
    new 
Key str_to_num(Data)
    
    new 
Money get_user_money(id)
    new 
Pcvar get_pcvar_num(g_pTeGunsMenuCvars[Key])
    
    if (!
Pcvar)
    {
        
client_print_c(id"%L"id"SHOP_ITEM_DISABLED")
        return 
PLUGIN_HANDLED
    
}
    
    if (
Money Pcvar)
        
client_print_c(id"%L"id"SHOP_ITEM_MONEY")
    else
    {
        
client_print_c(id"%L"id"SHOP_ITEM_BUY"g_szTGunsMenu[Key])
        
        
set_user_money(idMoney-Pcvar)
        
        if (
equali(g_szTGunsMenu[Key], "Dual Elites"))
            
secondary_wpn_drop(id)
        else
            
primary_wpn_drop(id)
        
        
give_item(idg_szTGunsWeapons[Key])
        
ExecuteHamB(Ham_GiveAmmoidg_iTGunsLoad[Key], g_szTGunsAmmo[Key], g_iTGunsMaxAmmo[Key])
    }
    
menu_destroy(Tts_Menu)
    return 
PLUGIN_HANDLED
}

public 
InvisibilityMenu_Handler(idInv_Menuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(Inv_Menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
Data[6], Name[64]
    new 
AccessCallback;
    
menu_item_getinfo(Inv_MenuitemAccessData5Name63Callback)
    
    new 
Key str_to_num(Data)
    
    new 
Money get_user_money(id)
    new 
Pcvar get_pcvar_num(g_pInvisibilityMenuCvars[Key])
            
    if (!
Pcvar)
    {
        
client_print_c(id"%L"id"SHOP_ITEM_DISABLED")
        return 
PLUGIN_HANDLED
    
}
        
    if (
Money Pcvar)
        
client_print_c(id"%L"id"SHOP_ITEM_MONEY")
    else
    {
        
client_print_c(id"%L"id"SHOP_ITEM_BUY"g_szInvisibilityMenu[Key])
        
        
set_user_money(idMoney-Pcvar)
        
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlphag_iInvisibilityLevel[Key])
    }
    
menu_destroy(Inv_Menu)
    return 
PLUGIN_HANDLED
}

public 
GravityMenu_Handler(idGrav_Menuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(Grav_Menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
Data[6], Name[64]
    new 
AccessCallback;
    
menu_item_getinfo(Grav_MenuitemAccessData5Name63Callback)

    new 
Key str_to_num(Data)
    
    new 
Money get_user_money(id)
    new 
Pcvar get_pcvar_num(g_pGravityMenuCvars[Key])
            
    if (!
Pcvar)
    {
        
client_print_c(id"%L"id"SHOP_ITEM_DISABLED")
        return 
PLUGIN_HANDLED
    
}
            
    if (
Money Pcvar)
        
client_print_c(id"%L"id"SHOP_ITEM_MONEY")
    else
    {
        
client_print_c(id"%L"id"SHOP_ITEM_BUY"g_szGravityMenu[Key])
                
        
set_user_money(idMoney-Pcvar)
        
set_user_gravity(id, (g_flGravityLevel[Key] / get_pcvar_float(g_pGravityCvarPointer)))
    }
    
menu_destroy(Grav_Menu)
    return 
PLUGIN_HANDLED
}                

public 
HealthMenu_Handler(idHp_Menuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(Hp_Menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
Data[6], Name[64]
    new 
AccessCallback
    menu_item_getinfo
(Hp_MenuitemAccessData5Name63Callback)
    
    new 
Key str_to_num(Data)
    
    new 
Money get_user_money(id)
    new 
Pcvar get_pcvar_num(g_pHealthMenuCvars[Key])
    new 
Health get_user_health(id)
            
    if (!
Pcvar)
    {
        
client_print_c(id"%L"id"SHOP_ITEM_DISABLED")
        return 
PLUGIN_HANDLED
    
}
            
    if (
Money Pcvar)
        
client_print_c(id"%L"id"SHOP_ITEM_MONEY")
    else
    {
        
client_print_c(id"%L"id"SHOP_ITEM_BUY"g_szHealthMenu[Key])
                
        
set_user_money(idMoney-Pcvar)
        
set_user_health(idHealth+g_iHealthLevel[Key])    
    }
    
menu_destroy(Hp_Menu)
    return 
PLUGIN_HANDLED
}                            

public 
SpeedMenu_Handler(idSpeed_Menuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(Speed_Menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
Data[6], Name[64]
    new 
AccessCallback;
    
menu_item_getinfo(Speed_MenuitemAccessData5Name63Callback)
    
    new 
Key str_to_num(Data)
    
    new 
Money get_user_money(id)
    new 
Pcvar get_pcvar_num(g_pSpeedMenuCvars[Key])
            
    if (!
Pcvar)
    {
        
client_print_c(id"%L"id"SHOP_ITEM_DISABLED")
        return 
PLUGIN_HANDLED
    
}
            
    if (
Money Pcvar)
        
client_print_c(id"%L"id"SHOP_ITEM_MONEY")
    else
    {
        
g_iHasSpeed[id] = Key
                
        client_print_c
(id"%L"id"SHOP_ITEM_BUY"g_szSpeedMenu[Key])
                
        
set_user_money(idMoney-Pcvar)
        
set_user_maxspeed(idg_flSpeedLevel[Key])
    }
    
menu_destroy(Speed_Menu)
    return 
PLUGIN_HANDLED
}                           

public 
SkinsMenu_Handler(idMdl_Menuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(Mdl_Menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
Data[6], Name[64]
    new 
AccessCallback
    menu_item_getinfo
(Mdl_MenuitemAccessData5Name63Callback)
    
    new 
Key str_to_num(Data)
    
    new 
Money get_user_money(id)
    new 
Pcvar get_pcvar_num(g_pSkinsMenuCvars[Key])
    
    new 
CsTeams:Team cs_get_user_team(id)
            
    if (!
Pcvar)
    {
        
client_print_c(id"%L"id"SHOP_ITEM_DISABLED")
        return 
PLUGIN_HANDLED
    
}    
            
    switch (
Team)
    {
        case 
CS_TEAM_T:
        {
            if (
Key == 0)
            {
                
client_print_c(id"%L"id"SHOP_ITEM_NOT")
                return 
PLUGIN_HANDLED
            
}
        }
        
        case 
CS_TEAM_CT:
        {
            if (
Key == 1)
            {
                
client_print_c(id"%L"id"SHOP_ITEM_NOCT")
                return 
PLUGIN_HANDLED
            
}
        }
    }
                
    if (
Money Pcvar)
        
client_print_c(id"%L"id"SHOP_ITEM_MONEY")
    else
    {
        
client_print_c(id"%L"id"SHOP_ITEM_BUY"g_szSkinsMenu[Key])
                
        
set_user_money(idMoney-Pcvar)
        
fm_set_user_model(idg_szSkinsName[Key])
    }            
    
menu_destroy(Mdl_Menu)
    return 
PLUGIN_HANDLED
}    
    
/*================================================================================
 [Forwards]
=================================================================================*/

public Fwd_PlayerSpawn_Post(id)
{
    if (
is_user_alive(id))
    {
        
set_user_rendering(id)
        
set_user_gravity(id1.0)
    
        if (
g_bHasCustomModel[id])
            
fm_reset_user_model(id)
    
        if (
g_iHasSpeed[id])
        {
            
set_user_maxspeed(id250.0)
            
g_iHasSpeed[id] = -1
        
}
        
        if (
get_pcvar_num(g_pCvarEnable))
            if (
get_pcvar_num(g_pCvarMessage))
                
client_print_c(id"%L"id"SHOP_PRINT")
    }
}

public 
Fwd_SetClientKeyValue(id, const infobuffer[], const key[])
{   
    if (
g_bHasCustomModel[id] && equal(key"model"))
        return 
FMRES_SUPERCEDE
        
    
return FMRES_IGNORED
}

public 
Event_CurWeapon(id)
{
    if (!
is_user_alive(id))
        return
    
    switch (
g_iHasSpeed[id])
    {
        case 
0set_user_maxspeed(id260.0)
        case 
1set_user_maxspeed(id300.0)
        case 
2set_user_maxspeed(id340.0)
        case 
3set_user_maxspeed(id380.0)
        case 
4set_user_maxspeed(id420.0)
    }
}

/*================================================================================
 [Stocks]
=================================================================================*/    
    
stock primary_wpn_drop(index)
{
    new 
weapons[32], numWeapon
    get_user_weapons
(indexweaponsnum)
    
    for (new 
0numi++) 
    {
        
Weapon weapons[i]
        
        if (
PRIMARY_WEAPONS_BITSUM & (1<<Weapon))
        {
            static 
wname[32]
            
get_weaponname(Weaponwnamesizeof wname 1)
            
            
engclient_cmd(index"drop"wname)
        }
    }
}

stock secondary_wpn_drop(index)
{
    new 
weapons[32], numWeapon
    get_user_weapons
(indexweaponsnum)
    
    for (new 
0numi++)
    {
        
Weapon weapons[i]
        
        if (!(
PRIMARY_WEAPONS_BITSUM & (1<<Weapon)))
        {
            static 
wname[32]
            
get_weaponname(Weaponwnamesizeof wname 1)
            
            
engclient_cmd(index"drop"wname)
        }
    }
}    

stock fm_set_user_model(index, const mdl[])
{
    
engfunc(EngFunc_SetClientKeyValueindexengfunc(EngFunc_GetInfoKeyBufferindex), "model"mdl)
    
g_bHasCustomModel[index] = true
}

stock fm_reset_user_model(index)
{
    
g_bHasCustomModel[index] = false
    dllfunc
(DLLFunc_ClientUserInfoChangedindexengfunc(EngFunc_GetInfoKeyBufferindex))
}

stock client_print_c(index, const Msg[], {FloatSqlResult,_}:...) 
{
    if (!
is_user_connected(index))
        return; 
    
    new 
Buffer[512], Buffer2[512], Prefix[32]
    
get_pcvar_string(g_pCvarPrefixPrefixcharsmax(Prefix))
    
formatex(Buffer2charsmax(Buffer2), "^x04%s ^x01%s"PrefixMsg);
    
vformat(Buffercharsmax(Buffer), Buffer23);
   
    
message_begin(MSG_ONE_UNRELIABLEg_iMsgSayText_index);
    
write_byte(index);
    
write_string(Buffer);
    
message_end();

MetalSkater92 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 00:39.


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