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

How get menu initiator?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ZASTRELIS
Veteran Member
Join Date: Nov 2010
Location: Siberia, Irkutsk
Old 10-23-2020 , 14:12   How get menu initiator?
Reply With Quote #1

Code:
MenuVoteban = BuildVotebanMenu();
MenuVoteban.Display(client, MENU_TIME_FOREVER);
this code fired menu

Code:
public int Menu_Voteban(Menu menu, MenuAction action, int param1, int param2) {
}
Code:
Menu BuildVotebanMenu() {
    Menu menu = new Menu(Menu_Voteban);
}
But I can't fully understand how I can get menu owner at menu building (BuildVotebanMenu)..
Need to be exclude it from ITEM_DRAW_DISABLED
Attached Images
File Type: jpg vote.jpg (6.2 KB, 38 views)

Last edited by ZASTRELIS; 10-23-2020 at 14:24.
ZASTRELIS is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 10-23-2020 , 15:05   Re: How get menu initiator?
Reply With Quote #2

Quote:
Originally Posted by ZASTRELIS View Post
Code:
MenuVoteban = BuildVotebanMenu();
MenuVoteban.Display(client, MENU_TIME_FOREVER);
this code fired menu

Code:
public int Menu_Voteban(Menu menu, MenuAction action, int param1, int param2) {
}
Code:
Menu BuildVotebanMenu() {
    Menu menu = new Menu(Menu_Voteban);
}
But I can't fully understand how I can get menu owner at menu building (BuildVotebanMenu)..
Need to be exclude it from ITEM_DRAW_DISABLED
param1 is the menu initiator.
__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF is offline
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 10-23-2020 , 18:31   Re: How get menu initiator?
Reply With Quote #3

Quote:
Originally Posted by SSheriFF View Post
param1 is the menu initiator.
"The two cell arguments meaning depend on the MenuAction argument. A common mistake is to assume param1 is the client. This is incorrect for MenuAction_Start, MenuAction_End, MenuAction_VoteEnd, MenuAction_VoteStart, and MenuAction_VoteCancel."

https://wiki.alliedmods.net/Menus_St...uAction_Select
__________________
kratoss1812 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 10:13.


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