Raised This Month: $12 Target: $400
 3% 

AGM + AimGlow v2.0.2 [24/04/2020]


Post New Thread Reply   
 
Thread Tools Display Modes
MC.TSHIRT
Senior Member
Join Date: Dec 2010
Old 11-25-2011 , 10:42   Re: Glow Menu (Unfinished)
Reply With Quote #11

No specials
add :

1. Aimglow
2. Normal glow
3. Glow All
4. Glow All Random
__________________
MC.TSHIRT is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 11-25-2011 , 17:42   Re: Glow Menu (Unfinished)
Reply With Quote #12

Napoleon_be

Nice plugin! Good job.
__________________



pacheco is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-25-2011 , 18:33   Re: Glow Menu (Unfinished)
Reply With Quote #13

Quote:
Originally Posted by pacheco View Post
Napoleon_be

Nice plugin! Good job.
thanks!

EDIT: Updated the plugin!
- menu_destroy() fixed
- Added changable prefix <"amx_prefix "[AMXx]"">
__________________

Last edited by Napoleon_be; 09-19-2016 at 10:59.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 06-02-2016 , 05:55   Re: Glow Menu by NapoleoN#
Reply With Quote #14

Uploaded a new version today.

Improved some code.

Hardcoding will be fixed soon.
__________________

Last edited by Napoleon_be; 06-07-2016 at 14:06.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
WAR3DM
Senior Member
Join Date: Mar 2016
Old 06-08-2016 , 23:43   Re: Glow Menu by NapoleoN#
Reply With Quote #15

Nice 1, will use on server.
WAR3DM is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-12-2020 , 08:47   Re: Glow Menu by NapoleoN#
Reply With Quote #16

Plugin has been fully rewritten.

Colors are now customizable through a .txt file.

All info on first post.

I'd like to ask an approver to reconsider this plugin as it has improved A LOT.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-12-2020 , 09:15   Re: Advanced GlowMenu v2.0.0 [12/04/2020]
Reply With Quote #17

In addition to the things I mentioned in your other thread:

1.

PHP Code:
for(new isizeof(szCommands); i++) {
        
#if AMXX_VERSION_NUM < 183
        
formatex(szChatcharsmax(szChat), "say %s"szCommands[i]);
        
register_clcmd(szChat"CheckSettings");

        
formatex(szChatcharsmax(szChat), "say_team %s"szCommands[i]);
        
register_clcmd(szChat"CheckSettings");
        
#else
        
register_clcmd(fmt("say %s"szCommands[i]), "CheckSettings");
        
register_clcmd(fmt("say_team %s"szCommands[i]), "CheckSettings");
        
#endif
    

szChat is not defined anywhere. Same goes for szTemp down below.

You should try compiling under 1.8.2 before releasing.

2.

PHP Code:
public CheckSettings(id) {
    if(
get_user_flags(id) & ADMIN_KICK && get_pcvar_num(pAdminsOnly)) {
        
menu_display(idiMainMenu);
    }

    else if(!
get_pcvar_num(pAdminsOnly)) {
        
menu_display(idiMainMenu);
    }

=>

PHP Code:
public CheckSettings(id) {
    if(
get_user_flags(id) & ADMIN_KICK || !get_pcvar_num(pAdminsOnly)) {
        
menu_display(idiMainMenu);
    }

3.

Code:
menu_item_getinfo(iColorMenu, item, _, szRGB, charsmax(szRGB));

This won't compile under 1.8.2 either because the third parameter is not optional in that version.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-12-2020 , 09:23   Re: Advanced GlowMenu v2.0.0 [12/04/2020]
Reply With Quote #18

@OciXCrom, Should all be fixed, also szTemp[] is declared. Just using the same array over and over again so i don't have to declare 10 different arrays for the same purpose.

EDIT:

Fixed 2 menu's, one menu to go. Everything should look fine now except for the menu.
__________________

Last edited by Napoleon_be; 04-12-2020 at 11:29.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-12-2020 , 16:30   Re: Advanced GlowMenu v2.0.0 [12/04/2020]
Reply With Quote #19

All bugs and mistakes should be fixed. Uploaded new code.

EDIT: Reuploaded the code, forgot a menu_destroy().
__________________

Last edited by Napoleon_be; 04-12-2020 at 16:43.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-13-2020 , 09:44   Re: Advanced GlowMenu v2.0.0 [12/04/2020]
Reply With Quote #20

1.

Code:
#if AMXX_VERSION_NUM < 190 new szTemp[250]; #endif

You're checking if the version is 1.9 here, but check 1.8.3 everywhere else.
I'd suggest you stick to checking it it's 1.9 because the 1.8.3 build that the end-person is using may not have all the necessary functions (older builds).

2. Line 98:

Code:
iMainMenu = menu_create(fmt("%L", id, "MAIN_MENU_HEADER"), "MainMenuHandler");

Like I said, you don't need to do this in 1.9. The proper usage would be:

Code:
iMainMenu = menu_create("MAIN_MENU_HEADER", "MainMenuHandler", true);

Same goes when you're adding the items:

Code:
menu_additem(iRemoveMenu, fmt("%L", id, szRemoveMenuText[i]));

=>

Code:
menu_additem(iRemoveMenu, szRemoveMenuText[i]);

3. Line 128:

Code:
menu_item_getinfo(iColorMenu, item, iAccess, szRGB, charsmax(szRGB));

This still won't compile under 1.8.2. Here's the function's usage in that version:

Code:
native menu_item_getinfo(menu, item, &access, info[], infolen, name[]="", namelen=0, &callback);

As you can see, the "callback" argument is mandatory, so you need to use it as well.

4.

Code:
public GlowTarget(id) {     new iPlayerMenu;     FormatPlayerMenu(id, iPlayerMenu, "%L", "CHOOSE_PLAYER_GLOW", "GlowPlayerHandler");
    bGlowTarget = true;
}

What happens when multiple players use the menu at the same time? This variable should have a separate value for each player - "bGlowTarget[33]". Same goes for "bGlowAll" and "iGlowTarget".

5. Line 188:

Code:
public GlowTarget(id) {
    new iPlayerMenu;
    FormatPlayerMenu(id, iPlayerMenu, "%L", "CHOOSE_PLAYER_GLOW", "GlowPlayerHandler");     bGlowTarget = true; }

This variable is not used in any way here. Same goes for the "RemoveGlowPlayer" function.
If you want to pass the the value from "FormatPlayerMenu" to "iPlayerMenu", you need to assign the argument as "&iPlayerMenu" in the function's body:

Code:
public FormatPlayerMenu(id, &iPlayerMenu, szHeader[], szData[], szHandler[])

But, you don't need to do this because you're not using the local "iPlayerMenu" variable in any function, so just declare it inside "FormatPlayerMenu"'s code block, not inside its body.

6. Line 313:

Code:
new iFilePointer = fopen("addons/amxmodx/configs/GlowMenu.txt", "rt");

Don't hardcode paths. Use "amx_configsdir" to get the "configs" directory, then add the filename to it.

7.

Code:
aColorInfo = ArrayCreate(250); new szColorData[200]; new szLine[64]; new szRGB[50];

Be consistent. You're using different buffer sizes for the exact same strings here. 250 is overkill.

8.

Code:
log_amx("%s", szLine);

=>

Code:
log_amx(szLine);

Should this even be in the code? Pretty sure you forgot to remove it when testing.

9. Line 341:

Code:
for(new i; i < iNum; i++) {         get_user_name(iPlayers[i], szName, charsmax(szName));         num_to_str(get_user_userid(iPlayers[i]), szUserId, charsmax(szUserId));         menu_additem(iPlayerMenu, szName, szUserId);     }

You should cache "iPlayers[i]" since you're using it more than once:

Code:
iPlayer = iPlayers[i]

10. Line 360:

Code:
for(new i; i < ArraySize(aColorInfo); i++) {

The array size won't ever change, so cache it in a global variable after reading the file.

11. Line 368:

Code:
formatex(szTemp, charsmax(szTemp), "%s", szColor); menu_additem(iColorMenu, szTemp, szColorData);

=>

Code:
menu_additem(iColorMenu, szColor, szColorData);
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:34.


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