Raised This Month: $32 Target: $400
 8% 

'chooseteam' or 'jointeam'


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-24-2011 , 17:41   'chooseteam' or 'jointeam'
Reply With Quote #1

when someone logs ingame, there's a menu of team selection that is displayed when you type in console 'chooseteam' or 'jointeam'. After player logs in and he gets that menu, he selects a team. is there any way to detect when he's doing that? (picking a team at log in)
Diegorkable is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-24-2011 , 18:41   Re: 'chooseteam' or 'jointeam'
Reply With Quote #2

http://wiki.amxmodx.org/Half-Life_1_...vents#VGUIMenu

Each predefined menu has a unique id. Hook this event and have it print a message containing the menu id. You can use this to get the different ids for whatever menu you need to block or hook.

Returning PLUGIN_HANDLED in the hook function will block whatever menu is being called. Be careful, blocking the team choosing menus can cause server crashes in some cases.

http://wiki.amxmodx.org/Half-Life_1_...vents#ShowMenu could also be useful depending on what you're doing.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Old 07-24-2011, 18:56
Diegorkable
This message has been deleted by Diegorkable. Reason: irrelevant
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-24-2011 , 19:12   Re: 'chooseteam' or 'jointeam'
Reply With Quote #3

You know what, IGNORE WHAT I ASKED FOR.
There's a bug in CS that if you use the command amx_team or set some user's team before he picks a team by himself from the 'chooseteam' menu, he gets bugged and he has no zoom or lower bar(with HP, armor, bullets etc...), he has to choose a team from the 'chooseteam' menu in first place and only then cs_set_user_team or amx_team commands will work on him properly without bugs.

I want in my script that when someone logs in, it closes the 'chooseteam' menu(that i already did and it works), and instead of that sets him in the team I want, but the problem is that he gets bugged cuz he hasnt picked a team yet! And also I blocked 'chooseteam' menu so even if he tried to pick it wouldnt work cuz the command doesnt work.

Can you help me find an alternative on how to do that? (set someone in a team when you close his chooseteam menu and sets him in a team without him picking a team, which cause the bugs all the time...)
Diegorkable is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-24-2011 , 19:23   Re: 'chooseteam' or 'jointeam'
Reply With Quote #4

This plugin will help you identify the id of whatever menu you want when it comes up on a player's screen.

Code:
#include <amxmodx> public plugin_init() {     register_message( get_user_msgid( "VGUIMenu" ), "MessageVGUIMenu" ) } public MessageVGUIMenu( msgid, dest, id ) {     new str[4]     num_to_str( get_msg_arg_int( 1 ), str, 3 )         log_amx( str )     client_print( 0, print_chat, str ) }

Let's say you find that the menu id you want to detect is 99. You would then do something like this:

Code:
#include <amxmodx> public plugin_init() {     register_message( get_user_msgid( "VGUIMenu" ), "MessageVGUIMenu" ) } public MessageVGUIMenu( msgid, dest, id ) {     if( get_msg_arg_int( 1 ) == 99 )     {         // the menu has been detected     } }

EDIT: Threads stick around after they're solved for a reason. Other people may be having this issue and may be searching for a solution. A solution was given above, but now you're trying to make this into a 2nd thread for the same issue you're trying to address in another thread. Please organize these threads.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 07-24-2011 at 19:31.
wrecked_ is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-24-2011 , 19:49   Re: 'chooseteam' or 'jointeam'
Reply With Quote #5

I still don't get what you tell me, you're not comprehensive. What is this ID 99? how do I know which ID has the menu of picking a team? all you show me is a code that does it and i dont know how to continue it cuz im really confused.
Diegorkable is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-24-2011 , 20:20   Re: 'chooseteam' or 'jointeam'
Reply With Quote #6

Quote:
Originally Posted by Diegorkable View Post
I still don't get what you tell me, you're not comprehensive. What is this ID 99? how do I know which ID has the menu of picking a team? all you show me is a code that does it and i dont know how to continue it cuz im really confused.
He gave you that code as a tool. He didn't do anything for you. It will print the IDs of the menus when they happen. The 99 was hypothetical.
__________________
fysiks is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-25-2011 , 06:36   Re: 'chooseteam' or 'jointeam'
Reply With Quote #7

ahhh ok, sorry im just confused as hell.
but i have a dilemma about it, I want to block for everyone the 'chooseteam' and 'jointeam' command so they can't join a team during the match, and what if someone logs in the middle of a match? he won't be able then to get in a team.... so I can cs_set_user_team him automatically to the team that has less members, right? well wrong cuz if you set someone's team before he picks a team by himself, he simply gets bugged really hard and wierd things happen to him like getting stuck, having no weapon, have no bar HP.

Can anyone help me think of an alternative?
Diegorkable is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-25-2011 , 06:58   Re: 'chooseteam' or 'jointeam'
Reply With Quote #8

Well, how does Exolent's plugin work then?
__________________
fysiks is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-25-2011 , 07:20   Re: 'chooseteam' or 'jointeam'
Reply With Quote #9

I tried to read it, still many functions I don't understand, i'm not that expert to read his high-leveled scripting, functions i've never used, but I get the whole idea, he's detecting if someone's at the chooseteam menu, and if the auto team join is on 1 he gets auto moved, but i dont understand how is he doing that....
Diegorkable is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-25-2011 , 16:07   Re: 'chooseteam' or 'jointeam'
Reply With Quote #10

Quote:
Originally Posted by Diegorkable View Post
I tried to read it, still many functions I don't understand, i'm not that expert to read his high-leveled scripting, functions i've never used, but I get the whole idea, he's detecting if someone's at the chooseteam menu, and if the auto team join is on 1 he gets auto moved, but i dont understand how is he doing that....
You will spend less time looking into it and understanding each function one by one than you will trying to find an alternative, messy solution.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ 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 18:14.


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