You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce a new ConVar multimode_endvote_type (g_Cvar_EndVoteType) to control end-vote timing (Next Map / Next Round / Instant). Refactor PerformEndVote and Event_RoundEnd to keep vote method selection using multimode_endvote_method while using the new multimode_endvote_type for TimingMode calculation and clamping. Update logging and local variable names accordingly.
Copy file name to clipboardExpand all lines: addons/sourcemod/scripting/multimode_endvote.sp
+21-19Lines changed: 21 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,7 @@ ConVar g_Cvar_EndVoteRounds;
29
29
ConVarg_Cvar_EndVoteFrags;
30
30
ConVarg_Cvar_EndVoteOnRoundEnd;
31
31
ConVarg_Cvar_EndVoteMethod;
32
+
ConVarg_Cvar_EndVoteType;
32
33
ConVarg_hCvarTimeLimit;
33
34
34
35
// Vote Configuration ConVars
@@ -73,6 +74,7 @@ public void OnPluginStart()
73
74
g_Cvar_EndVoteFrags=CreateConVar("multimode_endvote_frags", "10", "Frags remaining before map ends to trigger vote (0 = disabled)", _, true, 0.0);
74
75
g_Cvar_EndVoteOnRoundEnd=CreateConVar("multimode_endvote_onroundend", "0", "Wait for round end before starting vote", _, true, 0.0, true, 1.0);
75
76
g_Cvar_EndVoteMethod=CreateConVar("multimode_endvote_method", "1", "Vote method for end vote: 1 = Groups then Maps, 2 = Groups only (random map), 3 = Maps only", _, true, 1.0, true, 3.0);
77
+
g_Cvar_EndVoteType=CreateConVar("multimode_endvote_type", "1", "Voting Type for End Vote: 1 = Next Map, 2 = Next Round, 3 = Instant", _, true, 1.0, true, 3.0);
76
78
g_hCvarTimeLimit=FindConVar("mp_timelimit");
77
79
78
80
g_Cvar_VoteTime=CreateConVar("multimode_endvote_vote_time", "20", "Vote duration in seconds");
@@ -333,29 +335,29 @@ void PerformEndVote()
333
335
return;
334
336
}
335
337
336
-
intendType=g_Cvar_EndVoteMethod.IntValue;
337
-
if (endType<1) endType=1;
338
-
elseif (endType>3) endType=3;
339
-
340
-
TimingModetiming=view_as<TimingMode>(endType-1);
338
+
intvoteTypeInt=g_Cvar_EndVoteMethod.IntValue;
341
339
MultimodeMethodTypevoteType;
342
-
343
-
intmethod=g_Cvar_EndVoteMethod.IntValue;
344
-
if (method==3)
340
+
if (voteTypeInt==3)
345
341
{
346
342
voteType=VOTE_TYPE_MAPS_ONLY;
347
343
}
348
-
elseif (method==2)
344
+
elseif (voteTypeInt==2)
349
345
{
350
346
voteType=VOTE_TYPE_GROUPS_ONLY;
351
347
}
352
348
else
353
349
{
354
350
voteType=VOTE_TYPE_GROUPS_THEN_MAPS;
355
351
}
352
+
353
+
intendType=g_Cvar_EndVoteType.IntValue;
354
+
if (endType<1) endType=1;
355
+
elseif (endType>3) endType=3;
356
+
357
+
TimingModetiming=view_as<TimingMode>(endType-1);
356
358
357
359
if (g_Cvar_EndVoteDebug.BoolValue)
358
-
MMC_WriteToLogFile(g_Cvar_EndVoteLogs, "[MultiMode End Vote] Vote type selected: %d (Timing: %d)", endType, timing);
360
+
MMC_WriteToLogFile(g_Cvar_EndVoteLogs, "[MultiMode End Vote] Vote type selected: %d (Timing: %d)", voteTypeInt, timing);
0 commit comments