AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Weapon Menu Creator [ V 1.0 ] (https://forums.alliedmods.net/showthread.php?t=245803)

HamletEagle 08-07-2014 07:23

Weapon Menu Creator [ V 1.0 ]
 
1 Attachment(s)
Weapons Menu Creator 1.0
Release: 07.08.2014 | Last Update: 14.03.2015


!!!!!!THIS NEW UPDATE IS NOT COMPATIBLE WITH OLD CONFIGURATION FILES. PLEASE BACKUP YOUR MENU ITEMS AND DELETE THE OLD FILE. A NEW ONE MUST BE GENERATED WITH A NEW NAME.!!!!!

Basically, this plugin has a simple goal, to make servers owners work much easier. Many of them use custom weapons menu, and when they want a change, they mus make another request.
With this one, they can simply edit a file, change the map, and they have a new weapons menu.

Some features that this plugin provides:
  • Easy edit your menu from a file.
  • You can have two menus: primary & secondary weapons.
  • You can set how many bullets you want for each weapon.
  • You can set some admin acces for weapons.
  • You can set a price for a weapon, or let it free.

As a note, you are not forced to have a primary and a secondary menu. If you want one to be disabled, don't add weapons to it.

Table of Contents

Commands
Cvars
Installation
File Configuration Guide
Possible Use
Change Log
Downloads

Commands
top


Code:

  • say/say_team /weapons

    This command will open the weapons menu.
    Command will fail in this situations:
    - player not alive
    - player already choosed weapons
    - different team from the one set by cvar


Cvars
top


Code:

  • team_acces

    With this cvar you can decide what team can use weapons menu
    0 - both team can use menu
    1 - only T can use menu
    2 - only CT can use menu
    3 - no team can use menu. Plugin will be paused.


Installation
top


You must compile locally, with this cusatom INCLUDE.
  • Download the files provided at the end of this post.
  • Put the amxx file into addons/amxmodx/plugins.
  • Put the sma file into addons/amxmodx/scripting ( OPTIONAL ).
  • Open addons/amxmodx/configs/plugins.ini and add at the end of the file plugin_name.amxx
  • Restart/Change MAP

You don't need to care about the file, it's created automatically into addons/amxmodx/configs with the name weapons_menu_creator.ini

File Configuration Guide
top


Code:

  • Basic information:

    You add primary weapons at [PRIMARY] section.
    You add secondary weapons  at [SECONDARY] section.
    You add weapons in this format Weapon Bullets Acces Price

  • Weapon Names

    You can find a list of all primary and secondary weapons into the file.
    You are free to write the names how you want( capitalized or not ).

  • Admin flags

    They are described into the file.
    ALL      - allow all players to use the item from the menu.
    NOONE - restricted to all. This make the item to DON'T appear in the menu
    ADMIN - anyone with AdminAcces flag set can acces the item.

    AdminAcces d
    Change this to whatever you want(same letters like the ones from users.ini), this is needed admin acces to use restricted items in menu.

  • Bullets

    There is a max ammo to set up, but I can't remember the exact ammount.
    If you want to set up default values, just search on the wiki, there is a list.

  • Price

    You are able to set up a price for every weapon.
    Use 0 to make the weapon free.

  • Building your menu

    A line example: SG550 205 ALL 0
    If you want to  mix them, so you will have both, primary & secondary weapons in the same menu, just let one of the menus empty and add into the other one the weapons you want ( TESTED by zmd ).


Possible Use
top


You could use this for a furien server, so you will create very easy anti furiens menu.
If for some reason you want to block the original buy menu, you may use this to create your own.


Change Log
top


Code:

  • V 0.1
    + Initial release

  • V 0.2:
    + Fixed a bug with cs_set_user_money native
    + Fixed two bugs when changing teams

  • V 0.3:
    + Optimized the way in which menus were created
    + Changed my code style
    + Hope that cs_get_user_money bug is gone forever
    + Removed formatex, now using fprintf

  • V 0.4:
    + Fixed a stupid mistake that I left behing
    + Fixed a strange bug with NOONE acces flag.
    + Now menus are destroyed in plugin_end to free memory

  • V 0.5:
    + Removed value 3 from team_acces cvar
    + Changed a bit my coding style, making the code more readable
    + Fixed a silly mistake when creating the file.
    + Optimized the code
    + Fixed menu disaply bug
    + Fixed a potential bug when the plugin will think your menu is still open

  • V 1.0:
    + Rewrote entire plugin.
    + Fixed two weapons bug
    + Modified the way in which access are used.
    + Now you can set admin access from file.
    + Fixed run-time errors.
    + Remove bitsums, they were silly.
    + Changed file name.
    + Improved the way in which menus can be used(no more problems). A better handling was needed.


Downloads
top
  • V 0.1 : ~ 32 downloads
  • V 0.2 : ~ 89 downloads
  • V 0.3: ~ 29 downloads
  • V 0.4: ~ 88 downloads
  • v 0.6 : ~ 230 DOWNLOADS

zmd94 08-07-2014 07:38

Re: Weapon Menu Creator [ V 0.1 ]
 
Thank you for sharing. I will test it. ;)

HamletEagle 08-08-2014 04:49

Re: Weapon Menu Creator [ V 0.1 ]
 
Quote:

Originally Posted by zmd94 (Post 2180271)
Thank you for sharing. I will test it. ;)

Ok, I'm waiting for your feedback, hope everything is ok.

Flick3rR 08-08-2014 11:22

Re: Weapon Menu Creator [ V 0.1 ]
 
Well, it's actually pretty neat and working properly. Could be very useful for people, who don't want all the weapons in their buy menu. Good job and keep it on!

zmd94 08-08-2014 12:29

Re: Weapon Menu Creator [ V 0.1 ]
 
I have tested the plugin and it is working. However, I have a bad and good news.

The bad news is I have encountered this problems:
Quote:

L 08/09/2014 - 00:06:10: [AMXX] Run time error 10 (plugin "advanced_menu_creator.amxx") (native "cs_get_user_money") - debug not enabled!
L 08/09/2014 - 00:06:10: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
And after debug:
Quote:

L 08/09/2014 - 00:08:47: [CSTRIKE] Invalid player 5
L 08/09/2014 - 00:08:47: [AMXX] Displaying debug trace (plugin "advanced_menu_creator.amxx", version "0.1")
L 08/09/2014 - 00:08:47: [AMXX] Run time error 10: native error (native "cs_get_user_money")
L 08/09/2014 - 00:08:47: [AMXX] [0] advanced_menu_creator.sma::UTIL_HandleBothMen us (line 441)
L 08/09/2014 - 00:08:47: [AMXX] [1] advanced_menu_creator.sma::PrimaryWeapHandler (line 376)
The good news is the weapon menu is working. I have tested to mix both primary & secondary weapons in the same menu. It is working. Below is the screenshot:

http://img.ctrlv.in/img/14/08/08/53e4fa6e153e8.jpg

http://img.ctrlv.in/img/14/08/08/53e4fad43e146.jpg

HamletEagle 08-08-2014 13:59

Re: Weapon Menu Creator [ V 0.1 ]
 
Ok, I was thinking that the error you ecountered could appear, will fix it soon.

zmd94 08-08-2014 19:31

Re: Weapon Menu Creator [ V 0.1 ]
 
Quote:

Originally Posted by HamletEagle (Post 2181114)
I will fix it soon.

:up:

We will wait for the update.

HamletEagle 08-09-2014 04:46

Re: Weapon Menu Creator [ V 0.2 ]
 
Code:

V 0.2:
+Fixed a bug with cs_set_user_money native
+Fixed two bugs when changing teams


zmd94 08-09-2014 05:32

Re: Weapon Menu Creator [ V 0.2 ]
 
Quote:

Originally Posted by HamletEagle
V 0.2:
+Fixed a bug with cs_set_user_money native
+Fixed two bugs when changing teams

Nice. ;)

I'll test again.

Eagle07 08-15-2014 05:35

Re: Weapon Menu Creator [ V 0.2 ]
 
GJ.. (y)

HamletEagle 08-22-2014 08:02

Re: Weapon Menu Creator [ V 0.3 ]
 
Updated:

Code:

+ Optimized the way in which menus were created
+ Changed my code style
+ Hope that cs_get_user_money bug is gone forever
+ Removed formatex, now using fprintf


Dare.Devil 08-23-2014 09:29

Re: Weapon Menu Creator [ V 0.3 ]
 
1 Attachment(s)
can you PLEASE show me how to add the following weapons??

I can't find a weapons menu to work so far..

here are the weapons
thunderblot-oicw-needler-janus11-gatling-cannon-balrog3

the weapons mentioned above are not CS 1.6 native like AK47 or AWP etc..

however they work 100% perfect on console commands.. e.g admin_get_gatling
All weapons I personally tested & work 100% in normal CS 1.6 gameplay

I saw your reply from before but I think this plugins suits my needs best..
Thanks in advance MR HamletEagle

HamletEagle 08-23-2014 10:02

Re: Weapon Menu Creator [ V 0.3 ]
 
Quote:

Originally Posted by Dare.Devil (Post 2188221)
can you PLEASE show me how to add the following weapons??

I can't find a weapons menu to work so far..

here are the weapons
thunderblot-oicw-needler-janus11-gatling-cannon-balrog3

the weapons mentioned above are not CS 1.6 native like AK47 or AWP etc..

however they work 100% perfect on console commands.. e.g admin_get_gatling
All weapons I personally tested & work 100% in normal CS 1.6 gameplay

I saw your reply from before but I think this plugins suits my needs best..
Thanks in advance MR HamletEagle

It's not possible to add them with this plugin. Since they are not default cs weapons, weapon_oicw is unknow :)

Dare.Devil 08-23-2014 11:21

Re: Weapon Menu Creator [ V 0.3 ]
 
too bad..well thanks anyway

HamletEagle 08-29-2014 08:54

Re: Weapon Menu Creator [ V 0.4 ]
 
Updated: Be sure to download this version, 0.3 one has a strange bug with NOONE acces flag.

erkike93 09-08-2014 15:12

Re: Weapon Menu Creator [ V 0.4 ]
 
Nice plugin, i was wondering if this could work for jailbreak server? I mean, some maps haven't enough weapons at spawn for the Guardians, and the Prisoners rebeled, and we can't make, wars and battles games with weapons, so if i use and add this plugins to my jailbreak source to work only with Simon, can be possible to him say /weapons and gets weap for all? or this just work like a normal command for each player? Anyways thanks i a really pretty plugin i was looking for something like this, i'll test it.

HamletEagle 09-10-2014 04:19

Re: Weapon Menu Creator [ V 0.4 ]
 
New source uploaded, in the old one I missed a ";" and it wasn't compiling.

Syturi0 09-10-2014 06:28

Re: Weapon Menu Creator [ V 0.4 ]
 
"[ Weapons ] Your weapons menu is already open"

Doesnt seems to be working for me

HamletEagle 09-10-2014 07:31

Re: Weapon Menu Creator [ V 0.4 ]
 
I don't have any problems. This message will appear only if you already have the menu open. Please explain when you used this command, your team, etc.

Edit: I see what it was, will be fixed soon. Until then, simply don't exit secondary menu without choosing an item.

Adventx 09-10-2014 11:19

Re: Weapon Menu Creator [ V 0.4 ]
 
Good Job :)

Gabriel963 10-07-2014 15:53

Re: Weapon Menu Creator [ V 0.4 ]
 
Nice, good job.

UFBBaBaCoOl 10-08-2014 06:03

Re: Weapon Menu Creator [ V 0.4 ]
 
Work for me, but some bugs still appears

- Say the menu is already open when it isnt (when typing /weapons after I closed the spawn menu)
- Show the munitions instead of the price... (should be the opposite)

Suggestions, make new flag to determine wich of CT or Terro can buy the weapon (very usefull for furiens, jailbreak ... etc)

HamletEagle 10-10-2014 10:33

Re: Weapon Menu Creator [ V 0.4 ]
 
Quote:

Originally Posted by UFBBaBaCoOl (Post 2208562)
Work for me, but some bugs still appears

- Say the menu is already open when it isnt (when typing /weapons after I closed the spawn menu)
- Show the munitions instead of the price... (should be the opposite)

Suggestions, make new flag to determine wich of CT or Terro can buy the weapon (very usefull for furiens, jailbreak ... etc)

Fixed. team_acces to control the team.

Syturi0 10-10-2014 10:45

Re: Weapon Menu Creator [ V 0.5 ]
 
is it possible to make the weapon menu only work in buyzone, instead of the spawn? because some custom maps have buyzones outside the spawn

HamletEagle 10-10-2014 10:50

Re: Weapon Menu Creator [ V 0.5 ]
 
Quote:

Originally Posted by Syturi0 (Post 2209432)
is it possible to make the weapon menu only work in buyzone, instead of the spawn? because some custom maps have buyzones outside the spawn

Yes, will consider this as an aditional feature in the next release. Also, you are not forced to use it at spawn, you can use /weapons command everywhere in the map.

Syturi0 10-10-2014 10:55

Re: Weapon Menu Creator [ V 0.5 ]
 
Quote:

Originally Posted by HamletEagle (Post 2209434)
Yes, will consider this as an aditional feature in the next release. Also, you are not forced to use it at spawn, you can use /weapons command everywhere in the map.

Okey, i will wait till next realese. :)
Quote:

Also, you are not forced to use it at spawn, you can use /weapons command everywhere in the map.
You are right, but the way i want in my server is to only work at BuyZone, and no need to '/weapons' command.

vase070 03-03-2015 00:49

Re: Weapon Menu Creator [ V 0.5 ]
 
Code:

L 03/03/2015 - 06:43:51: Start of error session.
L 03/03/2015 - 06:43:51: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20150303.log")
L 03/03/2015 - 06:43:51: [CSTRIKE] Invalid player 9
L 03/03/2015 - 06:43:51: [AMXX] Displaying debug trace (plugin "advanced_menu_creator.amxx")
L 03/03/2015 - 06:43:51: [AMXX] Run time error 10: native error (native "cs_get_user_money")
L 03/03/2015 - 06:43:51: [AMXX]    [0] 138663.attach::UTIL_HandleBothMenus (line 433)
L 03/03/2015 - 06:43:51: [AMXX]    [1] 138663.attach::hPrimaryWeapHandler (line 338)

also with the plugin ON when i join a team i does not spawn me :)

feifei 03-06-2015 02:11

Re: Weapon Menu Creator [ V 0.5 ]
 
after 1st round when I type /weapons

then I have 2 primary weapons and 2 secondary weapons :o

Primary:-
http://i.imgur.com/LnK9t6X.png

Secondary:-
http://i.imgur.com/DL1Idwq.png

Please FiX it :)

And it will be more fun if you also add Equipment and block default buy menu which menu is show when you press "b"

and you can also bind it, I mean when any1 press "b" that time Weapon Menu will show.

1. Primary
2. secondary
3. Equipment
4. auto-buy (we can set auto-buy weapons and equipments for T and CT)
5. re-buy (if any ony buy anything then he can also buy that weapons and equipments by pressing 5)

Jhob94 03-06-2015 06:44

Re: Weapon Menu Creator [ V 0.5 ]
 
To fix double weapon, use this

HamletEagle 03-06-2015 07:59

Re: Weapon Menu Creator [ V 0.5 ]
 
Quote:

Originally Posted by Jhob94 (Post 2270221)
To fix double weapon, use this

I'm already working for fixing this plugin and also improving it :) Just wait

Jhob94 03-06-2015 09:28

Re: Weapon Menu Creator [ V 0.5 ]
 
Quote:

Originally Posted by HamletEagle (Post 2270258)
I'm already working for fixing this plugin and also improving it :) Just wait

It was a recommendation to him so he could do a fast fix before you update it :crab:

feifei 03-06-2015 11:25

Re: Weapon Menu Creator [ V 0.5 ]
 
Quote:

Originally Posted by HamletEagle (Post 2270258)
I'm already working for fixing this plugin and also improving it :) Just wait

I'm Waiting... B|

HamletEagle 03-08-2015 10:33

Re: Weapon Menu Creator [ V 0.5 ]
 
Quote:

Originally Posted by vase070 (Post 2268958)
Code:

L 03/03/2015 - 06:43:51: Start of error session.
L 03/03/2015 - 06:43:51: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20150303.log")
L 03/03/2015 - 06:43:51: [CSTRIKE] Invalid player 9
L 03/03/2015 - 06:43:51: [AMXX] Displaying debug trace (plugin "advanced_menu_creator.amxx")
L 03/03/2015 - 06:43:51: [AMXX] Run time error 10: native error (native "cs_get_user_money")
L 03/03/2015 - 06:43:51: [AMXX]    [0] 138663.attach::UTIL_HandleBothMenus (line 433)
L 03/03/2015 - 06:43:51: [AMXX]    [1] 138663.attach::hPrimaryWeapHandler (line 338)

also with the plugin ON when i join a team i does not spawn me :)

About the last problem, give me a way to reproduce, because I never had problems when spawning.

claudiuhks 03-11-2015 08:35

Re: Weapon Menu Creator [ V 0.5 ]
 
Well, just a suggestion, not something eagerness to change..

You can just use multiple lines like that, by only using one native at a time. No need of 10-20 FPutS.

PHP Code:

fn()
{
    
server_print(\
"SERVER^n\
Exactly^n\
Yes"
);

//

    
server_print(\
"\
Yes^n\
No^n\
Cancel\
"
); // easier to edit the content


It should be faster, even if not easier to edit. Also, no there are no indentation problems with this.

Code:

UTIL_HandleBothMenus ( id,item, iType )
{
        if( !FBitGet(bs_is_alive, id) || is_user_bot( id ) )
        {
                return 1;
        }

I think it would be better to clear all bits on client_disconnect(). No need of bAlive = TRUE if disconnected.

HamletEagle 03-14-2015 14:37

Re: Weapon Menu Creator [ V 1.0 ]
 
Updated to 1.0, everything fixed. I hope it is working fine now.

!!!!!!THIS NEW UPDATE IS NOT COMPATIBLE WITH OLD CONFIGURATION FILES. PLEASE BACKUP YOUR MENU ITEMS AND DELETE THE OLD FILE. A NEW ONE MUST BE GENERATED WITH A NEW NAME.!!!!!

deadman909 04-10-2015 05:48

Re: Weapon Menu Creator [ V 1.0 ]
 
1 Attachment(s)
You should add the StripWeapons.inc file in your attachments instead of in the post.

Also. Something nice would be if you could find a way to add the ability to add weapons from other plugins like Bazzoka, Arrow, etc. Not sure if possible but sure would be nice.

HamletEagle 04-10-2015 06:01

Re: Weapon Menu Creator [ V 1.0 ]
 
Quote:

Originally Posted by deadman909 (Post 2284272)
You should add the StripWeapons.inc file in your attachments instead of in the post.

Also. Something nice would be if you could find a way to add the ability to add weapons from other plugins like Bazzoka, Arrow, etc. Not sure if possible but sure would be nice.

For 100th time, this is not possible. Well, it may be, but it will take too much time and would require this weapons to be edited.

Jhob94 04-10-2015 06:34

Re: Weapon Menu Creator [ V 1.0 ]
 
Quote:

Originally Posted by HamletEagle (Post 2284275)
For 100th time, this is not possible. Well, it may be, but it will take too much time and would require this weapons to be edited.

Dias WeaponPP does it and runs just fine.
Require much time yes, but i guess it would add something unique into this. I mean, the plugin as it is basickly already exist.

Kz1.0 04-10-2015 07:49

Re: Weapon Menu Creator [ V 1.0 ]
 
Quote:

Originally Posted by Jhob94 (Post 2284280)
Dias WeaponPP does it and runs just fine.
Require much time yes, but i guess it would add something unique into this. I mean, the plugin as it is basickly already exist.

What is WeaponPP ?

deadman909 04-10-2015 07:54

Re: Weapon Menu Creator [ V 1.0 ]
 
Quote:

Originally Posted by HamletEagle (Post 2284275)
For 100th time, this is not possible. Well, it may be, but it will take too much time and would require this weapons to be edited.

Okay thanks. Great plugin. I edit your version to make it work somewhat with Special Weapons =).
Loving it. Still not perfect but working on it LOL.

Also is it just me experiencing this. Although I do not have the money I still get the gun. I do however get the message that I do not have enough money but guns still is given.

For me I just added a return in this line to stop giving me the gun.

PHP Code:

    if(Money Data[WeaponPrice])
    {
        
client_print(idprint_chat"You don't have enough money")
        
menu_display(idHandlePrimaryMenu0)
        return
    } 



All times are GMT -4. The time now is 12:13.

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