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

Menu help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SnowWolf
Junior Member
Join Date: Sep 2017
Old 12-04-2017 , 13:35   Menu help
Reply With Quote #1

Hello. I write "help me".

I registered command
RegConsoleCmd("sm_menu", cmd_menu);

I make : Public action cmd_menu, public void Table, Public MenuCallBack.
In menu call back i have:

public MenuCallBack(Handle:menu, MenuAction:action, client, position)
{
if ( action == MenuAction_Select )
{
decl String:item[40];
GetMenuItem(menu, position, item, sizeof(item));
if(StrEqual(item, "ws"))
{
PrintToChat(client,"Something")
}
}

How to change that when someone clicks on the menu "1. Menu WS" it will open the menu, which is under the command sm_ws

If someone needs more code I can send
SnowWolf is offline
brunoronning
Senior Member
Join Date: Jan 2014
Location: Brazil
Old 12-04-2017 , 14:52   Re: Menu help
Reply With Quote #2

PHP Code:
ClientCommand(client"sm_ws"); 
??

Last edited by brunoronning; 12-04-2017 at 14:52.
brunoronning is offline
SnowWolf
Junior Member
Join Date: Sep 2017
Old 12-05-2017 , 07:57   Re: Menu help
Reply With Quote #3

Full plugin:

PHP Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <sdkhooks>


public Plugin myinfo =
{
    
name "Menu",
    
author "SnowWolf",
    
description "Menu",
    
version "1.0",
    
url "steamcommunity.com/id/SnowWolfik"
};


public 
void OnPluginStart() 
{
    
RegConsoleCmd("sm_menu"cmd_menu);
}    

public 
Action cmd_menu(int clientint args)
{
    
tabeleczka(client);
    return 
Plugin_Handled;
}

public 
void tabeleczka(int client)
{
    
Handle menu CreateMenu(MenuCallBack);
    
SetMenuTitle(menu"Wybierz opcje:");
    
AddMenuItem(menu"ws""★ Wybór Skinów");
    
DisplayMenu(menuclientMENU_TIME_FOREVER);
}

public 
MenuCallBack(Handle:menuMenuAction:actionclientposition)
{
    if ( 
action == MenuAction_Select )
    {
        
decl String:item[40];
        
GetMenuItem(menupositionitemsizeof(item));
        if(
StrEqual(item"ws"))
        {
            
ClientCommand(client"sm_ws");
        }


compilation error:
D:\Komp\menu.sp(46) : error 030 : Compound statement not closed at the end of file <started at line 38>

What am I doing wrong?
SnowWolf is offline
Divin12
Senior Member
Join Date: Nov 2011
Old 12-05-2017 , 08:11   Re: Menu help
Reply With Quote #4

Quote:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <sdkhooks>


public Plugin myinfo =
{
name = "Menu",
author = "SnowWolf",
description = "Menu",
version = "1.0",
url = "steamcommunity.com/id/SnowWolfik"
};


public void OnPluginStart()
{
RegConsoleCmd("sm_menu", cmd_menu);
}

public Action cmd_menu(int client, int args)
{
tabeleczka(client);
return Plugin_Handled;
}

public void tabeleczka(int client)
{
Handle menu = CreateMenu(MenuCallBack);
SetMenuTitle(menu, "Wybierz opcje:");
AddMenuItem(menu, "ws", "★ Wybór Skinów");
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

public MenuCallBack(Handle:menu, MenuAction:action, client, position)
{
if ( action == MenuAction_Select )
{
decl String:item[40];
GetMenuItem(menu, position, item, sizeof(item));
if(StrEqual(item, "ws"))
{
ClientCommand(client, "sm_ws");
}
}
}
__________________
Divin12 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 06:40.


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