AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Menus (https://forums.alliedmods.net/showthread.php?t=332800)

MacL 06-02-2021 06:30

Menus
 
hey alliedmodders, How to hook all the menus on the server? For example, when we use the following code in the plugin, if the user does not have access, it will be automatically printed that
Spoiler
Code
PHP Code:

 if( !cmd_accessidlevelcid) )
{
          return 
PLUGIN_HANDLED;


Now I want to make a change like this in the menus. For example, if the user selected exits or Back option Back in the menus Song number 1 will play for him/her . And if he/she selected any option other than Exit and Back in menus song number 2 will play for him/her.
I mean do this for all server plugins that use "Menu" (without editing them) . do i need make a new plugin for this or edit inc files? how ?
thanks.

MacL 06-11-2021 08:07

Re: Menus
 
Bump

MacL 06-30-2021 09:11

Re: Menus
 
Bump

Fuck For Fun 06-30-2021 12:19

Re: Menus
 
There is no need to use this function for player testing

Code:

    if ( cs_get_user_team( client ) != CS_TEAM_CT ) // CT / T
    {
        client_print(client, print_chat, "Error: You have no access to this command.");
        return 1;
    }

I used to use it and it worked great:

EDIT
Quote:

This is a for a team, if you're talking about access get_user_flags

MacL 06-30-2021 13:46

Re: Menus
 
Quote:

Originally Posted by Fuck For Fun (Post 2751600)
There is no need to use this function for player testing

Code:

    if ( cs_get_user_team( client ) != CS_TEAM_CT ) // CT / T
    {
        client_print(client, print_chat, "Error: You have no access to this command.");
        return 1;
    }

I used to use it and it worked great:

EDIT

what does it have to do with? did you read my request?

Fuck For Fun 07-03-2021 11:43

Re: Menus
 
Quote:

Originally Posted by MacL (Post 2751609)
what does it have to do with? did you read my request?

Are you trying to play with the BACK and EXIT buttons that will work for you on something in particular?

Old Menu that calling:>
Code:

    if(0 < page)
    {
        iLen += formatex(szMenu[iLen], charsmax(szMenu), "^n\r8. \wBack^n")
        iKeys |= MENU_KEY_8;
    }
    else iLen += formatex(szMenu[iLen], charsmax(szMenu), "^n\d8. Back^n")


MacL 07-03-2021 12:17

Re: Menus
 
Quote:

Originally Posted by Fuck For Fun (Post 2751787)
Are you trying to play with the BACK and EXIT buttons that will work for you on something in particular?

Old Menu that calling:>
Code:

    if(0 < page)
    {
        iLen += formatex(szMenu[iLen], charsmax(szMenu), "^n\r8. \wBack^n")
        iKeys |= MENU_KEY_8;
    }
    else iLen += formatex(szMenu[iLen], charsmax(szMenu), "^n\d8. Back^n")


what i'm trying to do is :
Imagine a player opening a menu in the game. He can choose between 1 and 9 or exit / back option.
Well, if the player chooses an option other than exit / back, song number 1 should be played for him. Otherwise (chooses Back option), song number 2 played for him. Now this should happen for all plugins in the server that use the menu. (Without editing them, just by creating a plugin)

Natsheh 07-03-2021 13:06

Re: Menus
 
not possible without editing the plugins one by one..

MacL 07-04-2021 16:08

Re: Menus
 
Quote:

Originally Posted by Natsheh (Post 2751799)
not possible without editing the plugins one by one..

it possible. already saw.

Natsheh 07-04-2021 16:34

Re: Menus
 
Quote:

Originally Posted by MacL (Post 2751873)
it possible. already saw.

Well attach a proof then if you already saw that.

Tbh it is possible but the only method that i could think of is through player frame think hook which is a bad idea.


All times are GMT -4. The time now is 11:31.

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