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

How to add a custom menu entry that will set a given command to X if enabled, and Y if disabled? #318

Open
kikaragyozov opened this issue Mar 7, 2020 · 2 comments

Comments

@kikaragyozov
Copy link

I tried doing it, but the files are too much and the more I look, the more confused I get.

If you could post a general guide on how one would implement such things in the .setup menu, with which files to edit at which specific lines ,it'd make this process very easy, and not require extensive sourcePawn language knowledge.

@splewis
Copy link
Owner

splewis commented Apr 12, 2020

I don't understand what you're asking, or what you're trying to do.

with which files to edit at which specific lines ,it'd make this process very easy, and not require extensive sourcePawn language knowledge.

I can't provide general guidance on programming, sorry.

@kikaragyozov
Copy link
Author

@splewis Basically, allow people to add custom entries in the .setup menu (like Team Size, Veto type which are already there), which custom entries when enabled, execute a given command, and when disabled, execute another given command.

For example:

Imagine I want to have an entry called SpawnWithGrenades.

If that's enabled, the plugin executes the command we've written for when the option is enabled, and if it's disabled, it executes the command we've written for when it's disabled.

A concrete example would be EnableAllTalk

sv_alltalk 1 for when the option is enabled, sv_alltalk 0 for when the option is disabled.

This basically allows every user of your plugin, to have some custom configuration file, which easily adds these custom configurations, with customly predefined actions/commands, for when they are enabled/disabled.

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

No branches or pull requests

2 participants