AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   error to blocking team menu (https://forums.alliedmods.net/showthread.php?t=164181)

andre neves 08-08-2011 08:53

error to blocking team menu
 
I'm trying to block the team menu with the following code:

HTML Code:

public plugin_init()
{
        ...
        register_message(get_user_msgid("ShowMenu"), "event_TeamMenu")
        register_message(get_user_msgid("VGUIMenu"), "event_TeamMenu_VGUI")
}
...

public event_TeamMenu_VGUI(iMsgid, iDest, id)
{
        if(get_pcvar_num(g_cvar_teams_blocks)!=1)
                return PLUGIN_CONTINUE
       
        new iMenu_id=get_msg_arg_int(1)
       
        if(iMenu_id!=2)
                return PLUGIN_CONTINUE
       
        client_cmd(id, "jointeam 6")
        return PLUGIN_HANDLED
}

public event_TeamMenu(iMsgid, iDest, id)
{
        if(get_pcvar_num(g_cvar_teams_blocks)!=1)
                return PLUGIN_CONTINUE
               
        static iText_Menu[50]
        get_msg_arg_string(4,  iText_Menu, charsmax(iText_Menu))
       
        if(!equal(iText_Menu, "#Team_Select") && !equal(iText_Menu, "#Team_Select_Spect"))
                return PLUGIN_CONTINUE
               
        client_cmd(id, "jointeam 6")
        return PLUGIN_HANDLED
}

I want to send the player to the SPECT if cvar is active, but then when the player will play, the player's hud is in error, there is another way to send the player to SPECT without the error?

Exolent[jNr] 08-08-2011 10:00

Re: error to blocking team menu
 
Look at my Team Join Management plugin on how to force players on a specific team.

Doc-Holiday 08-08-2011 10:39

Re: error to blocking team menu
 
Quote:

Originally Posted by Exolent[jNr] (Post 1528187)
Look at my Team Join Management plugin on how to force players on a specific team.

is human_join_team no avaiable in CS??

or is he trying to force specific players and limit the teams like you do.

Exolent[jNr] 08-08-2011 10:56

Re: error to blocking team menu
 
Quote:

Originally Posted by Doc-Holiday (Post 1528223)
is human_join_team no avaiable in CS??

or is he trying to force specific players and limit the teams like you do.

If you use humans_join_team, then players cannot go to a team later on.
I'm not even sure you could change player's team after they are forced using humans_join_team.

Doc-Holiday 08-08-2011 11:04

Re: error to blocking team menu
 
Quote:

Originally Posted by Exolent[jNr] (Post 1528234)
If you use humans_join_team, then players cannot go to a team later on.
I'm not even sure you could change player's team after they are forced using humans_join_team.

you can ive done it on cz


All times are GMT -4. The time now is 03:29.

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