[CS:S] TypedServerCommand error

Please post any questions about developing your plugin here. Please use the search function before posting!
cssbestrpg
Senior Member
Posts: 318
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

[CS:S] TypedServerCommand error

Postby cssbestrpg » Thu Jul 10, 2025 10:01 am

Hi, i recently updated my code to use TypedServerCommand
The following code does work when type in console test name

Syntax: Select all

from commands.typed import TypedServerCommand

@TypedServerCommand('test')
def test_command(info, *name_parts: str):
name = ' '.join(name_parts)
print(name)


but if i restart server then this error appears:

Code: Select all

[SP] Caught an Exception:
Traceback (most recent call last):
  File "../addons/source-python/packages/source-python/plugins/manager.py", line 437, in _unload_auto_unload_instances
    instance._unload_instance()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "../addons/source-python/packages/source-python/commands/typed.py", line 580, in _unload_instance
    if self.parser.remove_command(self.commands):
       ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "../addons/source-python/packages/source-python/commands/typed.py", line 280, in remove_command
    return self._remove_command(self._validate_commands(commands))
                                ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "../addons/source-python/packages/source-python/commands/typed.py", line 369, in _validate_commands
    raise TypeError('<commands> must be str, list or tuple.')

TypeError: <commands> must be str, list or tuple.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 51 guests