Raised This Month: $32 Target: $400
 8% 

[L4D2] Admiral Menu - The Ultimate VIP Plugin (2.3) | 20/10/2022


Post New Thread Reply   
 
Thread Tools Display Modes
Author
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Plugin ID:
8192
Plugin Version:
2.3
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Display Admiral Menu For Your Loyal Players
    Unapprover:
    Reason for Unapproving:
    no source
    Old 09-23-2022 , 21:19   [L4D2] Admiral Menu - The Ultimate VIP Plugin (2.3) | 20/10/2022
    Reply With Quote #1

    « L4D2 Admiral Menu »


    About:
    • This plugin I'm calling it "Admiral Menu"
    • It allows only selected players to have access to it.
    • You can add a tag to admiral players, and change their text color
    • You can spawn them with higher hp value
    • They can receive health when killing special infected
    • And multiple more stuff, you can check the menu list below


    The Menu List:
    • Admiral Duties: These are simple text lines to show admirals the rules they should follow.
    • Server Commands: These are external commands from other plugins for easy access.
    • Appearance: You can change your skin color, aura, particles and trails.
    • Weapons Menu: This a list of weapons/upgrades admirals can select, you can adjust how many weapons admirals are allowed to select through a cvar.
    • Teams Manager: To display teams, join specific team, takeover, swap players
    • Vote System: You can vote map, vote restart, vote shuffle, vote slay, vote kick, vote ban as an admiral.
    • Settings: To view your profile, enable chat prefix, auto laser activation, manage admiral players as an admin only.


    To Do List:
    • Adding Config Data > Done
    • Adding Membership Timer > Done
    • Adding More Weapons and Upgrades > Done
    • Adding Vote Restart > Done


    Credits: (Many Thanks - You Guys Are Awesome)
    • Special Thanks To: Dragokas: for completely adding the config data. You are an incredible scripter who made the game better for us.
    • Silvers
    • AtomicStryker
    • King_OXO
    • 000
    • Eyal282
    • Eddie
    • Sourcemod


    Commands:
    • sm_admiral > To display the admiral menu
    • sm_admins > To display the admirals and admins list
    • sm_admiral_reload > To refresh the data file after editing L4D2_Admiral_Menu.cfg to enforce the new changes.


    Cvars:
    PHP Code:
    // This file was auto-generated by SourceMod (v1.11.0.6911)
    // ConVars for plugin "L4D2_Admiral_Menu.smx"


    // Enable Admiral Menu To Autherized Players (Admins and Admirals).
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_admiral_menu_enable "1"

    // Add Special Tag Prefix And Color Change To Admiral Players When Using Chats.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_admiral_tag_prefix "1"

    // Block Team Switch Menu, And Allow Changing Teams Throw Admiral Menu Only.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_admiral_team_menu_access "1"

    // Set How Many Weapons Survivors Are Allowed To Pick From The Weapons Menu.
    // -
    // Default: "1"
    l4d2_admiral_weapons_selection "1"

    // Set Survivors Max Health (Health Above 100 Will Unlock Maximum Healing Limit)
    // -
    // Default: "125"
    // Minimum: "0.000000"
    // Maximum: "65535.000000"
    l4d2_admiral_survivors_health "125"

    // Set The Ammount Of Health Admirals Will Get After Killing Special Infected
    // -
    // Default: "5"
    // Minimum: "0.000000"
    // Maximum: "65535.000000"
    l4d2_admiral_survivors_lifesteal "5"

    // Set The Smoke RGB Color (Seperated By Space): <Red> <Green> <Blue> (0-255)
    // -
    // Default: "16 122 0"
    l4d2_admiral_smoke_color "16 122 0"

    // Set The Damage Ammount (Every 2 Seconds) When Someone Trapepd Inside The Smoke
    // -
    // Default: "4.0"
    l4d2_admiral_smoke_damage "4.0"

    // Set The Time Duration Before The Smoke Fades Away (In Seconds)
    // -
    // Default: "20.0"
    l4d2_admiral_smoke_duration "20.0"

    // Allow Smoke Ability For The Speical Infected (Located In The Upgrades Section)
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d2_admiral_smoke_enable "1"

    // Set The Time Duration After Which Infected Can Use The Smoke Ability Again (In Seconds)
    // -
    // Default: "60.0"
    l4d2_admiral_smoke_locktime "60.0"

    // Set The Length Of A Vote Ban (In Minutes), After A Successfuly Vote Ban Occurs.
    // -
    // Default: "30"
    // Minimum: "0.000000"
    l4d2_admiral_vote_ban_time "30"

    // Set The Minimum Delay (In Seconds) Between Each Vote To Avoid Abusing It.
    // -
    // Default: "120"
    // Minimum: "0.000000"
    l4d2_admiral_vote_delay "120"

    // Set The Minimum Number Of Players Required To Be Able To Initiate A Vote.
    // -
    // Default: "3"
    // Minimum: "0.000000"
    // Maximum: "32.000000"
    l4d2_admiral_vote_minplayers "3"

    // Set The Minimum Percentage Required For A Successful Vote.
    // -
    // Default: "0.51"
    // Minimum: "0.010000"
    // Maximum: "1.000000"
    l4d2_admiral_vote_percent "0.51" 
    Requirements:
    • None


    Installation:
    • Make sure to delete the old "L4D2_Admiral_Menu.smx" from your "\addons\sourcemod\plugins" folder.
    • Extract "L4D2_Admiral_Menu.zip" file in your "\addons\sourcemod" folder.


    Who can access to the admiral menu?
    • Any admin and all registered admirals


    How to add a player to the admiral list?
    • Method 1: As an admin, type "!admiral", then go to the last section called "Settings", then "Manage Admirals", after that select a player you want to add as an admiral and adjust time for them.
    • Method 2: As a server owner, go to "data" folder located in "\addons\sourcemod\data", and search for a file called "L4D2_Admiral_Menu.cfg", you will find a section called "Admirals List", follow the existed example, then after adding their steam id, go to the game and type "!admiral_reload" to refresh the data file.
    • Note: When editing "data/L4D2_Admiral_Menu.cfg", if the admiral duration is set to "-1", this will give a permanent access to the menu, and any value above 0, is equal to the access duration in seconds


    How to change the rules or add more external commands?
    • Go to "data" folder located in "\addons\sourcemod\data", and search for a file called "L4D2_Admiral_Menu.cfg", you would find 2 sections, one for rules and the other one for commands, then after adding your desired rules/commands, go to the game and type "!admiral_reload" to refresh the data file.


    How a player can display the admiral tag or change the text color?
    • When you set someone as an admiral, they should access to the menu by typing "!admiral" and then go to "Settings". Then they should toggle chat prefix (set it to "Yes"), and then go to "Change Text Color", and select your desired color.


    Updates:
    Code:
    • 20-10-2022 > Version 2.3: Adding more texts color, and general fixes.
    • 15-10-2022 > Version 2.2: Fixing some particles positions, and adding an option to change texts color
    • 14-10-2022 > Version 2.1: Clearing admiral ghosts, thanks to Dragokas, and fixed some bugs
    • 11-10-2022 > Version 2.0: Data file was added, thanks to Dragokas and some general updates
    • 24-09-2022 > Version 1.0: Initial release
    This is now a private plugin and is not allowed to be shared in public
    __________________

    Last edited by alasfourom; 04-03-2023 at 20:53. Reason: Plugin Updated: v2.0
    alasfourom is offline
    alasfourom
    Senior Member
    Join Date: Feb 2022
    Location: Saudi Arabia
    Old 09-23-2022 , 21:22   Re: [L4D2] Admiral Menu - A Simplified VIP Menu (1.0) | 09/24/2022
    Reply With Quote #2

    if someone can create a data file, to adjust rules + external commands > I would credit them, since I'm not familiar with it.
    __________________
    alasfourom is offline
    Earendil
    Senior Member
    Join Date: Jan 2020
    Location: Spain
    Old 09-24-2022 , 05:55   Re: [L4D2] Admiral Menu - A Simplified VIP Menu (1.0) | 09/24/2022
    Reply With Quote #3

    Quote:
    Originally Posted by alasfourom View Post
    if someone can create a data file, to adjust rules + external commands > I would credit them, since I'm not familiar with it.
    Data files can be created using KeyValues. I made a plugin that uses a config file with KeyValues to save/load the spawn position and settings of entities, https://forums.alliedmods.net/showthread.php?p=2750321, take a look on it.

    KeyValues API reference.
    __________________
    >>My plugins<<
    >>GitHub<<
    Earendil is offline
    alasfourom
    Senior Member
    Join Date: Feb 2022
    Location: Saudi Arabia
    Old 09-24-2022 , 10:18   Re: [L4D2] Admiral Menu - A Simplified VIP Menu (1.0) | 09/24/2022
    Reply With Quote #4

    Quote:
    Originally Posted by Earendil View Post
    Data files can be created using KeyValues. I made a plugin that uses a config file with KeyValues to save/load the spawn position and settings of entities, https://forums.alliedmods.net/showthread.php?p=2750321, take a look on it.

    KeyValues API reference.
    thanks Earendil, u r always great help to me, I will give that a look

    for now, if anyone wanted to add external commands, 2 steps are needed:

    1- you go to the original script, and search for "Create_CommandsMenu", you will notice multiple CMDs, like CMD1, CMD2 etc, near each CMD, "NONE" > add the name of your command you want players to see, so it should be looking like this:
    PHP Code:
    void Create_CommandsMenu(int client)
    {
        
    Menu menu = new Menu(Handle_CommandsMenu);
        
    menu.SetTitle("Server Commands:");
        
    menu.AddItem("CMD1""!admins - Online Admins");
        
    menu.AddItem("CMD2""!buy - Buy Stuff");
        
    menu.AddItem("CMD3""!lmc - Change Your Model");
        
    menu.AddItem("CMD4""None");
        
    menu.AddItem("CMD5""None");
        
    menu.AddItem("CMD6""None");
        
    menu.AddItem("CMD7""None");
        
    menu.ExitBackButton true;
        
    menu.Display(clientMENU_TIME_FOREVER);

    2- the last thing, you need to go to "Handle_CommandsMenu", you need here to add the command related to each item you added, for example in the previous exampled, we added "!buy" for "CMD2", so in the "Handle_CommandsMenu", you go to the CMD2, and add the command itself, in this way FakeClientCommand(param1, "sm_buy"); Here is how it should look like:
    PHP Code:
    int Handle_CommandsMenu(Menu menuMenuAction actionint param1int param2)
    {
        switch(
    action)
        {
            case 
    MenuAction_Select:
            {
                
    char item[64];
                
    menu.GetItem(param2itemsizeof(item));
                
    menu.DisplayAt(param1GetMenuSelectionPosition(), MENU_TIME_FOREVER);
                
                if         (
    StrEqual(item"CMD1")) FakeClientCommand(param1"sm_admins");
                else if (
    StrEqual(item"CMD2")) FakeClientCommand(param1"sm_buy");
                else if (
    StrEqual(item"CMD3")) FakeClientCommand(param1"sm_lmc");
                else if (
    StrEqual(item"CMD4")) PrintToChat(param1"Not Applicable");
                else if (
    StrEqual(item"CMD5")) PrintToChat(param1"Not Applicable");
                else if (
    StrEqual(item"CMD6")) PrintToChat(param1"Not Applicable");
                else if (
    StrEqual(item"CMD7")) PrintToChat(param1"Not Applicable");
            }
            case 
    MenuAction_Cancel:
            {
                if (
    param2 == MenuCancel_ExitBack
                {
                    
    Create_AdmiralMenu(param1);
                }
            }
        }
        return 
    0;

    __________________
    alasfourom is offline
    King_OXO
    Senior Member
    Join Date: Dec 2020
    Location: Brazil
    Old 09-24-2022 , 12:43   Re: [L4D2] Admiral Menu - A Simplified VIP Menu (1.0) | 09/24/2022
    Reply With Quote #5

    create a version in which we don't need to put steam in cvar. Change to a data file in sourcemod/data to add the vip to the player by steam id and add a time of how many days/hours/minutes the player can stay with the vip like vip core
    __________________
    My Noob Plugins

    Discord:WhiteFire#1301
    Steam:WhiteFire
    Youtube

    Last edited by King_OXO; 09-24-2022 at 12:45.
    King_OXO is offline
    alasfourom
    Senior Member
    Join Date: Feb 2022
    Location: Saudi Arabia
    Old 09-24-2022 , 12:57   Re: [L4D2] Admiral Menu - A Simplified VIP Menu (1.0) | 09/24/2022
    Reply With Quote #6

    Quote:
    Originally Posted by King_OXO View Post
    create a version in which we don't need to put steam in cvar. Change to a data file in sourcemod/data to add the vip to the player by steam id and add a time of how many days/hours/minutes the player can stay with the vip like vip core
    Adding time period for membership was in my todo list, I will release a new update, but it will take time for me since I have my board exam soon, I need to prepare for it. But I will definitely try to do so.

    Thanks for the suggestions
    __________________
    alasfourom is offline
    alasfourom
    Senior Member
    Join Date: Feb 2022
    Location: Saudi Arabia
    Old 09-24-2022 , 13:00   Re: [L4D2] Admiral Menu - A Simplified VIP Menu (1.0) | 09/24/2022
    Reply With Quote #7

    Quote:
    Originally Posted by 000 View Post
    You can also look below for examples.
    Less code, simple and the main thing done there is what you need.

    https://forums.alliedmods.net/showthread.php?t=338542

    https://forums.alliedmods.net/showthread.php?t=338544

    Hint: Focus on arrays to get and set values.
    I will check them, thanks for the two examples
    __________________
    alasfourom is offline
    insobniut2004
    Member
    Join Date: Feb 2022
    Old 09-24-2022 , 14:18   Re: [L4D2] Admiral Menu - A Simplified VIP Menu (1.0) | 09/24/2022
    Reply With Quote #8

    xdd okey
    what a nice plugin you created )
    __________________
    insobniut2004 is offline
    eyal282
    Veteran Member
    Join Date: Aug 2011
    Old 09-25-2022 , 08:47   Re: [L4D2] Admiral Menu - A Simplified VIP Menu (1.0) | 09/24/2022
    Reply With Quote #9

    A cvar is a horrible way to add VIP. You can copy from another plugin that uses a database ( to give temporary admiral ) or config file.
    __________________
    I am available to make plugins for pay.

    Discord: Eyal282#1334
    eyal282 is offline
    alasfourom
    Senior Member
    Join Date: Feb 2022
    Location: Saudi Arabia
    Old 09-25-2022 , 09:25   Re: [L4D2] Admiral Menu - A Simplified VIP Menu (1.0) | 09/24/2022
    Reply With Quote #10

    Quote:
    Originally Posted by eyal282 View Post
    A cvar is a horrible way to add VIP. You can copy from another plugin that uses a database ( to give temporary admiral ) or config file.
    I’m currently trying to understand the KeyValues, to create a configuration file, I never used it before, but now since I have seen multiple examples, I will be working on it. I think I can manage to add their steam id through a config file.
    __________________

    Last edited by alasfourom; 09-25-2022 at 09:31.
    alasfourom is offline
    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 05:52.


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