Raised This Month: $ Target: $400
 0% 

[CSS] Menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
delachambre
AlliedModders Donor
Join Date: Jan 2011
Location: France
Old 12-06-2013 , 07:30   [CSS] Menu
Reply With Quote #1

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
__________________
♥ 𝕊ℙ𝕒𝕨𝕟 𝔻𝕖𝕧𝕖𝕝𝕠𝕡𝕖𝕣 [ℂ𝕊:𝕊] ♥

Clan-Nemesis
delachambre is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 12-06-2013 , 10:48   Re: [CSS] Menu
Reply With Quote #2

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.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.
GsiX is offline
delachambre
AlliedModders Donor
Join Date: Jan 2011
Location: France
Old 12-06-2013 , 12:05   Re: [CSS] Menu
Reply With Quote #3

Thanks for your reply,

It's not that because it's the same for my mate ... :/
__________________
♥ 𝕊ℙ𝕒𝕨𝕟 𝔻𝕖𝕧𝕖𝕝𝕠𝕡𝕖𝕣 [ℂ𝕊:𝕊] ♥

Clan-Nemesis
delachambre is offline
delachambre
AlliedModders Donor
Join Date: Jan 2011
Location: France
Old 12-07-2013 , 08:07   Re: [CSS] Menu
Reply With Quote #4

UP,

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

I don't understand...
__________________
♥ 𝕊ℙ𝕒𝕨𝕟 𝔻𝕖𝕧𝕖𝕝𝕠𝕡𝕖𝕣 [ℂ𝕊:𝕊] ♥

Clan-Nemesis
delachambre is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 12-07-2013 , 08:58   Re: [CSS] Menu
Reply With Quote #5

Code:
SetMenuExitButton(Menu, true);
Before you display it
__________________
retired

Last edited by shavit; 12-07-2013 at 08:58.
shavit is offline
delachambre
AlliedModders Donor
Join Date: Jan 2011
Location: France
Old 12-07-2013 , 14:37   Re: [CSS] Menu
Reply With Quote #6

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.
__________________
♥ 𝕊ℙ𝕒𝕨𝕟 𝔻𝕖𝕧𝕖𝕝𝕠𝕡𝕖𝕣 [ℂ𝕊:𝕊] ♥

Clan-Nemesis
delachambre 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 07:51.


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