AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   is there a chooseteam event to catch? (https://forums.alliedmods.net/showthread.php?t=2600)

ThantiK 06-10-2004 18:34

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

I need to catch which team they pick. ;)

ThantiK 06-10-2004 20:29

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.

[FBX] 06-10-2004 23:56

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.

ThantiK 06-11-2004 02:51

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 }

Johnny got his gun 06-11-2004 07:34

I think you can just register that as clcmd. Look at PTB.


All times are GMT -4. The time now is 14:49.

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