I can't seem to figure this error, I am just trying to get familiar with Source Python and I'm starting by practicing with small stuff before I get started on projects I have in mind and I tried this code:
Syntax: Select all
# Python Imports
# SourcePython imports
from players.entity import PlayerEntity
from players.helpers import userid_from_index
from players.helpers import index_from_userid
from events import Event
from messages import SayText2
from cvars.public import PublicConVar
from plugins.info import PluginInfo
info = PluginInfo()
info.name = "Tests Plugin"
info.author = "SkinN"
info.version = "1.0"
info.basename = "test"
info.variable = info.basename + "_version"
info.convar = PublicConVar(info.variable, info.version, 0, info.name + " Version")
@Event
def player_footstep(game_event):
uid = game_event.get_int('userid')
idx = index_from_userid(userid)
SayText2('User: %s' % uid).send(uid)
And returns this error:
Code: Select all
[SP] Caught an Exception:Traceback (most recent call last):
File '..\addons\source-python\packages\source-python\plugins\manager.py', line 71, in __missing__
instance = self.instance(plugin_name, self.base_import)
File '..\addons\source-python\packages\source-python\plugins\instance.py', line 82, in __init__
self._plugin = import_module(import_name)
File '..\addons\source-python\plugins\test\test.py', line 24, in <module>
@Event
File '..\addons\source-python\packages\source-python\events\__init__.py', line 54, in __init__
raise ValueError('Event name must be a string.')
ValueError: Event name must be a string.
Thanks in advance