Raised This Month: $ Target: $400
 0% 

is there a chooseteam event to catch?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 06-10-2004 , 18:34   is there a chooseteam event to catch?
Reply With Quote #1

Is there a chooseteam event to catch, and how would i go about catching it?

I need to catch which team they pick. ;)
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 06-10-2004 , 20:29  
Reply With Quote #2

Code:
   register_menucmd(register_menuid("Team_Select"),(1<<0)|(1<<1),"team_select")    register_menucmd(-2,(1<<0)|(1<<1),"team_select")   // VGUI menu

I pulled this from another plugin, but how do I use it?!...I've never worked with menus before and I'm not understanding.
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
[FBX]
Senior Member
Join Date: May 2004
Old 06-10-2004 , 23:56  
Reply With Quote #3

if you look at the function that those lines of code call, it should make sense. Basically you make a function that takes in the player's ID and the number of the key he pressed and do the appropriate action. the (1<<0) is just a way of representing a byte. What those register_menucmd things do is intercept when the player presses a number on the join menu.
[FBX] is offline
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 06-11-2004 , 02:51  
Reply With Quote #4

I've tried using this, and I even tried doing server_print, etc...and the event doesn't fire!

Why isn't the event firing? -- I've switched back and forth between vgui menus and text menus and I can't get the event to fire...

Code:
   register_menucmd(register_menuid("Team_Select"),(1<<0)|(1<<1),"team_select")    register_menucmd(-2,(1<<0)|(1<<1),"team_select")   // VGUI menu } public team_select(id, key){        server_print("team_select: %s, %f, %i, %d ", key, key, key, key)        return PLUGIN_CONTINUE }
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 06-11-2004 , 07:34  
Reply With Quote #5

I think you can just register that as clcmd. Look at PTB.
Johnny got his gun 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 14:49.


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