AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   [ZP50] Addon: Item Limiter (Update 1.1) (https://forums.alliedmods.net/showthread.php?t=242103)

Catastrophe 06-14-2014 02:29

[ZP50] Addon: Item Limiter (Update 1.1)
 
2 Attachment(s)
[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

http://i61.tinypic.com/xao2hi.jpg

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.

http://i59.tinypic.com/2ai37ls.jpg

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.

http://i58.tinypic.com/21eyfch.jpg

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.

zmd94 06-14-2014 04:02

Re: [ZP50] Addon: Item Limiter
 
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"

bat 06-14-2014 04:10

Re: [ZP50] Addon: Item Limiter
 
Good work.

ANTICHRISTUS 06-14-2014 04:17

Re: [ZP50] Addon: Item Limiter
 
you need a custom include to compile: Include list.
Quote:

Originally Posted by zmd94 (Post 2151400)
I am using web compiler, here.

never use it for zp plugins or any others using some non-default includes.

Catastrophe 06-14-2014 04:19

Re: [ZP50] Addon: Item Limiter
 
Quote:

Originally Posted by zmd94 (Post 2151400)
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.

zmd94 06-14-2014 04:45

Re: [ZP50] Addon: Item Limiter
 
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). :wink:

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

Catastrophe 06-14-2014 07:35

Re: [ZP50] Addon: Item Limiter
 
Quote:

Originally Posted by catastrophe (Post 2151382)
[zp50] addon: Item limiter



Quote:

Originally Posted by catastrophe (Post 2151382)
but will not work with zp43 mod.

:)

ghostz0r 06-14-2014 09:01

Re: [ZP50] Addon: Item Limiter
 
create this to 4.3 please))))

Catastrophe 06-14-2014 12:13

Re: [ZP50] Addon: Item Limiter
 
Quote:

Originally Posted by ghostz0r (Post 2151533)
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.

Kia 06-15-2014 05:41

Re: [ZP50] Addon: Item Limiter
 
  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.


All times are GMT -4. The time now is 06:33.

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