Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to change the commands to trigger score reset #2

Open
Mahi opened this issue Mar 25, 2017 · 5 comments
Open

Add options to change the commands to trigger score reset #2

Mahi opened this issue Mar 25, 2017 · 5 comments

Comments

@Mahi
Copy link

Mahi commented Mar 25, 2017

Not everyone wants to use ! and/or / to reset their score, and some servers might even want something completely different like !rs or in an other language, !resetoi.

I suggest creating a config file under the addons/source-python/data/plugins/ folder :)

@Exiistenz
Copy link
Member

Hmm. Yes i will add a config file with possibility to add command name.

@satoon101
Copy link
Contributor

I 2nd this, but with 1 change. addons/source-python/data/plugins/ is more for data, not configuration. Just use the ConfigManager class to create a cfg file.

Or, if you would prefer an ini file for this (which would make sense, as the command shouldn't be tied to a changeable ConVar), place it in ../cfg/source-python/. I would recommend using configobj (which is included in Source.Python) to parse the file.

A more advanced version would be to check on load whether the ini file exists, and if not create it using translations.

If you want, I can create a pull request to implement the last method.

@Exiistenz
Copy link
Member

Yes do it if you have time :)

And for config i have choose the solution of ConfigManager, it's better.
I will add a config in which you can add your commands.

Example :
'!rs,!resetscore' => Plugin add it to SayCommand.

I don't know if it's the better way to do this.

@satoon101
Copy link
Contributor

Well, as I was saying, if you use the ConfigManager, it creates a changeable ConVar, which really doesn't make sense, unless you want to unregister/re-register commands on the fly. The ini idea would be the exact same, except that it would only be read once and would not create a ConVar that holds the commands.

So, if I do a pull request, there is no need for you to implement the ConfigManager (unless you have other options you would want to add to the plugin).

@Exiistenz
Copy link
Member

Exiistenz commented Mar 25, 2017

My other solution is juste add field un config to add command but i don't think if it's really clean.
I want to see your solution, so do pull request :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants