Skip to content

Commit 2ab1ed9

Browse files
committed
Fix agnextmode not working as expected
- Don't allow to vote agnextmode with empty argument. - Don't change game mode, instead just change CVar value. - Fixed misspellings in translations.
1 parent a2ab8fe commit 2ab1ed9

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

valve/addons/amxmodx/data/lang/agmodx.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ VOTE_ACCEPTED = Vote: %s %s^nCalled by: %s^nAccepted
3535
VOTE_DENIED = Vote: %s %s^nCalled by: %s^nDenied
3636
VOTE_RUNNING = Vote is running, type 'yes' or 'no' in console
3737
VOTE_DELAY = Last vote was not accepted - %i seconds until next vote can be called
38-
VOTE_NOTALLOWED = Voto not allowed by server admin.
38+
VOTE_NOTALLOWED = Vote not allowed by server admin.
3939
VOTE_NOTALLOWED_GAMEMODE = Vote is not allowed in this gamemode.
4040
INVALID_MAP = Map is invalid
41-
INVALID_MODE = Mode is invalid. Type 'vote' in console to see available modes
41+
INVALID_MODE = Mode is invalid.
4242
INVALID_NUMBER = Number is invalid
4343
INVALID_NUMBER_MAX = Number is invalid. Max value allowed is:
4444
INVALID_NUMBER_MIN = Number is invalid. Min value allowed is:
@@ -88,7 +88,7 @@ VOTE_DELAY = El ultimo voto no ha sido aceptado - Faltan %i segundos para poder
8888
VOTE_NOTALLOWED = Voto deshabilitado por el servidor.
8989
VOTE_NOTALLOWED_GAMEMODE = Voto no permitido en este modo.
9090
INVALID_MAP = Mapa invalido
91-
INVALID_MODE = Modo invalido. Escriba 'vote' en consola para ver los modos disponibles
91+
INVALID_MODE = Modo invalido.
9292
INVALID_NUMBER = Numero invalido
9393
INVALID_NUMBER_MAX = Numero invalido. El maximo valor permitido es:
9494
INVALID_NUMBER_MIN = Numero invalido. El minimo valor permitido es:

valve/addons/amxmodx/scripting/agmodx.sma

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2291,18 +2291,23 @@ public OnVoteAgNextMap(id, check, argc, arg1[], arg2[]) {
22912291
}
22922292

22932293
public OnVoteAgNextMode(id, check, argc, arg1[], arg2[]) {
2294-
if (argc != 1) {
2294+
if (argc != 2) {
22952295
client_print(id, print_console, "%l", "VOTE_INVALID");
22962296
return false;
22972297
}
22982298

22992299
if (!check) {
2300-
ChangeMode(arg2);
2300+
set_pcvar_string(gCvarGameMode, arg2);
23012301
} else {
23022302
if (!get_pcvar_num(gCvarAllowVoteGameMode)) {
23032303
console_print(id, "%l", "VOTE_NOTALLOWED");
23042304
return false;
23052305
}
2306+
2307+
if (!TrieKeyExists(gTrieVoteList, arg2)) {
2308+
client_print(id, print_console, "%l", "INVALID_MODE");
2309+
return false;
2310+
}
23062311
}
23072312

23082313
return true;

0 commit comments

Comments
 (0)