AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How do you block radio commands? (https://forums.alliedmods.net/showthread.php?t=47141)

Geesu 11-10-2006 21:02

How do you block radio commands?
 
As the topic asks...

I'm having issues with wc3 where a user selects an item from a shopmenu and a radio command is executed as well, so I'd like to temporarily block radio commands while the shopmenu is up.

Thanks!

The Specialist 11-10-2006 21:18

Re: How do you block radio commands?
 
here you go

http://forums.alliedmods.net/showthread.php?t=45461
:up:

Geesu 11-10-2006 21:30

Re: How do you block radio commands?
 
Tried it... radio commands aren't triggered...

At least they're not triggered on a per-player basis (I did a print out to each entity if it was a valid player and nothing was ever printed when executing a command...)

p3tsin 11-11-2006 07:21

Re: How do you block radio commands?
 
just return PLUGIN_HANDLED in the function thats called on the menu key press,
that will block the menuselect cmd from going to other menus "under" ur custom menu.

thats the ONLY way to do it, coz they can have some other menu under it than just one of the radio menus.. :?

Zenith77 11-11-2006 08:27

Re: How do you block radio commands?
 
To clarify, register a menu hook of the raido menu. Then maybe use a global var to see if there viewing the shopmenu and return PLUGIN_HANDLED on the hook. However, I'm not sure this will work, because the command may be "handled" before AMXX even calls your forward, in which it just wouldn't work. This has been gone over a million times, you can't override default commands, but menus may be a different story (fat chance).

Geesu 11-11-2006 11:01

Re: How do you block radio commands?
 
How do I register a hook on the radio menus?

Zenith77 11-11-2006 12:39

Re: How do you block radio commands?
 
register_menu(), and then just put the title of the menu in register_menucmd() [Note: I forgot the exact natives].

VEN 11-11-2006 15:10

Re: How do you block radio commands?
 
Please stop confuse the author of the thread, p3tsin already fully and clearly answered how to solve that issue.

Geesu 11-11-2006 15:40

Re: How do you block radio commands?
 
TY for posting that VEN, I totally even missed what p3tsin said.... I just changed all of it + am compiling now


All times are GMT -4. The time now is 20:17.

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