Command decorators

Please post any questions about developing your plugin here. Please use the search function before posting!
MrMalina
Member
Posts: 53
Joined: Mon Apr 08, 2013 2:40 pm
Location: Russian Federation

Command decorators

Postby MrMalina » Fri Dec 04, 2015 2:57 pm

Hello. I have tried to use two decorators to declare "say" and "client" commands:

Syntax: Select all

from commands import CommandReturn
from commands.say import SayCommand
from commands.client import ClientCommand
from commands.server import ServerCommand

@ClientCommand("pony")
@SayCommand("pony")
def pony(command, index, team_only=False):
print(command.get_arg(0))

return CommandReturn.BLOCK



It's work perfect, but when i try to restart plug-in with "sp reload <plugin_name>" I got next error:
The attachment Скриншот 2015-12-04 17.43.31.jpg is no longer available


Click
Attachments
&#1057;&#1082;&#1088;&#1080;&#1085;&#1096;&#1086;&#1090; 2015-12-04 17.43.31.jpg
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Postby Ayuto » Fri Dec 04, 2015 3:08 pm

Thanks for reporting! I have fixed the issue. https://github.com/Source-Python-Dev-Team/Source.Python/commit/df3055b9991313c2d946e45399d1897624c1bf09

The new version is already downloadable.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 122 guests