AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Buy Menu Management 2.0 (https://forums.alliedmods.net/showthread.php?t=203998)

Mr. Frost 12-26-2012 08:38

Buy Menu Management 2.0
 
5 Attachment(s)
BUY MENU MANAGEMENT
Version 2.0 © Danakt Frost

Description:
This plugin is designed to modify and supplement the Buy Menu.
Attention! This plugin is NOT Zombie Plague addon!

What's new in version 2.0?
  • Statistics of weapons purchases. With the help of statistics you can always see what weapon is least or most popular. Statistics opens with the command "amx_bmm_stats", both in the server console and in the admin console (administrator must have rights to the cvars edit).
  • Support bots. Now the bots are able to buy weapons that you added. Statistics weapons bought by bots isn't conducted.
  • No buyzone mode. When mode enabled, you can buy weapons and ammo at any point on the map. Activating by disabling "bmm_buyzone".
  • Free ammo. In spawn, and the purchase of any weapon, you will have a full back pack ammo, like in Counter-Strike: Source. Disabling by cvar "bmm_autoammo".
  • Autobuy and rebuy (F1 and F2).

The methods for adding items to the menu:
  1. The usual addition of weapons. The plugin is able to add weapons to the menu via third-party plugins using the internal API (See "bmm.inc" in the attached archive). An example of using this method you can see in the attached archive plugin "bmm_c4", which adds to menu of equipment terrorist the C4 bomb.
  2. Addition ZP Extra Items. The plugin can to add the Extra Items without a Zombie Plague. When adding, in the buy menu appears item "Uncategorised", in which they are located. You can move them by command "amx_bmm_category".
  3. Adding console commands in the menu. For cases where you want make item which executes command in the player console. Also when using this method can register a standard weapon (Sample: amx_bmm_additem "AK-47" 2500 T "" "ak47"). When you call a registered commands directly from the console, it will not work. Description of commands to add and its arguments, see below.

Commands:
  • amx_bmm_category — Open the menu categories. When adding a weapon with ZP Extra Items, in the buy menu appears item "Uncategorised", in which they are located. Using amx_bmm_category you can move the items in the appropriate category.You can also move already categorized items. Information about categories saved in file bmm_items.ini.
  • amx_bmm_additem — Adding console command in the buy menu. Usage: amx_bmm_additem <item name> <cost> <team> <flags ("" or "0" if you want to allow for all)> <command>.
  • amx_bmm_clear — Remove not used items from file.
  • amx_bmm_stats — Show weapons statistics.

Cvars:
  • bmm_on <1|0> — Enable/Disable the plugin.
  • bmm_multiple <1|0> — When registering ZP Extra Items price indicated in ammopacks, that significantly lower than the cost default weapons. This cvar multiplies the set price, if it low.
  • bmm_multiple_min <100> — Minimum price, after which it is multiplied.
  • bmm_multiple_num <1000> — How many times to multiple
  • bmm_autobuy_limit <5000> — Monetary limit for autobuy.
  • bmm_buyzone <1|0> — Enable/Disable buyzone. If 0, you can buy weapons and ammo at any point on the map.
  • bmm_autoammo <1|0> — Enable/Disable replenishment of bp ammo in respawn and the purchase of weapons.

Modules:
  • CStrike
  • Engine
  • FakeMeta
  • Fun
  • HamSandwich
  • NVault

Notes:
#1 Buy Menu Management can support the plugin "Money more than 16000".
To enable support for unlimited money, find this line at the top of the plugin code:
Code:

// #define MONEY_UL 1
...and remove the double slash before compiling.
#2 When you install the plugin on your server, from the Buy Menu disappears all the standard weapons. To get their back in the menu, install the plugin "Attachment 124061", which you also can find in the attached archive.
#3 Also the attached archive contains the plugin "Attachment 124062" that adds a C4 bomb into terrorists equipment menu. You can use it as an example of the use of plugin API.
#4 If you can help with translating plugin to other languages​​, click on this link.

Credits & Thanks:
Thanks to ConnorMcLeod for plugin BP Ammo Features;

Changelog:
Code:

— Version: 2.0 (Aug 10, 2013 MSK)
        [ADDED] Bots support.
        [ADDED] Autobuy and rebuy functions.
        [ADDED] No buyzone mode (cvar: bmm_buyzone <1|0> — enabled by default).
        [ADDED] Blocking buymenu on maps with restricting to buy weapons (awp, fy, 35hp etc). Can be switched off using a "bmm_buyzone" cvar.
        [ADDED] Statistics of popularity weapons (command: amx_bmm_stats).
        [ADDED] Full ammo in start round like CS:S (cvar: bmm_autoammo <1|0> — enabled by default).
        [IMPROVED] Standart weapons (attached plugin: bmm_standart_weapons).
        [IMPROVED] Plugin API (attached include: bmm.inc).
        [IMPROVED] Usability of the menu.
        [FIXED] Some bugs and holes.

 — Version: 1.0.1 (Mar 13, 2013 MSK)
        [FIXED] Bugs with buying weapons and switching menu.

 — Version: 1.0 (Dec 29, 2012 MSK)
        [ADDED] Ability to add console commands to the items (command: amx_bmm_additem).
        [ADDED] Registration all items in file "bmm_items.ini".
        [FIXED] Some bugs.

 — Version: 0.2beta (Dec 28, 2012 MSK)
        [ADDED] The ability to add items to certain admin levels.
        [ADDED] Number after the name if item names matches. (Item(1), Item(2) and so on).

 — Version: 0.1beta (Dec 26, 2012 MSK)
        Initial beta release.

Screenshots:
Purchase weapon, Weapons statistics in console, C4 in equipment:

[IMG]http://**************/a/img809/5580/ica0.jpg[/IMG] [IMG]http://**************/a/img829/8396/ia3c.png[/IMG] [IMG]http://**************/a/img20/1219/93mj.png[/IMG]

pokemonmaster 12-26-2012 08:56

Re: Buy Menu Management (v0.1beta)
 
Nice job! :up:

EDIT: .... Just a suggestion. (Read Whitespace)

Mr. Frost 12-26-2012 09:23

Re: Buy Menu Management (v0.1beta)
 
Quote:

Originally Posted by pokemonmaster (Post 1860611)
Just a suggestion. (Read Whitespace)

I've have long time been programmed in javascript, where white spaces are not considered optimal. For me psychologically unpleasant such whitespace. Just a habit.

YamiKaitou 12-26-2012 20:13

Re: Buy Menu Management (v0.1beta)
 
Adding whitespace does not alter the usability of any script in any language, it just makes it easier to read.

Mr. Frost 12-26-2012 21:54

Re: Buy Menu Management (v0.1beta)
 
Yes, I understand. Will appear after next update.

ConnorMcLeod 12-27-2012 02:12

Re: Buy Menu Management (v0.1beta)
 
PHP Code:

    register_native("zp_disinfect_user""_disinfect_user");
    
register_native("zp_make_user_nemesis""_make_user_nemesis");
    
register_native("zp_make_user_survivor""_make_user_survivor");
    
register_native("zp_respawn_user""_respawn_user");
    
register_native("zp_force_buy_extra_item""_force_buy_extra_item");
    
register_native("zp_override_user_model""_override_user_model");
    
register_native("zp_has_round_started""_has_round_started");
    
register_native("zp_is_nemesis_round""_is_nemesis_round");
    
register_native("zp_is_survivor_round""_is_survivor_round");
    
register_native("zp_is_swarm_round""_is_swarm_round");
    
register_native("zp_is_plague_round""_is_plague_round");
    
register_native("zp_get_zombie_count""_get_zombie_count");
    
register_native("zp_get_human_count""_get_human_count");
    
register_native("zp_get_nemesis_count""_get_nemesis_count");
    
register_native("zp_get_survivor_count""_get_survivor_count");
    
register_native("zp_register_zombie_class""_register_zombie_class");
    
register_native("zp_get_extra_item_id""_get_extra_item_id");
    
register_native("zp_get_zombie_class_id""_get_zombie_class_id");
    
register_native("zp_get_zombie_class_info""_get_zombie_class_info"); 
}
public 
_get_user_zombie() return false; public _get_user_nemesis() return false; public _get_user_survivor() return false;
public 
_get_user_first_zombie() return false;public _get_user_last_zombie() return false;public _get_user_last_human() return false;public _get_user_zombie_class() return false;public _get_user_next_class() return false;public _set_user_zombie_class() return false;public _get_user_ammo_packs() return false;public _set_user_ammo_packs() return false;public _get_zombie_maxhealth() return false;
public 
_get_user_batteries() return false;public _set_user_batteries() return false;public _get_user_nightvision() return false;public _set_user_nightvision() return false;public _infect_user() return false;public _disinfect_user() return false;public _make_user_nemesis() return false;public _make_user_survivor() return false;public _respawn_user() return false;public _force_buy_extra_item() return false;public _override_user_model() return false;public _has_round_started() return false;
public 
_is_nemesis_round() return false;public _is_survivor_round() return false;public _is_swarm_round() return false;public _is_plague_round() return false;public _get_zombie_count() return false;public _get_human_count() return false;public _get_nemesis_count() return false;public _get_survivor_count() return false;public _register_extra_item() return false;public _register_zombie_class() return false;public _get_extra_item_id() return false;public _get_zombie_class_id() return false;
public 
_get_zombie_class_info() return false

Is this a joke ?
Also, rest of code is poor, let's read wiki about plugins optimizations.
And lets user register_clcmd for all buy commands instead of hooking client_command for nothing.

Mr. Frost 12-27-2012 05:51

Re: Buy Menu Management (v0.1beta)
 
What's the harm? I wanted to make it possible to addition to my plugin ZP Extra Items. Without some natives is not possible.

Okay, I'll read it.

ConnorMcLeod 12-27-2012 12:57

Re: Buy Menu Management (v0.1beta)
 
Quote:

Originally Posted by Mr. Frost (Post 1861124)
What's the harm?

...

Mr. Frost 12-29-2012 13:37

Re: Buy Menu Management (v1.0beta)
 
Now looks good?

ghostpro1991 01-14-2013 00:34

Re: Buy Menu Management (v1.0beta)
 
How to add item from Z.P?


All times are GMT -4. The time now is 20:59.

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