AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [Zeph Store] Guns Menu (https://forums.alliedmods.net/showthread.php?t=316728)

Pilo 06-07-2019 06:30

[Zeph Store] Guns Menu
 
2 Attachment(s)
[Store] Guns Menu


Since I didn't saw any good guns menus so I decided to do my own.

Requirements : Zephyrus Store

Commands :
Code:

sm_guns
Cvars :
Code:

sm_gunsmenu_vip_only // Make the command only for VIP's (Zeph Store)
Feel free to ask for more plugins or upgrades to this plugin :D
Enjoy.

xoxo_ 06-08-2019 04:34

Re: [Zeph Store] Guns Menu
 
nice!

skyler.b 06-11-2019 07:53

Re: [Zeph Store] Guns Menu
 
so let's talk about the issues are in this mod
1) you added to the menu manually all the names while they are in the char array
why not do it in a for loop and add them less lines less cancer
2)you have memory leak when people are accessing the menu.
3) too many defines for a 200 lines code, there are like 9 defines in this mode and that only 200 lines,
declaring a '#DEFINE' doesn't make you a person knows to code it is for making your life easy on repeated and unchanged values

paulo_crash 07-02-2019 20:15

Re: [Zeph Store] Guns Menu
 
Need to upgrade to include new CSGO weapons.

It would be interesting also if put option of credits to use the command or even to pick up the weapons, that is, to pay with credits to choose any one of the weapons.

Psyk0tik 07-03-2019 05:08

Re: [Zeph Store] Guns Menu
 
2 Attachment(s)
Here's a revised version.

Changes
- Cut down on all the hard-coded names and console commands. (Used the given char arrays with for-loops.)
- Less lines because why not?
- Removed some redundancies.
- Fixed name inconsistencies.

Note: I don't play CS:GO but I think users still deserve a fully functional and optimized plugin. No offense to the original author but parts of the code looked half-assed/copy-pasted. :/



Notes for the author:
- When defining local variables inside a menu handler, try to limit them inside the MenuAction that you're using them in. Don't use menu.GetItem outside of MenuAction_Select, etc.
- When storing strings in a char array, use them in your code instead of hard-coding the same strings over and over.
- You can use ConVar.BoolValue instead of GetConVarInt(ConVar) == 1 if you're just checking for 0/1 values.
- Do your best to cut down on redundant code, like hard-coding the same menu items in nested if/if-else statements.

Psyk0tik 07-03-2019 05:11

Re: [Zeph Store] Guns Menu
 
Quote:

Originally Posted by skyler.b (Post 2655214)
so let's talk about the issues are in this mod
1) you added to the menu manually all the names while they are in the char array
why not do it in a for loop and add them less lines less cancer
2)you have memory leak when people are accessing the menu.
3) too many defines for a 200 lines code, there are like 9 defines in this mode and that only 200 lines,
declaring a '#DEFINE' doesn't make you a person knows to code it is for making your life easy on repeated and unchanged values

The #define's in his code make sense but I do agree that he doesn't necessarily need them for such a small plugin.

Pilo 07-04-2019 09:42

Re: [Zeph Store] Guns Menu
 
Quote:

Originally Posted by Crasher_3637 (Post 2657572)
Here's a revised version.

Changes
- Cut down on all the hard-coded names and console commands. (Used the given char arrays with for-loops.)
- Less lines because why not?
- Removed some redundancies.
- Fixed name inconsistencies.

Note: I don't play CS:GO but I think users still deserve a fully functional and optimized plugin. No offense to the original author but parts of the code looked half-assed/copy-pasted. :/



Notes for the author:
- When defining local variables inside a menu handler, try to limit them inside the MenuAction that you're using them in. Don't use menu.GetItem outside of MenuAction_Select, etc.
- When storing strings in a char array, use them in your code instead of hard-coding the same strings over and over.
- You can use ConVar.BoolValue instead of GetConVarInt(ConVar) == 1 if you're just checking for 0/1 values.
- Do your best to cut down on redundant code, like hard-coding the same menu items in nested if/if-else statements.

Thanks!

ocampas 07-27-2020 11:03

Re: [Zeph Store] Guns Menu
 
I am attempting to recompile your plugin but I am missing the <store> library, where can I find this.

Thanks.

rehashmusic 07-27-2020 11:29

Re: [Zeph Store] Guns Menu
 
what does this do?
Can i put decoy/molotov/hegrenade in store to buy only?


All times are GMT -4. The time now is 18:45.

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