AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [CSS] Menu (https://forums.alliedmods.net/showthread.php?t=231001)

delachambre 12-06-2013 07:30

[CSS] Menu
 
Hello,

I have a big problem with my ******** menu, i must be crazy !

Code:

Handle:SellAppart(Seller, Buyer)
{
    if (IsClientInGame(Seller) && IsPlayerAlive(Seller) && IsClientInGame(Buyer) && IsPlayerAlive(Buyer))
    {
        new Handle:Menu = CreateMenu(Menu_SellAppart);
   
        SetMenuTitle(Menu, "Hello :");
       
        AddMenuItem(Menu, "1", "TEST");
       
        DisplayMenu(Menu, Seller, 30);
    }
}

public Menu_SellAppart(Handle:menu_sellappart, MenuAction:action, param1, param2)
{
    if (action == MenuAction_Select)
    {
        decl String:info[32];
           
        GetMenuItem(menu_sellappart, param2, info, sizeof(info));
       
        PrintToChatAll("MENUACTION SELECT.");
       
        if (StrEqual(info, "1"))
        {
            PrintToChatAll("Hello World.");
        }
    }
    else
    {
        if (action == MenuAction_End)
        {
            PrintToChatAll("MENUACTION END.");
           
            CloseHandle(menu_sellappart);
        }
    }
}

The menu opens but nothing happens when I choose "TEST", not even a debug messages "
MENUACTION SELECT" or "MENUACTION END" ....





I would appreciate you to help me because I really do not see what Sourcemod does not understand in that.

Thanks you in advance

GsiX 12-06-2013 10:48

Re: [CSS] Menu
 
Well i try to give my opinion..

If you spot noting wrong with your code, try check your key bind. Make sure you
bind"0" "slot0" and so on... Just guessing tho, it happen to me.

delachambre 12-06-2013 12:05

Re: [CSS] Menu
 
Thanks for your reply,

It's not that because it's the same for my mate ... :/

delachambre 12-07-2013 08:07

Re: [CSS] Menu
 
UP,

When the menu is open, I instantly have "MENUACTION END" (it's my PrintToChat called when action == MenuAction_End)...

I don't understand...

shavit 12-07-2013 08:58

Re: [CSS] Menu
 
Code:

SetMenuExitButton(Menu, true);
Before you display it

delachambre 12-07-2013 14:37

Re: [CSS] Menu
 
Thanks for your reply Shavit !

Now it's solved, the problem was that I opened two menu at the same time...

Thanks you @ll for your reply.


All times are GMT -4. The time now is 12:53.

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