Raised This Month: $ Target: $400
 0% 

OciXCrom's Custom Shop + API


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

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 #2


  • 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
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-18-2021 , 10:33   Re: OciXCrom's Custom Shop + API
Reply With Quote #3

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
BANNED
Join Date: Feb 2021
Location: Usa
Old 03-25-2021 , 01:41   Re: OciXCrom's Custom Shop + API
Reply With Quote #4

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
Send a message via ICQ to shubhambanekar Send a message via AIM to shubhambanekar Send a message via Yahoo to shubhambanekar Send a message via Skype™ to shubhambanekar
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 #5

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
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 #6

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
cgirerd
Junior Member
Join Date: Jul 2021
Old 08-15-2021 , 20:39   Re: OciXCrom's Custom Shop + API
Reply With Quote #7

Hi OciXCrom,
Thank you for the awesome plugin! I have a question: I would like shop items to not be lost during player transfers with a balancer. I tried to make players change team with silent_kill without success or via ExecuteHamB(Ham_CS_RoundRespawn, Player), which does not kill the player, but shopped items are still lost. Any idea on how to do that, either by keeping the items or restoring them?
Have a nice day
cgirerd is offline
cgirerd
Junior Member
Join Date: Jul 2021
Old 08-25-2021 , 05:48   Re: OciXCrom's Custom Shop + API
Reply With Quote #8

Fixed, I balance players on death now. But maybe this could be of interest to other people.
Thanks again for the nice plugin!
cgirerd is offline
romeo72
Member
Join Date: Oct 2021
Old 11-23-2021 , 05:42   Re: OciXCrom's Custom Shop + API
Reply With Quote #9

Hello, everyone,

I have a question and I hope you can help me.
I installed this plugin. the two .sma files compiled locally (on my pc).
Unfortunately the plugin does not start and I get the following error message in the console of the gameserver:

Code:
L 11/23/2021 - 11:20:57: Invalid array handle provided (0)
L 11/23/2021 - 11:20:57: [AMXX] Run time error 10 (plugin "custom_shop.amxx") (native "ArrayPushArray") - debug not enabled!
L 11/23/2021 - 11:20:57: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/23/2021 - 11:20:57: Unhandled dynamic native error
L 11/23/2021 - 11:20:57: [AMXX] Run time error 10 (plugin "cshop_items.amxx") (native "cshop_register_item") - debug not enabled!
L 11/23/2021 - 11:20:57: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/23/2021 - 11:20:58: Invalid cellvector handle provided (2:0:0)
L 11/23/2021 - 11:20:58: [AMXX] Run time error 10 (plugin "custom_shop.amxx") (native "ArrayGetArray") - debug not enabled!
L 11/23/2021 - 11:20:58: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 11/23/2021 - 11:20:58: Unhandled dynamic native error
L 11/23/2021 - 11:20:58: [AMXX] Run time error 10 (plugin "cshop_items.amxx") (native "cshop_get_int") - debug not enabled!
L 11/23/2021 - 11:20:58: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
I copied the rest of the files into the appropriate folder.
can you maybe help me further what i did wrong?

Thank you in advance !

Best regards
romeo72 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-23-2021 , 07:43   Re: OciXCrom's Custom Shop + API
Reply With Quote #10

custom_shop.amxx should be added BEFORE cshop_items.amxx in plugins.ini.
That's why I specifically left a plugins.ini file in the archive.
Read the installation instructions in the first post.

Last edited by OciXCrom; 11-23-2021 at 16:43.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply



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 06:58.


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