AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Catch player choosing team. (https://forums.alliedmods.net/showthread.php?t=215398)

Napoleon_be 05-07-2013 12:13

Catch player choosing team.
 
Hi,

I need to know how to detect when a player presses the team select menu key (for example: M). I need this team select menu to be replaced by another menu, how do i this?

Unkolix 05-07-2013 12:14

Re: Catch player choosing team.
 
This might be helpful for you: http://forums.alliedmods.net/showthread.php?t=184918

Napoleon_be 05-07-2013 12:29

Re: Catch player choosing team.
 
Thanks, will try this :)

ConnorMcLeod 05-07-2013 17:17

Re: Catch player choosing team.
 
You have to let cs do the job, just alter the visual menu : http://forums.alliedmods.net/showpos...35&postcount=4

Decompiler 05-07-2013 17:47

Re: Catch player choosing team.
 
Quote:

Originally Posted by ConnorMcLeod (Post 1947727)
You have to let cs do the job, just alter the visual menu : http://forums.alliedmods.net/showpos...35&postcount=4

Not to hijack the thread, but can you force that plugin to use the oldVGUI?

ConnorMcLeod 05-07-2013 18:58

Re: Catch player choosing team.
 
Yes, just hook "chooseteam" command and set vgui pdata to false on there.
If i have to gonna do it.

Decompiler 05-07-2013 19:27

Re: Catch player choosing team.
 
Quote:

Originally Posted by ConnorMcLeod (Post 1947792)
Yes, just hook "chooseteam" command and set vgui pdata to false on there.
If i have to gonna do it.

If by the last part you mean you wouldn't mind doing it, then yeah, that would be great.
I would like to think that I know how to hook "chooseteam", but I'd rather be sure that the code is 100% good, as I'm still prone to rookie mistakes.

Decompiler 05-09-2013 19:32

Re: Catch player choosing team.
 
Would something like this work if I added it to your plugin? As it seems simpler than hooking chooseteam?

Quote:

Originally Posted by teame06 (Post 456827)
Code:
#include <amxmodx> public plugin_init() {     register_plugin("Yams", "Pants", "Anime"); } public client_connect(id) {     set_user_info(id, "_vgui_menus", "0"); }

Here this will disable the VGUI team select menu only. They will be able to still use VGUI buy menu, etc.


ConnorMcLeod 05-09-2013 20:41

Re: Catch player choosing team.
 
No, you have to set pdata, and only before you want to show your custom menu.
Don't change directly userinfo because players may like to buy with vgui menus.
pdata is set again each time client_infochanged is called.

Decompiler 05-09-2013 23:21

Re: Catch player choosing team.
 
I see, thanks. It took me a while to figure out what you meant by pdata, but now that I looked it up it all makes sense. Thanks.


All times are GMT -4. The time now is 10:51.

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