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

OciXCrom's Custom Shop + API


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose       
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-29-2016 , 15:52   OciXCrom's Custom Shop + API
Reply With Quote #1



OciXCrom's Custom Shop + API


Description
  • This plugin adds a unique shop in the game that contains a variety of different settings which makes it highly customizable. The shop has got a special points system that can be activated through the configuration file. It also has an API which allows you to easily add more items, as well as remove some of the default ones.

Installation
  • Bear in mind that the plugin consists of two different files that need to be added in the plugins list.
  • The files custom_shop.amxx and cshop_items.amxx go in the plugins folder. The first one is the main plugin, i.e. the shop can't work without it. The second one contains all the default shop items, so you can decide not to add it if you plan to add your own custom items.
  • The files custom_shop.sma and cshop_items.sma go in the scripting folder. It is highly recommended to compile them locally and replace them with the new .amxx files.
  • The file customshop.inc goes in scripting/include. This is the plugin's API. There you can find all of the functions that are used to create sub-plugins.
  • The file cshop_settings.inc goes in scripting/include.
  • In configs/plugins.ini you need to add only custom_shop.amxx.
  • In configs/plugins-cshop.ini you need to add cshop_items.amxx. All sub-plugins go in that file. You can add them in configs/plugins.ini as well, but they must be placed underneath custom_shop.amxx.

Default items
  • This is a list of all items that are added in the shop by default. Names, prices, limits and everything else can be changed by editing CustomShopItems.ini, which is automatically created in your configs folder after restarting the server with the plugin added. Items can also be changed directly from the server by using the command
  • cshop_edit.
  • +50 Health -- Gives +50 HP.
    • Price: 1500
    • Limit: 5
  • +100 Armor -- Gives +100 AP.
    • Price: 1000
    • Limit: 8
  • Unlimited Clip -- Unlimited bullets for your curent weapon (no reload). This item cannot be activated on a weapon that doesn't use bullets.
    • Price: 3000
    • Limit: 3
  • Unlimited Ammo -- Unlimited backpack ammo for your current weapon. This item cannot be activated on a weapon that doesn't use bullets.
    • Price: 200
    • Limit: 5
  • Bomber -- Gives +20 HE grenades.
    • Price: 1600
    • Limit: 3
  • Silent Footsteps -- You won't make any sounds when walking.
    • Price: 3000
    • Limit: 1
  • Faster Speed -- Increases your speed.
    • Price: 4300
    • Limit: 1
  • Low Gravity -- Allows you to jump higher.
    • Price: 2800
    • Limit: 1
  • Chameleon -- You get a random skin from the enemy team.
    • Price: 9000
    • Limit: 1
  • Drugs (Speed + Health) -- Distorts your screen, increases your speed and adds additional health.
    • Price: 8000
    • Limit: 2
  • Transparency -- Makes you transparent.
    • Price: 2500
    • Limit: 1
  • Invisibility (15 Seconds) -- You become fully invisible for 15 seconds.
    • Price: 16000
    • Limit: 1
  • Double Damage -- Doubles the damage you make.
    • Price: 10000
    • Limit: 1
  • Godmode (5 Seconds) -- You become immortal for 5 seconds.
    • Price: 16000
    • Limit: 1
  • Health Regeneration -- You get +1 HP each second.
    • Price: 1800
    • Limit: 1
  • Armor Regeneration -- You get +10 AP each second.
    • Price: 2000
    • Limit: 1

Admin commands
  • cshop_points <nick|#userid> <amount> -- Gives/Takes points to/from the player.
  • cshop_items -- A list of all registered items.
  • cshop_edit -- Opens the In-Game Shop Editor.
  • cshop_reset_points -- Resets everyone's points.

Settings
  • The settings can be changed in the file configs/CustomShop.ini, and the messages in data/lang/CustomShop.txt.
  • CSHOP_PREFIX -- Prefix for chat messages.
    • DEFAULT: !n[!tCustom Shop!n]
  • CSHOP_TITLE -- Menu title..
    • DEFAULT: \yOciXCrom's \rCustom Shop
  • CSHOP_TITLE_PAGE -- The text that will be added to the title if the menu has more than one page.
    • DEFAULT: \d| \w%page%:\d
  • CSHOP_TEAM_NAMES -- Team names when using %team% in the title.
    • DEFAULT: Unassigned, Terrorist, Counter-Terrorist, Spectator
  • CSHOP_SOUND_ERROR -- Error sound.
    • DEFAULT: buttons/button11.wav
  • CSHOP_SOUND_EXPIRE -- The sound when an item expires.
    • DEFAULT: buttons/blip2.wav
  • CSHOP_SOUND_OPEN -- The sound when you open the shop.
    • DEFAULT:
  • CSHOP_BUYSOUND_TYPE -- 0 = everyone around the player hears the sound when you buy an item; 1 = only the player hears it
    • DEFAULT: 0
  • CSHOP_EXPIRESOUND_TYPE -- 0 = everyone around the player hears the sound when an item expires; 1 = only the player hears it
    • DEFAULT: 0
  • CSHOP_OPENSOUND_TYPE -- 0 = everyone around the player hears the sound when the shop is opened; 1 = only the player hears it
    • DEFAULT: 1
  • CSHOP_COMMANDS -- Commands that open the shop.
    • DEFAULT: say /shop , say_team /shop , customshop
  • CSHOP_PREVPAGE -- Previous page field.
    • DEFAULT: Previous page
  • CSHOP_NEXTPAGE -- Next page field.
    • DEFAULT: Next page
  • CSHOP_EXITMENU -- Exit menu field.
    • DEFAULT: \rClose
  • CSHOP_PERPAGE -- Number of items on each page.
    • DEFAULT: 7
  • CSHOP_FLAG -- If you want the shop to be available for players with a certain flag only.
    • DEFAULT: !
  • CSHOP_TEAM -- If you want the shop to be available for a certain team only.
    • DEFAULT: 0
  • CSHOP_SHOW_TEAMED -- Controls whether items that aren't meant for your team will be displayed in the menu.
    • DEFAULT: 0
  • CSHOP_ITEM_TEAMED -- Text for items that aren't meant for your team.
    • DEFAULT: \r[\yTEAMED\r]
  • CSHOP_SHOW_FLAGGED -- Controls whether items that you don't have access to will be displayed in the menu.
    • DEFAULT: 0
  • CSHOP_ITEM_FLAGGED -- Text for items that you don't have access to.
    • DEFAULT: \r[\yFLAGGED\r]
  • CSHOP_LIMIT_TYPE -- How is the item limit going to work (0 = every players has his own limit; 1 = every team has his own limit; 2 = limit is the same for all players).
    • DEFAULT: 0
  • CSHOP_HIDE_LIMITED -- If you want to hide items that have reached their limit.
    • DEFAULT: 0
  • CSHOP_OPEN_AT_SPAWN -- If you want the shop to be displayed on spawn.
    • DEFAULT: 0
  • CSHOP_REOPEN_AFTER_USE -- Whether the shop will stay open after purchasing an item.
    • DEFAULT: 0
  • CSHOP_POINTS_ENABLE -- Enables/Disables the points system.
    • DEFAULT: 0
  • CSHOP_MONEY_NAME -- Money name.
    • DEFAULT: money
  • CSHOP_POINTS_NAME -- Points name.
    • DEFAULT: points
  • CSHOP_MONEY_CURRENCY -- Money currency.
    • DEFAULT: $
  • CSHOP_POINTS_CURRENCY -- Points currency.
    • DEFAULT: Pts.
  • CSHOP_POINTS_SAVE -- Save points? (1 = yes; 0 = no)
    • DEFAULT: 1
  • CSHOP_SAVE_TYPE -- How to save the points (0 = name; 1 = IP address; 2= SteamID)
    • DEFAULT: 0
  • CSHOP_POINTS_COMMANDS -- Commands that allow you to see how many points you have.
    • DEFAULT: say /points , say_team /points
  • CSHOP_REWARD_NORMAL -- Reward for a normal kill.
    • DEFAULT: 15
  • CSHOP_REWARD_HEADSHOT -- Reward for a headshot kill.
    • DEFAULT: 30
  • CSHOP_REWARD_KNIFE -- Reward for a knife kill.
    • DEFAULT: 50
  • CSHOP_REWARD_VIP -- If you want VIP users to get additional points for each kill
    • DEFAULT: 0
  • CSHOP_VIP_FLAG -- VIP flag for the setting above.
    • DEFAULT: b
  • CSHOP_POINTS_TEAMKILL -- Controls whether you get points for killing teammates.
    • DEFAULT: 0
  • CSHOP_KILL_MESSAGE -- Enables/Disables the message when you kill a player.
    • DEFAULT: 0
  • CSHOP_HUD_ENABLED -- Enables/Disables points being displayed on the HUD.
    • DEFAULT: 0
  • CSHOP_HUD_RED -- Red color amount for the HUD message.
    • DEFAULT: 255
  • CSHOP_HUD_GREEN -- Green color amount for the HUD message.
    • DEFAULT: 255
  • CSHOP_HUD_BLUE -- Blue color amount for the HUD message.
    • DEFAULT: 0
  • CSHOP_HUD_X -- X position for the HUD message.
    • DEFAULT: 0.01
  • CSHOP_HUD_Y -- Y position for the HUD message.
    • DEFAULT: 0.93

Using a currency from another plugin/mod
  • The plugin has the ability to use another plugin's natives instead of default money. In simple terms - you can make the shop work with Ammo Packs, BaseBuilder Credits, JBPacks etc. To achieve that, you need to edit the following lines in the file cshop_settings.inc:

    PHP Code:
    #define get_user_money(%1) cs_get_user_money(%1)
    #define set_user_money(%1,%2) cs_set_user_money(%1, %2) 
  • To make it use Ammo Packs, replace the lines with these:

    PHP Code:
    #define get_user_money(%1) zp_get_user_ammo_packs(%1)
    #define set_user_money(%1,%2) zp_set_user_ammo_packs(%1, %2) 
  • Also, add the natives that you used in both lines:

    PHP Code:
    native zp_get_user_ammo_packs(id)
    native zp_set_user_ammo_packs(idamount
  • Or:

    PHP Code:
    #include <zombieplague> 

Plugin API (customshop.inc)
  • The plugin also has an API, i.e. a library (.inc file), which allows you to make sub-plugins that will add additional items in the shop and many other things. Here's an example of a plugin that adds No Recoil in the shop (removes recoil when shooting).

    PHP Code:
    #include <amxmodx>
    #include <customshop>
    #include <fakemeta>

    #define PLUGIN_VERSION "4.x"

    additem ITEM_NORECOIL
    new bool:g_bNoRecoil[33]

    public 
    plugin_init()
    {
        
    register_plugin("CSHOP: No Recoil"PLUGIN_VERSION"OciXCrom")
        
    register_forward(FM_PlayerPreThink"PreThink")
    }

    public 
    plugin_precache()
        
    ITEM_NORECOIL cshop_register_item("norecoil""No Recoil"120001)

    public 
    cshopItemBought(idiItem)
    {
        if(
    iItem == ITEM_NORECOIL)
            
    g_bNoRecoil[id] = true
    }
        
    public 
    cshopItemRemoved(idiItem)
    {
        if(
    iItem == ITEM_NORECOIL)
            
    g_bNoRecoil[id] = false
    }
        
    public 
    PreThink(id)
    {
        if(
    is_user_alive(id) && g_bNoRecoil[id])
            
    set_pev(idpev_punchangle, {0.00.00.0}) 


Video preview (of an older version)



Translations
  • English: by me (OciXCrom)
  • Macedonian: by me (OciXCrom)
  • Bulgarian: by me (OciXCrom)
  • Spanish: by ACM1PT
  • Hungarian: by vAx
  • Slovakian: by Belo95135
  • Brazilian Portuguese: by addons_zz
  • Romanian: by Craxor
  • Ukrainian: by Leo_BH
  • Russian: by Leo_BH




Last edited by OciXCrom; 03-25-2019 at 11:12. Reason: Restore broken image
OciXCrom is offline
Send a message via Skype™ to OciXCrom
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-29-2016 , 15:52   Custom Shop Sub-Plugins
Reply With Quote #2

Custom Shop Addon: No Recoil

Description
  • This plugin adds No Recoil in the Custom Shop.

Installation
  • Bear in mind that this plugin won't work without the base plugin for Custom Shop (custom_shop.amxx).
  • The file cshop_norecoil.amxx goes in the plugins folder.
  • The file cshop_norecoil.sma goes in the scripting folder.
  • In configs/plugins-cshop.ini you add cshop_norecoil.amxx.

Default settings
  • The settings require editing the file cshop_norecoil.sma.

    PHP Code:
    #define NORECOIL_NAME "No Recoil"
    #define NORECOIL_PRICE 12000
    #define NORECOIL_LIMIT 1 



Custom Shop Addon: Golden AK47

http://i.imgur.com/ihSt7Qw.jpg

Description
  • This plugin adds a Golden AK47 in the Custom Shop. It has a golden model, modified damage and golden bullets.

Installation
  • Bear in mind that this plugin won't work without the base plugin for Custom Shop (custom_shop.amxx).
  • The file cshop_goldenak.amxx goes in the plugins folder.
  • The file cshop_goldenak.sma goes in the scripting folder.
  • The files v_goldenak.mdl and p_goldenak.mdl go in the models/custom_shop folder.
  • In configs/plugins-cshop.ini you add cshop_goldenak.amxx.

Default settings
  • The settings require editing the file cshop_goldenak.sma.

    PHP Code:
    additem ITEM_GOLDENAK
    #define GOLDENAK_NAME "Golden AK47"
    #define GOLDENAK_PRICE 16000
    #define GOLDENAK_LIMIT 1
    #define GOLDENAK_SOUND "weapons/gauss2.wav"
    #define GOLDENAK_VMODEL "models/custom_shop/v_goldenak.mdl"
    #define GOLDENAK_PMODEL "models/custom_shop/p_goldenak.mdl"
    #define GOLDENAK_WEAPON_STR "weapon_ak47"
    #define GOLDENAK_WEAPON_CSW CSW_AK47
    #define GOLDENAK_DAMAGE 5
    #define GOLDENAK_AMMO 500
    new bool:g_blGoldenAK[33]

    // Comment this line to disable the bullets.
    #define USE_BULLETS

    #if defined USE_BULLETS
        // You can add a shoot sound in this line, after you remove the comment.
        //#define BULLET_SOUND "weapons/ak47-1.wav"
        
        #define BULLET_MODEL "sprites/dot.spr"
        #define BULLET_STARTFRAME 1
        #define BULLET_FRAMERATE 5
        #define BULLET_LIFE 2
        #define BULLET_WIDTH 10
        #define BULLET_NOISE 0
        #define BULLET_COLOR_RED 255
        #define BULLET_COLOR_GREEN 215
        #define BULLET_COLOR_BLUE 0
        #define BULLET_BRIGHTNESS 200
        #define BULLET_SPEED 150
        
    new g_iGoldenBullet
    #endif

    #define DEFAULT_VMODEL "models/v_ak47.mdl"
    #define DEFAULT_PMODEL "models/p_ak47.mdl" 



Custom Shop Addon: Leap Longjump

Description
  • This plugin adds leap (longjump) in the Custom Shop. With this item you can perform long jumps.

Settings
  • The settings are automatically generated in configs/CustomShopItems.ini and they can also be changed in-game with the command cshop_edit.
    • Force: 550 -- how far you will jump
    • Minimum Speed: 80 -- the minimum speed that's required in order to jump
    • Height: 255.0 -- how high you will jump
    • Cooldown: 5.0 -- how many seconds before you can jump again
Attached Files
File Type: zip CSHOP GoldenAK47.zip (745.3 KB, 1344 views)
File Type: zip CSHOP No Recoil.zip (635 Bytes, 1033 views)
File Type: zip CSHOP Leap v4.x.zip (870 Bytes, 999 views)

Last edited by OciXCrom; 04-19-2017 at 15:29.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Mohammad Hlwani
Member
Join Date: May 2016
Old 06-29-2016 , 16:56   Re: OciXCrom's Custom Shop 3.3 + API
Reply With Quote #3

best ever
Mohammad Hlwani is offline
Mohammad Hlwani
Member
Join Date: May 2016
Old 06-29-2016 , 17:10   Re: OciXCrom's Custom Shop 3.3 + API
Reply With Quote #4

man no point system ?????????
i dont like this shop now
Mohammad Hlwani is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-29-2016 , 19:14   Re: OciXCrom's Custom Shop 3.3 + API
Reply With Quote #5

What are you talking about? Points are still here, of course. Read the description and take a look at the configuration file. You simply need to enable them. Literally every third sentence in the first comment contains the word "points".

Last edited by OciXCrom; 06-29-2016 at 19:21.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 06-29-2016 , 20:49   Re: OciXCrom's Custom Shop 3.3 + API
Reply With Quote #6

Nice plugin.
zmd94 is offline
Mohammad Hlwani
Member
Join Date: May 2016
Old 06-30-2016 , 10:43   Re: OciXCrom's Custom Shop 3.3 + API
Reply With Quote #7

man there on problem
when i active the point system the game didn't enter !!!
any solution ?
Mohammad Hlwani is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-30-2016 , 10:44   Re: OciXCrom's Custom Shop 3.3 + API
Reply With Quote #8

What do you mean the game didn't enter?
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
MihailoZ
Member
Join Date: Aug 2013
Old 06-30-2016 , 14:43   Re: OciXCrom's Custom Shop 3.3 + API
Reply With Quote #9

This is the best shop plugin I've ever seen. I've god one question...Can I display something like "Shop Info" like, how many points do you have and so?
MihailoZ is offline
Mohammad Hlwani
Member
Join Date: May 2016
Old 06-30-2016 , 15:03   Re: OciXCrom's Custom Shop 3.3 + API
Reply With Quote #10

Quote:
Originally Posted by Napoleon_be View Post
What do you mean the game didn't enter?

when i choose the map and click on start it didnt enter
Mohammad Hlwani is offline
Reply


Thread Tools
Display Modes

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 05:23.


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