View Single Post
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 07-03-2019 , 05:08   Re: [Zeph Store] Guns Menu
Reply With Quote #5

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.
Attached Files
File Type: sp Get Plugin or Get Source (Guns_Menu.sp - 174 views - 3.6 KB)
__________________

Last edited by Psyk0tik; 07-03-2019 at 05:10.
Psyk0tik is offline