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 restrictions in cmd start and stop vote #23

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cstrike/addons/amxmodx/scripting/map_manager_scheduler.sma
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ restore_limits()
}
public concmd_startvote(id, level, cid)
{
if(is_vote_started() || is_vote_finished() || is_vote_will_in_next_round()) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вынеси is_vote_started() в отдельное условие.
Для is_vote_finished() || is_vote_will_in_next_round() добавь квар.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что должен делать квар?

return PLUGIN_HANDLED;
}

if(!cmd_access(id, level, cid, 1)) {
return PLUGIN_HANDLED;
}
Expand All @@ -240,6 +244,10 @@ public concmd_startvote(id, level, cid)
}
public concmd_stopvote(id, level, cid)
{
if(is_vote_finished()) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_vote_finished() -> !is_vote_started()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why

return PLUGIN_HANDLED;
}

if(!cmd_access(id, level, cid, 1)) {
return PLUGIN_HANDLED;
}
Expand Down