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

Prefix menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
siska15
Junior Member
Join Date: Jun 2017
Old 03-31-2023 , 04:40   Prefix menu
Reply With Quote #1

Hello!

I found a prefix menu at the link below but unfortunately the beginning is missing
I would like to have one that, would give the prefix menu as a menu for the chat command /adminprefix and as a separate vip /vipprefix only give the menu to the person who has the rights

PL: I mean something like: mute menu only on prefix menu
Admins : C right
For Vip: O right

Prefix Main menu
Admin prefix setting > your player list name > then enter your unique prefix.
VIP Prefix setting > Your player list name > then enter your unique prefix.

Someone can help you with this

Thank you in advance for your replies. everyone


Code:
    public Menu_Prefix(id) {
        new String[121], Nev[32];
        get_user_name(id, Nev, 31);
        formatex(String, charsmax(String), "[%s] \r- \d Prefix Állítás", Prefix);
        new menu = menu_create(String, "Menu_prefix_h");
       
       
        formatex(String, charsmax(String), "\wPrefix: \y%s ^n\d Írd be új prefixed nevét!", prefiszem[id]);
        menu_additem(menu, String, "2",0);
       
        if(Beirtprefix[id] == true){
            formatex(String, charsmax(String), "\rBeállítás");
            menu_additem(menu, String, "3",0);
        }
       
        menu_display(id, menu, 0);
        return PLUGIN_HANDLED;
    }
    public Menu_prefix_h(id, menu, item){
        if(item == MENU_EXIT){
            menu_destroy(menu);
            return;
        }
       
        new data[9], szName[64];
        new access, callback;
        menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
        new key = str_to_num(data);
       
        switch(key) {
            case 2:client_cmd(id, "messagemode Reg_Prefix");
                case 3:
            {
                client_print_color(id,print_team_default, "^1--------===^3[ Prefix Adatok ]^1===--------");
                client_print_color(id,print_team_default, "%s^1 A ^4Prefix:^3(%s)  ^1sikeresen ^3be ^1lett állĂ*tva!", C_Prefix, prefiszem[id]);
                client_print_color(id,print_team_default, "^1--------===^3[ PREFIX ]^1===--------");
            }
        }
    }

Last edited by siska15; 03-31-2023 at 04:40.
siska15 is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 03-31-2023 , 07:43   Re: Prefix menu
Reply With Quote #2

sorry but didn t understand what "prefix" means in this context. do you want a chat prefix for players that have a flag?
lexzor is offline
siska15
Junior Member
Join Date: Jun 2017
Old 03-31-2023 , 07:53   Re: Prefix menu
Reply With Quote #3

Quote:
Originally Posted by lexzor View Post
sorry but didn t understand what "prefix" means in this context. do you want a chat prefix for players that have a flag?
Hi, if you have admin / vip privileges, you give the /prefix command a prefix menu where you can set your own unique chat prefix only the beginning of the code is missing only the end of the code

Last edited by siska15; 03-31-2023 at 07:54.
siska15 is offline
siska15
Junior Member
Join Date: Jun 2017
Old 04-01-2023 , 06:23   Re: Prefix menu
Reply With Quote #4

Hi, the point is that admins and vipers should have a prefix menu where they can set their unique chat prefix. In the main menu you would type the /prefix command.

PL: I'm thinking something like: mute menu only in the prefix menu.
Admins : C privilege Anyone with C privilege would only display this in the main menu.
Vip : O privilege Anyone with O privilege would only display this in the main menu.

Prefix main menu
VIP Prefix setting > playlist name > then enter the unique chat prefix.
ADMIN Prefix setting > playlist name > then enter the unique chat prefix.

Or if you have H privileges, it will display the submenu of VIP prefix and admin prefix in the main menu.

The plugin home page is missing I don't know if it's possible to make the plugin work can you make it work

Thanks in advance for any help

Last edited by siska15; 04-01-2023 at 09:38.
siska15 is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-14-2023 , 10:31   Re: Prefix menu
Reply With Quote #5

Quote:
This code creates a menu with options to set VIP and admin prefixes, depending on the user's access level. Only O privilege users can set the VIP prefix, and only C privilege users can set the admin prefix. When the user selects an option and enters a new prefix, the code updates the appropriate prefix variable and notifies the user of the change.
as your request
Code:
public Menu_Prefix(id) {
    new String[121];
    formatex(String, charsmax(String), "[%s] - Prefix Setting", Prefix);
    new menu = menu_create(String, "Menu_prefix_h");

    // Only show VIP prefix setting for O privilege users
    if (get_user_flags(id) & ADMIN_FLAG_O) {
        formatex(String, charsmax(String), "\wVIP Prefix: \y%s ^n\d Enter new VIP prefix!", vip_prefix);
        menu_additem(menu, String, "2", 0);
    }

    // Only show admin prefix setting for C privilege users
    if (get_user_flags(id) & ADMIN_FLAG_C) {
        formatex(String, charsmax(String), "\wAdmin Prefix: \y%s ^n\d Enter new admin prefix!", admin_prefix);
        menu_additem(menu, String, "3", 0);
    }

    menu_display(id, menu, 0);
    return PLUGIN_HANDLED;
}

public Menu_prefix_h(id, menu, item){
    if (item == MENU_EXIT) {
        menu_destroy(menu);
        return;
    }

    new data[9], szName[64], access, callback;
    menu_item_getinfo(menu, item, access, data, charsmax(data), szName, charsmax(szName), callback);
    new key = str_to_num(data);

    switch (key) {
        case 2:
            // Only allow O privilege users to set VIP prefix
            if (!(get_user_flags(id) & ADMIN_FLAG_O)) {
                client_print_color(id, print_chat, "You do not have permission to set VIP prefix!");
                break;
            }

            // Get the new VIP prefix from user input
            new new_prefix[64];
            read_argv(1, new_prefix, charsmax(new_prefix));
            formatex(vip_prefix, charsmax(vip_prefix), "[%s] ", new_prefix);

            // Notify the user of the successful prefix change
            client_print_color(id, print_chat, "VIP prefix successfully changed to: %s", vip_prefix);
            break;

        case 3:
            // Only allow C privilege users to set admin prefix
            if (!(get_user_flags(id) & ADMIN_FLAG_C)) {
                client_print_color(id, print_chat, "You do not have permission to set admin prefix!");
                break;
            }

            // Get the new admin prefix from user input
            new new_prefix[64];
            read_argv(1, new_prefix, charsmax(new_prefix));
            formatex(admin_prefix, charsmax(admin_prefix), "[%s] ", new_prefix);

            // Notify the user of the successful prefix change
            client_print_color(id, print_chat, "Admin prefix successfully changed to: %s", admin_prefix);
            break;
    }
}
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Reply



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 08:08.


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