Raised This Month: $7 Target: $400
 1% 

Helps Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author
PHHAAKE
Member
Join Date: Aug 2016
Location: Iran
Plugin ID:
5305
Plugin Version:
Plugin Category:
All
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Old 08-06-2016 , 07:06   Helps Menu
    Reply With Quote #1

    Description:
    Thats A Basic Helps Menu For all Players Playing in Server!


    how to install:

    Put Helps.smx in addons/sourcemod/plugins/
    Put Helps.sp in addons/sourcemod/scripting/
    Put helps.cfg in addons/sourcemod/configs/
    Attached Files
    File Type: smx Helps.smx (5.3 KB, 243 views)
    File Type: cfg helps.cfg (284 Bytes, 532 views)
    File Type: sp Get Plugin or Get Source (Helps.sp - 761 views - 5.6 KB)

    Last edited by PHHAAKE; 08-06-2016 at 12:43.
    PHHAAKE is offline
    good_live
    AlliedModders Donor
    Join Date: Oct 2013
    Old 08-06-2016 , 07:48   Re: Helps Menu
    Reply With Quote #2

    Sourcecode?
    good_live is offline
    Arkarr
    Veteran Member
    Join Date: Sep 2012
    Location: Just behind my PC screen
    Old 08-06-2016 , 08:53   Re: Helps Menu
    Reply With Quote #3

    Quote:
    Originally Posted by good_live View Post
    Sourcecode?
    Not the original one, but very close :
    PHP Code:
    #include <sourcemod>
    #include <adminmenu>

    Handle g_CvarDescMode;
    int Item;

    public 
    Plugin myinfo =
    {
        
    name "Simple Help Menu",
        
    description "Help",
        
    author "PHHAKE",
        
    version "1.3",
        
    url ""
    };

    public 
    void OnPluginStart()
    {
        
    RegConsoleCmd("sm_helps"HelpsMenu_Func);
        
    RegAdminCmd("sm_showhelps"ShowHelpsADMFLAG_CHAT);
        
    g_CvarDescMode CreateConVar("sm_helps_descmode""0""Set to 0 if you want Help to be show on a menu ,and 1 if you want it to show on chat .");
    }

    public 
    Action HelpsMenu_Func(int clientint args)
    {
        
    CreateHelpsMenu(client0);
        
    PrintToChat(client"\x04[Helps] \x03You Have \x01succefully openned \x03Helps Menu!");
        return 
    Plugin_Handled;
    }

    public 
    Action ShowHelps(int clientint args)
    {
        
    Handle PlayersMenu CreateMenu(HelpsMenuHandler);
        
    SetMenuTitle(PlayersMenu"Send Helps To Player");
        
    SetMenuExitButton(PlayersMenutrue);
        
    AddTargetsToMenu2(PlayersMenuclient36);
        
    DisplayMenu(PlayersMenuclient15);
        return 
    Plugin_Handled;
    }

    public 
    int CreateHelpsMenu(int clientint item)
    {
        
    Handle HelpsMenu CreateMenu(HelpsMenuHandler);
        
    SetMenuTitle(HelpsMenu"Help Menu");
        
    Handle kv CreateKeyValues("Helps""""");
        
    FileToKeyValues(kv"addons/sourcemod/configs/helps.cfg");
        if (!
    KvGotoFirstSubKey(kvtrue))
        {
            
    //Handle error here
            
    return 0;
        }
        
        
    char HelpNumber[64];
        
    char HelpName[256];
        do
        {
            
    KvGetSectionName(kvHelpNumber64);
            
    KvGetString(kv"help"HelpName255"");
            
    AddMenuItem(HelpsMenuHelpNumberHelpName0);
        }
        while (
    KvGotoNextKey(kvtrue));
        
    CloseHandle(kv);
        
    DisplayMenuAtItem(HelpsMenuclientitem15);
        return 
    0;
    }

    public 
    int HandlerBackToMenu(Handle menuMenuAction actionint param1int param2)
    {
        if (
    action == MenuAction_End)
        {
            
    CreateHelpsMenu(param1Item);
        }
        else
        {
            if (
    action == MenuAction_DrawItem)
            {
                
    PrintToServer(""param1param2);
            }
            if (
    action == MenuAction_Cancel)
            {
                
    CloseHandle(menu);
            }
        }
        return 
    0;
    }

    public 
    int HelpsMenuHandler(Handle menuMenuAction actionint param1int param2)
    {
        if (
    action == MenuAction_Select)
        {
            
    Handle kv CreateKeyValues("Helps""""");
            
    FileToKeyValues(kv"addons/sourcemod/configs/helps.cfg");
            if (!
    KvGotoFirstSubKey(kvtrue))
            {
                return  
    0;
            }
            
    char buffer[256];
            
    char choice[256];
            
    GetMenuItem(menuparam2choice255);
            do
    {
                
    KvGetSectionName(kvbuffer255);
                if (
    StrEqual(bufferchoicetrue))
                {
                    
    char HelpName[256];
                    
    char HelpDescription[256];
                    
    KvGetString(kv"help"HelpName255"");
                    
    KvGetString(kv"info"HelpDescription255"");
                    if (
    GetConVarInt(g_CvarDescMode))
                    {
                        
    PrintToChat(param1"\x04[Helps] \x03%s : \x01%s"HelpNameHelpDescription);
                        
    Item GetMenuSelectionPosition();
                        
    CreateHelpsMenu(param1Item);
                    }
                    else
                    {
                        
    char Help[256];
                        
    char Desc[256];
                        
    Format(Help255"%s"HelpName);
                        
    Format(Desc255"%s"HelpDescription);
                        
    Item GetMenuSelectionPosition();
                        
    Handle DescriptionPanel CreatePanel();
                        
    SetPanelTitle(DescriptionPanelHelpfalse);
                        
    DrawPanelText(DescriptionPanel" ");
                        
    DrawPanelText(DescriptionPanelDesc);
                        
    DrawPanelText(DescriptionPanel" ");
                        
    DrawPanelItem(DescriptionPanel"Back"0);
                        
    SendPanelToClient(DescriptionPanelparam1HandlerBackToMenu15);
                    }
                }
            }
            while (
    KvGotoNextKey(kvtrue));
            
    CloseHandle(kv);
        }
        else
        {
            if (
    action == MenuAction_DrawItem)
            {
                
    PrintToServer(""param1param2);
            }
            if (
    action == MenuAction_Cancel)
            {
                
    CloseHandle(menu);
            }
        }
        return 
    0;
    }

    public 
    Action ShowHelpsHandler(Handle menuMenuAction actionint param1int param2)
    {
        if (
    action == MenuAction_Select)
        {
            
    char UserId[64];
            
    GetMenuItem(menuparam2UserId64);
            
    int i_UserId StringToInt(UserId10);
            
    int client GetClientOfUserId(i_UserId);
            
    CreateHelpsMenu(client1);
        }
        else
        {
            if (
    action == MenuAction_DrawItem)
            {
                
    PrintToServer(""param1param2);
            }
            if (
    action == MenuAction_Cancel)
            {
                
    CloseHandle(menu);
            }
        }
        return 
    Plugin_Continue;

    __________________

    Last edited by Arkarr; 08-06-2016 at 08:56.
    Arkarr is offline
    PHHAAKE
    Member
    Join Date: Aug 2016
    Location: Iran
    Old 08-06-2016 , 09:19   Re: Helps Menu
    Reply With Quote #4

    How You Decompiled That ?
    PHHAAKE is offline
    Arkarr
    Veteran Member
    Join Date: Sep 2012
    Location: Just behind my PC screen
    Old 08-06-2016 , 11:47   Re: Helps Menu
    Reply With Quote #5

    Quote:
    Originally Posted by PHHAAKE View Post
    How You Decompiled That ?

    No seriously, share the source code. It's against the rules to not share it.
    __________________

    Last edited by Arkarr; 08-06-2016 at 11:48.
    Arkarr is offline
    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 22:51.


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