Raised This Month: $32 Target: $400
 8% 

[ZP50] Addon: Item Limiter (Update 1.1)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 06-14-2014 , 02:29   [ZP50] Addon: Item Limiter (Update 1.1)
Reply With Quote #1

[ZP50] Addon: Item Limiter


Special thanks to: Kia and zmd94 for some Improvement tips and Testing respectively.

Description:-
Saw a lot of requests to add limits to extra items so made this plugin. As the title says this plugin makes it really easy to add limit to any extra item (Not yet compatible with VIP extra items). This plugin will work with zp43 extra items being used in zp50 mod but will not work with zp43 mod.

To add limit to extra items it uses an external "zp_extra_limit.ini" file that is to be placed in cstrike/addons/amxmodx/configs directory.

This plugin has 2 modes APART FROM THE CVAR, in the .sma file u can see #define PLUGIN_MODE , its default value is 1.

If it set to 1, LIMIT WILL BE APPLIED PER PERSON INDIVIDUALLY, i.e if limit is 3 and i buy one the plugin will show 1/3 for me and 0/3 for someone else who hasnt bought the item yet.

If it set to 2, LIMIT WILL BECOME GLOBAL, i.e if i buy the item once it will show 1/3 on everyone's item list.


How to add limit :-

Step 1:
Find the extra items register name. It is given inside any extra item's code in its register function



Step 2:
Copy and paste that name without the quotes in the "zp_extra_limit.ini" file in "item_id" section and in "item_limit" section put the desired limit.



Step 3:
Save the "zp_extra_limit.ini" and close it. (No change needs to be made in the .sma file of the extra item.)

Note: To add more than 1 extra item in the list, just add a coma after the previous extra item id/cost in the zp_extra_limit.ini and add the id of this other extra item after the coma.



Bugs : -

None. Report if u find any.

Although there is one thing. Do not put more than 128 items in the zp_item_limit.ini at one time, or it will give you errors.

Cvars:-

zp_extra_limit_mode (0 - Limit for 1 round | 1 - Limit for 1 map)(Def - 0)(I'll separate this specific to each item in the next update hopefully)

My Note:-

Dont PM me for anything related to this topic, post it here.........

Change log:-

v1.0
Release
v1.1 Added a define to change the mode of plugin, made some changes as Kia said.
Attached Files
File Type: ini zp_extra_limit.ini (63 Bytes, 1290 views)
File Type: sma Get Plugin or Get Source (zp50_extra_limiter.sma - 2649 views - 3.3 KB)
__________________
You will find everything u need :-

Last edited by Catastrophe; 10-26-2014 at 10:35.
Catastrophe is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 06-14-2014 , 04:02   Re: [ZP50] Addon: Item Limiter
Reply With Quote #2

Hi, Catastrophe.

I have problem when trying to compile the zp50_extra_limiter.sma file. I am using web compiler, here.:
Quote:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/tmp/textKKtG3u.sma(3) : fatal error 100: cannot read from file: "amx_settings_api"

Compilation aborted.
1 Error.
If I use local compiler, the result still the same:
Quote:
sma<3> : fatal error 100: cannot read from file: "amx_settings_api"

Last edited by zmd94; 06-14-2014 at 04:18.
zmd94 is offline
bat
Veteran Member
Join Date: Jul 2012
Old 06-14-2014 , 04:10   Re: [ZP50] Addon: Item Limiter
Reply With Quote #3

Good work.
bat is offline
Send a message via Skype™ to bat
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 06-14-2014 , 04:17   Re: [ZP50] Addon: Item Limiter
Reply With Quote #4

you need a custom include to compile: Include list.
Quote:
Originally Posted by zmd94 View Post
I am using web compiler, here.
never use it for zp plugins or any others using some non-default includes.
__________________

Last edited by ANTICHRISTUS; 06-14-2014 at 04:19.
ANTICHRISTUS is offline
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 06-14-2014 , 04:19   Re: [ZP50] Addon: Item Limiter
Reply With Quote #5

Quote:
Originally Posted by zmd94 View Post
Hi, Catastrophe.
I have problem when trying to compile the zp50_extra_limiter.sma file:
I am using web compiler, here.
amx_settings_api is provided in the zp50 package by default. Look there if u cant find it anywhere else.
__________________
You will find everything u need :-
Catastrophe is offline
Old 06-14-2014, 04:24
TheDS1337
This message has been deleted by asherkin. Reason: Constructive comments are welcome, drivel like this is not.
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 06-14-2014 , 04:45   Re: [ZP50] Addon: Item Limiter
Reply With Quote #6

I have tried to compile it with local compiler for ZP 5.0.5 and it succeed. This addon also working perfectly on my ZP 5.0.5 server (but not for VIP as you have mentioned it).

This addon also will rewrite the name of the item in the menu. Example:
Quote:
Golden Ak -47 (30) [0/1]
I have limit the value to 1.

This addon is working in ZP 5.0.5 but not in ZPA 1.6.1 (I have tested it).

However, I'm not sure whether it really working in ZP 4.3

Last edited by zmd94; 11-01-2014 at 06:07.
zmd94 is offline
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 06-14-2014 , 07:35   Re: [ZP50] Addon: Item Limiter
Reply With Quote #7

Quote:
Originally Posted by catastrophe View Post
[zp50] addon: Item limiter


Quote:
Originally Posted by catastrophe View Post
but will not work with zp43 mod.
__________________
You will find everything u need :-
Catastrophe is offline
ghostz0r
Senior Member
Join Date: Dec 2012
Old 06-14-2014 , 09:01   Re: [ZP50] Addon: Item Limiter
Reply With Quote #8

create this to 4.3 please))))
ghostz0r is offline
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 06-14-2014 , 12:13   Re: [ZP50] Addon: Item Limiter
Reply With Quote #9

Quote:
Originally Posted by ghostz0r View Post
create this to 4.3 please))))
Sorry bro i dont work with zp43 forwards/natives. and converting this plugin is like entirely recoding it... so i dont think any1 else would do it either.
__________________
You will find everything u need :-
Catastrophe is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 06-15-2014 , 05:41   Re: [ZP50] Addon: Item Limiter
Reply With Quote #10

  1. Use arrayset instead of looping through all players to reset a variable.
  2. Indent your code.
  3. Use formatex and not format.
  4. Use charsmax or sizeof() -1 instead of typing the number per hand.
  5. Some work at zp_fw_items_select_pre can be done before the if-clause.
__________________
Kia 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 17:51.


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