Raised This Month: $ Target: $400
 0% 

Checking which team you picked


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 11-08-2011 , 14:34   Checking which team you picked
Reply With Quote #1

Hey guys,

I want to check which team a guy picked on the teams menu, so I used this:

PHP Code:
register_message(get_user_msgid("VGUIMenu"), "message_VGUIMenu"); 
I guess the public message_VGUIMenu will get called when a player picks a team from that menu, no? Anyways, I get 3 parameters on that public I think:

PHP Code:
public message_VGUIMenu(iMsgidiDestid
how can I check from these 3 parameters if ( the team he picked == terror ) or if ( the team he picked == ct ) etc etc...

Am I doing it correct? if no help me please.

Thanks in advance.
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 11-08-2011 , 14:39   Re: Checking which team you picked
Reply With Quote #2

http://www.amxmodx.org/funcwiki.php?go=func&id=199
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 11-08-2011 , 14:51   Re: Checking which team you picked
Reply With Quote #3

No, you haven't read the thread properly. I want to check which team a player chose on the VGUI MENU!!!! (command in console to display that menu is "chooseteam" or "jointeam"), and after that for example block it and stay in the selection
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
Pattinho
Member
Join Date: Dec 2007
Old 11-08-2011 , 17:09   Re: Checking which team you picked
Reply With Quote #4

Try this

PHP Code:
....
register_menucmd(register_menuid("Team_Select",1), (1<<0)|(1<<1)|(1<<4)|(1<<5), "team_select")
....
...
public 
team_select(id,keys)
{
 if (
key==1//Terrorist
....
if (
key==2//CT
...
if(
key ==4// Spectator

Pattinho is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-08-2011 , 18:08   Re: Checking which team you picked
Reply With Quote #5

Quote:
Originally Posted by Diegorkable View Post
No, you haven't read the thread properly. I want to check which team a player chose on the VGUI MENU!!!! (command in console to display that menu is "chooseteam" or "jointeam"), and after that for example block it and stay in the selection
jointeam and chooseteam are not the same. One actually joins a team the other shows the menu IIRC.

I've seen people hook jointeam and block it and it works that way.
__________________

Last edited by fysiks; 11-08-2011 at 18:08.
fysiks is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 11-09-2011 , 06:11   Re: Checking which team you picked
Reply With Quote #6

Quote:
Originally Posted by Pattinho View Post
Try this

PHP Code:
....
register_menucmd(register_menuid("Team_Select",1), (1<<0)|(1<<1)|(1<<4)|(1<<5), "team_select")
....
...
public 
team_select(id,keys)
{
 if (
key==1//Terrorist
....
if (
key==2//CT
...
if(
key ==4// Spectator


lets say I want to block players picking the Terror team? like they'd hit button 1 (in order to pick TERRORIST TEAM). Then how do I block it? by returning PLUGIN_HANDLED?
__________________
My Projects:

Auto-Mix (Pug): 100%

Joined the Military (a soldier now) - Inactive
Diegorkable is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 11-09-2011 , 07:02   Re: Checking which team you picked
Reply With Quote #7

Quote:
Originally Posted by Pattinho View Post
Try this

PHP Code:
....
register_menucmd(register_menuid("Team_Select",1), (1<<0)|(1<<1)|(1<<4)|(1<<5), "team_select")
....
...
public 
team_select(id,keys)
{
 if (
key==1//Terrorist
....
if (
key==2//CT
...
if(
key ==4// Spectator

PHP Code:
....
register_menucmd(register_menuid("Team_Select",1), (1<<0)|(1<<1)|(1<<4)|(1<<5), "team_select")
....
...
public 
team_select(id,key)
{
     if( 
key == //Terrorist
....
     if( 
key == //CT
...
     if( 
key == // Spectator


Last edited by Devil259; 11-09-2011 at 07:03.
Devil259 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-10-2011 , 13:06   Re: Checking which team you picked
Reply With Quote #8

1=T
2=CT
3=Spec

PHP Code:
register_clcmd"jointeam" "JoinTeam" )

public 
JoinTeamid  )
{
    new 
szTeam];
    
read_argvszTeam charsmaxszTeam ) );
    
server_print "player picked %s" szTeam );

__________________

Last edited by Bugsy; 11-10-2011 at 13:59.
Bugsy 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:28.


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