I have a couple tips for you, if you are interested. First, line 303 will error in CS:GO since the variable
naco is only defined in the
else clause (variable is named
team_color, which does seem more appropriate anyway, for CS:GO):
https://github.com/srpg/chat_tag/blob/m ... #L297-L303I would definitely recommend using proper names for variables instead of naco/chco. As line 7 of the
Zen of Python states: "Readability counts".
I also created a similar plugin a while back:
https://github.com/satoon101/ChatPrefixMy plugin doesn't allow tags to be changed on the fly, so there are obvious differences between the two plugins. It hooks the usermessage itself instead of using a SayFilter, which will catch all of the intended recipients and the specific message formatting with location (when applicable). Feel free to use it as a guide and ask any questions if you have any.
I would also highly recommend using
SayCommand or
TypedSayCommand instead of a SayFilter for tag/color. Here is a more detailed tutorial about TypedSayCommand:
http://wiki.sourcepython.com/developing ... mands.htmlIf you need any examples of SayCommand, just search the forums.
I would also recommend building your menu once instead of every single time someone uses the 'color' command. Also, definitely look into
f-strings in Python, they're much cleaner than using %s everywhere.