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

Making a non interactive panel


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pandachinoman
New Member
Join Date: Jan 2013
Location: Gaben's bedroom
Old 09-29-2018 , 12:37   Making a non interactive panel
Reply With Quote #1

So there's a few informational plugins that use panels to display information and they're great except that they make the number keys useless, this is bad since they're only for information and don't contain any selectable items.

I'm aware that you can use SetPanelKeys to make these keys free, but I'm a big sourcemod noob and I'm just trying to modify other people's plugins not make my own so I have no idea of where should I put it to make it work.

Let's take this plugin for example: https://forums.alliedmods.net/showthread.php?p=1274550

I tried SetPanelKeys(thepanelname, (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1< <6)|(1<<7)(1<<8)); before SendPanelToClient to make keys 1-9 free but it doesn't work, same goes for SetPanelKeys(thepanelname, 1023);

The panel still blocks the number keys except 0, this plugin creates 2 panels 1 for the spectators and the other for the people who are still playing so it's a little complicated.

If someone could point me in the right direction or know how to do it right please show me I'll be eternally grateful.
pandachinoman is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 09-29-2018 , 17:34   Re: Making a non interactive panel
Reply With Quote #2

If you want no keys, then you'd pass 0. Though I guess it'll still enable the zero key for closing the panel?
Fyren is offline
Cruze
Veteran Member
Join Date: May 2017
Old 09-30-2018 , 01:36   Re: Making a non interactive panel
Reply With Quote #3

need to know the same.
__________________
Taking paid private requests! Contact me
Cruze is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 09-30-2018 , 09:34   Re: Making a non interactive panel
Reply With Quote #4

Quote:
Originally Posted by Fyren View Post
If you want no keys, then you'd pass 0. Though I guess it'll still enable the zero key for closing the panel?
But the other keys are locked. He wants a panel with all keys unlocked. Something similar to HintText. You can press all buttons without changing the state of that hint.
Ilusion9 is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 09-30-2018 , 10:06   Re: Making a non interactive panel
Reply With Quote #5

I do something like this to simulate a non interactive panel in L4D2...while allowing the number keys to still work properly.
Note...using this with a menu your constantly refreshing with a timer can be tricky,
tweak the duration on the timer to get the best result when pressing the keys...

Code:
public int SpecMenuActions(Menu menu, MenuAction action, int param1, int param2)
{
	if(action == MenuAction_Select)
	{
		switch(param2)
		{
			case 1:
			{
				ShowSpecMenu(param1); //PUT YOUR MENU FUNCTION HERE AND IT WILL REOPEN THE MENU WHEN 1 IS PRESSED
				ClientCommand(param1, "slot1"); //THIS WILL PASS CLIENT 1 KEY(L4D2)(DEPENDING ON WHATS BOUND TO 1)
			}
			case 2:
			{
				ShowSpecMenu(param1);
				ClientCommand(param1, "slot2");
			}
			case 3:
			{
				ShowSpecMenu(param1);
				ClientCommand(param1, "slot3");
			}
			case 4:
			{
				ShowSpecMenu(param1);
				ClientCommand(param1, "slot4");
			}
			case 5:
			{
				ShowSpecMenu(param1);
				ClientCommand(param1, "slot5");
			}
			case 6:
			{
				ShowSpecMenu(param1);
				ClientCommand(param1, "slot6");
			}
			case 7:
			{
				ShowSpecMenu(param1);
				ClientCommand(param1, "slot7");
			}
			case 8:
			{
				ShowSpecMenu(param1);
				ClientCommand(param1, "slot8");
			}
			case 9:
			{
				ShowSpecMenu(param1);
				ClientCommand(param1, "slot9");
			}
			case 0:
			{
				ShowSpecMenu(param1);
				ClientCommand(param1, "slot0");
			}
		}
	}
	else if(action == MenuAction_Cancel)
	{
		//PrintToServer("Client %d's menu was cancelled.  Reason: %d", param1, param2);
	}
	else if(action == MenuAction_End)
	{
		delete menu;
	}

Last edited by MasterMind420; 09-30-2018 at 10:23.
MasterMind420 is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 09-30-2018 , 10:30   Re: Making a non interactive panel
Reply With Quote #6

Seems like you could replace that entire switch statement with:
Code:
ShowSpecMenu(param1);
ClientCommand(param1, "slot%d", param2);
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
MasterMind420
BANNED
Join Date: Nov 2010
Old 09-30-2018 , 13:41   Re: Making a non interactive panel
Reply With Quote #7

Quote:
Originally Posted by DJ Tsunami View Post
Seems like you could replace that entire switch statement with:
Code:
ShowSpecMenu(param1);
ClientCommand(param1, "slot%d", param2);
Yah good point...lol
MasterMind420 is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 10-01-2018 , 07:32   Re: Making a non interactive panel
Reply With Quote #8

Quote:
Originally Posted by MasterMind420 View Post
I do something like this to simulate a non interactive panel in L4D2...while allowing the number keys to still work properly.
Note...using this with a menu your constantly refreshing with a timer can be tricky,
tweak the duration on the timer to get the best result when pressing the keys...
But you are unable to use votes or msay or custom plugins based on panels (rules, top etc.).
Ilusion9 is offline
Reply


Thread Tools
Display Modes

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 17:21.


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