kill is technically a server command, not a client one. Using
ServerCommand should work. However, you cannot access the index of the player issuing it because
GetCommandIndex don't seem to be currently exported to Python.
EDIT: GetCommandIndex has been exported as
commands.get_command_index into
3422d53. With this commit, you can do the following:
Syntax: Select all
from colors import GREEN, LIGHT_GREEN
from commands import get_command_index
from commands.server import ServerCommand
from commands import CommandReturn
from messages import SayText2
YOU_CANT_SUICIDE_MSG = SayText2(
f"{GREEN}[ZR] » {LIGHT_GREEN}You can't {GREEN}suicide!"
)
@ServerCommand('kill')
def kill_command(command):
YOU_CANT_SUICIDE_MSG.send(get_command_index())
return CommandReturn.BLOCK