Disable choose team

All other Source.Python topics and issues.
nullable
Senior Member
Posts: 137
Joined: Sat Nov 08, 2014 7:22 pm

Disable choose team

Postby nullable » Sun Nov 16, 2014 6:51 am

Hi,

I want to choose team for players in plugin and I want for this disable choose team after player connect. How can I make it?
Flowan
Junior Member
Posts: 2
Joined: Mon Feb 20, 2017 6:59 pm

Re: Disable choose team

Postby Flowan » Tue Feb 21, 2017 1:04 pm

I would like to have some info too about this. Does anyone know?
User avatar
Kill
Member
Posts: 68
Joined: Wed Aug 31, 2016 10:05 pm

Re: Disable choose team

Postby Kill » Tue Feb 21, 2017 1:25 pm

Flowan wrote:I would like to have some info too about this. Does anyone know?


Try this:

Syntax: Select all

from commands.client import ClientCommandFilter
from commands import CommandReturn

@ClientCommandFilter
def on_client_command(command, index):
if command[0] == "jointeam":
return CommandReturn.BLOCK
Last edited by Kill on Wed Feb 22, 2017 1:21 pm, edited 1 time in total.
User avatar
satoon101
Project Leader
Posts: 2289
Joined: Sat Jul 07, 2012 1:59 am

Re: Disable choose team

Postby satoon101 » Tue Feb 21, 2017 11:56 pm

Kill wrote:
Flowan wrote:I would like to have some info too about this. Does anyone know?


Try this:

Code: Select all

from commands.client import ClientCommandFilter
from commands import CommandReturn

@ClientCommandFilter
def on_client_command(command, index):
    if command[0] == "jointeam":
       return CommandReturn.BLOCK

Don't forget to use [python][/python].

Also, if you are only wanting to hook specific commands, just use a ClientCommand instead of a full filter:

Syntax: Select all

from commands.client import ClientCommand
from commands import CommandReturn


@ClientCommand('jointeam')
def on_join_team(command, index):
return CommandReturn.BLOCK
Image
User avatar
Kill
Member
Posts: 68
Joined: Wed Aug 31, 2016 10:05 pm

Re: Disable choose team

Postby Kill » Wed Feb 22, 2017 1:23 pm

satoon101 wrote:-

Thought [ code=Python ] would do the trick, done, thanks.
User avatar
L'In20Cible
Project Leader
Posts: 914
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Disable choose team

Postby L'In20Cible » Sun Feb 26, 2017 8:10 am

Along with blocking jointeam, I think you are looking to block joingame which is responsible to send the team menu when you click "OK" on the MOTD.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest