AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Checking which team you picked (https://forums.alliedmods.net/showthread.php?t=171641)

Diegorkable 11-08-2011 14:34

Checking which team you picked
 
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.

joshknifer 11-08-2011 14:39

Re: Checking which team you picked
 
http://www.amxmodx.org/funcwiki.php?go=func&id=199

Diegorkable 11-08-2011 14:51

Re: Checking which team you picked
 
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

Pattinho 11-08-2011 17:09

Re: Checking which team you picked
 
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



fysiks 11-08-2011 18:08

Re: Checking which team you picked
 
Quote:

Originally Posted by Diegorkable (Post 1592863)
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.

Diegorkable 11-09-2011 06:11

Re: Checking which team you picked
 
Quote:

Originally Posted by Pattinho (Post 1592931)
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?

Devil259 11-09-2011 07:02

Re: Checking which team you picked
 
Quote:

Originally Posted by Pattinho (Post 1592931)
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



Bugsy 11-10-2011 13:06

Re: Checking which team you picked
 
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 );




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

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