99#endif
1010
1111# define PLUGIN " Map Manager: Scheduler"
12- # define VERSION " 0.2.2 "
12+ # define VERSION " 0.2.3 "
1313# define AUTHOR " Mistrick"
1414
1515#pragma semicolon 1
@@ -146,6 +146,7 @@ public plugin_natives()
146146 register_native (" map_scheduler_get_ignore_check" , " native_get_ignore_check" );
147147 register_native (" map_scheduler_set_ignore_check" , " native_set_ignore_check" );
148148 register_native (" map_scheduler_start_vote" , " native_start_vote" );
149+ register_native (" map_scheduler_stop_vote" , " native_stop_vote" );
149150 register_native (" map_scheduler_extend_map" , " native_extend_map" );
150151 register_native (" is_vote_will_in_next_round" , " native_vote_will_in_next_round" );
151152 register_native (" get_last_round_state" , " native_get_last_round_state" );
@@ -189,11 +190,22 @@ public native_start_vote(plugin, params)
189190
190191 return 1 ;
191192}
193+ public native_stop_vote (plugin, params)
194+ {
195+ if (! is_vote_started ()) {
196+ return 0 ;
197+ }
198+
199+ stop_vote ();
200+
201+ return 1 ;
202+ }
192203public native_extend_map (plugin, params)
193204{
194205 enum { arg_count = 1 };
195206 new count = get_param (arg_count);
196207 g_iExtendedNum += count;
208+ // TODO : rounds support?
197209 set_float (TIMELIMIT, get_float (TIMELIMIT) + float (get_num (EXTENDED_TIME)) * float (count));
198210 return 1 ;
199211}
@@ -257,13 +269,23 @@ public concmd_startvote(id, level, cid)
257269}
258270public concmd_stopvote (id, level, cid)
259271{
272+ if (! is_vote_started ()) {
273+ return PLUGIN_HANDLED;
274+ }
275+
260276 if (! cmd_access (id, level, cid, 1 )) {
261277 return PLUGIN_HANDLED;
262278 }
263279
264280 new name[32 ]; get_user_name (id, name, charsmax (name));
265281 log_amx (" %s stopped vote" , id ? name : " Server" );
266282
283+ stop_vote ();
284+
285+ return PLUGIN_HANDLED;
286+ }
287+ stop_vote ()
288+ {
267289 mapm_stop_vote ();
268290
269291 if (mapm_get_vote_type () == VOTE_BY_SCHEDULER_SECOND) {
@@ -277,8 +299,6 @@ public concmd_stopvote(id, level, cid)
277299 set_float (TIMELIMIT, g_fOldTimeLimit);
278300 }
279301 }
280-
281- return PLUGIN_HANDLED;
282302}
283303public clcmd_votemap ()
284304{
0 commit comments