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

OciXCrom's Custom Shop + API


Post New Thread Reply   
 
Thread Tools Display Modes
anash
Junior Member
Join Date: May 2018
Old 02-20-2021 , 14:14   Re: OciXCrom's Custom Shop + API
Reply With Quote #291

Hello, added the plugins, When i type /shop i get " The Custom Shop doesn't have any available items at the moment!"
the CostumShopItems.ini is created but its empty , any idea why or how to fix?
anash is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-20-2021 , 14:26   Re: OciXCrom's Custom Shop + API
Reply With Quote #292

Because you added cshop_items.amxx before custom_shop.amxx in plugins.ini.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Old 02-20-2021, 14:33
anash
This message has been deleted by anash. Reason: repetition
anash
Junior Member
Join Date: May 2018
Old 02-20-2021 , 16:00   Re: OciXCrom's Custom Shop + API
Reply With Quote #293

Quote:
Originally Posted by OciXCrom View Post
Because you added cshop_items.amxx before custom_shop.amxx in plugins.ini.
Thank you, that works

Sorry for spamming, I have a question; is there a way to limit the number of items one can buy in one round?

for example, if the limit is 2 items, if player buy speed and health, he cant buy any other item untill next round

Last edited by anash; 02-20-2021 at 16:04.
anash is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-09-2021 , 07:34   Re: OciXCrom's Custom Shop + API
Reply With Quote #294


  • Fixed a missing check for the player's team when purchasing an item that allowed you to purchase items from the other team if you changed team while the menu was open (report from HowToRuski).

@anash try this:

Code:
#include <amxmodx> #include <cromchat> #include <customshop> #if !defined MAX_PLAYERS const MAX_PLAYERS = 32 #endif new _cshop_item_limit new g_iItemsBought[MAX_PLAYERS + 1] public plugin_init() {     register_plugin("CSHOP: Item Limit", "1.0", "OciXCrom")     register_logevent("OnRoundStart", 2, "0=World triggered", "1=Round_Start")     _cshop_item_limit = register_cvar("cshop_item_limit", "2")     cshop_get_prefix(CC_PREFIX, charsmax(CC_PREFIX)) } public OnRoundStart() {     arrayset(g_iItemsBought, 0, sizeof(g_iItemsBought)) } public cshop_item_selected(id) {     new iLimit = get_pcvar_num(_cshop_item_limit)     if(g_iItemsBought[id] >= iLimit)     {         CC_SendMessage(id, "You can only purchase &x04%i items &x01per round.", iLimit)         return DONT_BUY     }     g_iItemsBought[id]++     return BUY_ITEM }
__________________

Last edited by OciXCrom; 03-09-2021 at 07:35.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
shubhambanekar
Junior Member
Join Date: Feb 2021
Old 03-18-2021 , 10:08   Re: OciXCrom's Custom Shop + API
Reply With Quote #295

Quote:
Originally Posted by OciXCrom View Post
The shop only works for the current map. Any long-term purchases would need to be handled via a separate plugin. You could edit your skin plugin to do that.
How can I do that?
I want to create a new menu item called inventory in CS SHOP MENU, where once weapon skin is purchased gets saved in that inventory, and one can activate any skin or default skin from that menu.

Last edited by shubhambanekar; 03-18-2021 at 10:08.
shubhambanekar is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-18-2021 , 10:33   Re: OciXCrom's Custom Shop + API
Reply With Quote #296

If you don't have the coding knowledge to do it, you should post a request. Bear in mind it's not that simple to make so don't expect a fast reply.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
shubhambanekar
Junior Member
Join Date: Feb 2021
Old 03-25-2021 , 01:41   Re: OciXCrom's Custom Shop + API
Reply With Quote #297

Quote:
Originally Posted by OciXCrom View Post
If you don't have the coding knowledge to do it, you should post a request. Bear in mind it's not that simple to make so don't expect a fast reply.
I have created a new thread here, https://forums.alliedmods.net/showthread.php?t=331383
shubhambanekar is offline
MAJESTIC_SZ
Senior Member
Join Date: Mar 2020
Location: Portugal
Old 07-18-2021 , 08:15   Re: OciXCrom's Custom Shop + API
Reply With Quote #298

Hello.
To the author:
Is there a way to enable the shop to be open only in certain amount of time?
On my server, every round start people has 15 seconds to buy stuff.
I would like the shop to be available only on that 15 seconds window.
Or a cvar to customize the time it can be used.
I tried to find any post related to this but didn't found any mention to it, sorry if it is already here.
MAJESTIC_SZ is offline
MAJESTIC_SZ
Senior Member
Join Date: Mar 2020
Location: Portugal
Old 07-18-2021 , 08:45   Re: OciXCrom's Custom Shop + API
Reply With Quote #299

Quote:
Originally Posted by OciXCrom View Post
Code:
public cshop_menu_opened(id) {     if(some_condition)     {         return SHOP_CLOSE     }         return SHOP_OPEN }
I found this, but i dont know how to code.
How do i use this?
(some condition)
Do i use mp_roundtime or ... ?
Can you give an example please?
MAJESTIC_SZ is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 07-18-2021 , 09:31   Re: OciXCrom's Custom Shop + API
Reply With Quote #300

Quote:
Originally Posted by MAJESTIC_SZ View Post
but i dont know how to code.
It's never too late!
This is a very generic and common problem resolved with minimal code.

From updated copy of Conner's Bhop abilities. Users were hopping away during freezetimes!

Code:
new bool:cool_down_active public round_start()     cool_down_active = false public round_end()     cool_down_active = true     public cshop_menu_opened(id) {     if(cool_down_active)         return SHOP_CLOSE     return SHOP_OPEN }
__________________
DJEarthQuake 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 12:02.


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