Page 1 of 1

Disable choose team

Posted: Sun Nov 16, 2014 6:51 am
by nullable
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?

Re: Disable choose team

Posted: Tue Feb 21, 2017 1:04 pm
by Flowan
I would like to have some info too about this. Does anyone know?

Re: Disable choose team

Posted: Tue Feb 21, 2017 1:25 pm
by Kill
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

Re: Disable choose team

Posted: Tue Feb 21, 2017 11:56 pm
by satoon101
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

Re: Disable choose team

Posted: Wed Feb 22, 2017 1:23 pm
by Kill
satoon101 wrote:-

Thought [ code=Python ] would do the trick, done, thanks.

Re: Disable choose team

Posted: Sun Feb 26, 2017 8:10 am
by L'In20Cible
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.