AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Helps Menu (https://forums.alliedmods.net/showthread.php?t=286031)

PHHAAKE 08-06-2016 07:06

Helps Menu
 
3 Attachment(s)
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/

good_live 08-06-2016 07:48

Re: Helps Menu
 
Sourcecode?

Arkarr 08-06-2016 08:53

Re: Helps Menu
 
Quote:

Originally Posted by good_live (Post 2442708)
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;



PHHAAKE 08-06-2016 09:19

Re: Helps Menu
 
How You Decompiled That ?

Arkarr 08-06-2016 11:47

Re: Helps Menu
 
Quote:

Originally Posted by PHHAAKE (Post 2442731)
How You Decompiled That ?

http://i.imgur.com/iZcUNxH.gif
No seriously, share the source code. It's against the rules to not share it.


All times are GMT -4. The time now is 00:10.

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