Skip to content

Commit 1d6447e

Browse files
committed
change random to random_num
fix typos
1 parent 2b3e949 commit 1d6447e

File tree

6 files changed

+13
-18
lines changed

6 files changed

+13
-18
lines changed

addons/amxmodx/configs/maplists.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
; anytime - this list will be always loaded
44
; example
55
; "Day Maps" "maps.ini" "1" "6:00" "22:59"
6-
; "Nigth Maps" "nightmaps.ini" "1" "23:00" "5:59"
6+
; "Night Maps" "nightmaps.ini" "1" "23:00" "5:59"
77
; "Another maps" "another.ini" "0" "anytime"
88

addons/amxmodx/scripting/include/map_manager.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ native mapm_load_maplist_to_array(Array:array, filename[]);
4747
native mapm_get_map_index(map[]);
4848

4949
/**
50-
* Get prefix const from core.
50+
* Get prefix from core.
5151
*
5252
* @param prefix Prefix string
5353
* @param len String lenght

addons/amxmodx/scripting/map_manager_core.sma

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#endif
88

99
#define PLUGIN "Map Manager: Core"
10-
#define VERSION "3.0.0-Beta-5"
10+
#define VERSION "3.0.0"
1111
#define AUTHOR "Mistrick"
1212

1313
#pragma semicolon 1
@@ -359,8 +359,6 @@ prepare_vote(type)
359359
return 0;
360360
}
361361

362-
// server_print("--prepare vote--");
363-
364362
g_bVoteStarted = true;
365363
g_bVoteFinished = false;
366364

@@ -386,7 +384,7 @@ prepare_vote(type)
386384
new map_info[MapStruct];
387385
for(new random_map; g_iVoteItems < vote_max_items; g_iVoteItems++) {
388386
do {
389-
random_map = random(array_size);
387+
random_map = random_num(0, array_size - 1);
390388
ArrayGetArray(g_aMapsList, random_map, map_info);
391389
} while(is_map_in_vote(map_info[MapName]) || !is_map_allowed(map_info[MapName], PUSH_BY_CORE, random_map));
392390

@@ -413,7 +411,7 @@ prepare_vote(type)
413411
arrayset(g_iRandomNums, -1, sizeof(g_iRandomNums));
414412
for(new i; i < g_iVoteItems + g_bCanExtend; i++) {
415413
do {
416-
g_iRandomNums[i] = random(g_iVoteItems + g_bCanExtend);
414+
g_iRandomNums[i] = random_num(0, g_iVoteItems + g_bCanExtend - 1);
417415
} while(in_array(i, g_iRandomNums[i]));
418416
}
419417
} else {
@@ -579,7 +577,6 @@ finish_vote()
579577
g_bVoteStarted = false;
580578

581579
// vote results
582-
// server_print("--finish vote--");
583580

584581
// pre forward
585582
new ret;
@@ -601,7 +598,7 @@ finish_vote()
601598
}
602599
}
603600
else {
604-
max_vote = random(g_iVoteItems);
601+
max_vote = random_num(0, g_iVoteItems - 1);
605602
}
606603

607604
// post forward

addons/amxmodx/scripting/map_manager_nomination.sma

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#endif
99

1010
#define PLUGIN "Map Manager: Nomination"
11-
#define VERSION "0.0.7"
11+
#define VERSION "0.0.8"
1212
#define AUTHOR "Mistrick"
1313

1414
#pragma semicolon 1
@@ -345,7 +345,7 @@ show_nomination_menu(id, Array:maplist, custom_title[] = "")
345345
for(new i = 0, index, nom_index; i < size; i++) {
346346
if(random_sort) {
347347
do {
348-
index = random(size);
348+
index = random_num(0, size - 1);
349349
} while(in_array(array, index));
350350
ArrayPushCell(array, index);
351351
} else {
@@ -428,7 +428,7 @@ public mapm_prepare_votelist(type)
428428
}
429429
new nom_info[NomStruct];
430430
for(new i, index; i < get_num(MAPS_IN_VOTE) && ArraySize(g_aNomList); i++) {
431-
index = random(ArraySize(g_aNomList));
431+
index = random_num(0, ArraySize(g_aNomList) - 1);
432432
ArrayGetArray(g_aNomList, index, nom_info);
433433
ArrayDeleteItem(g_aNomList, index);
434434
g_iNomMaps[nom_info[NomPlayer]]--;

addons/amxmodx/scripting/map_manager_online_sorter.sma

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <map_manager>
33

44
#define PLUGIN "Map Manager: Online sorter"
5-
#define VERSION "0.0.1"
5+
#define VERSION "0.0.2"
66
#define AUTHOR "Mistrick"
77

88
#pragma semicolon 1
@@ -38,18 +38,16 @@ public mapm_prepare_votelist(type)
3838
new Array:array = ArrayCreate(MAPNAME_LENGTH, 1);
3939
new map_info[MapStruct], size = ArraySize(g_aMapsList);
4040

41-
// server_print("Found maps for current online:");
4241
for(new i; i < size; i++) {
4342
ArrayGetArray(g_aMapsList, i, map_info);
4443
if(map_info[MinPlayers] <= players_num <= map_info[MaxPlayers]) {
4544
ArrayPushString(array, map_info[MapName]);
46-
// server_print("%d - %s", ArraySize(array), map_info[MapName]);
4745
}
4846
}
4947

5048
new map[MAPNAME_LENGTH], max_items = mapm_get_votelist_size();
5149
for(new i, index; i < max_items && ArraySize(array); i++) {
52-
index = random(ArraySize(array));
50+
index = random_num(0, ArraySize(array) - 1);
5351
ArrayGetString(array, index, map, charsmax(map));
5452
ArrayDeleteItem(array, index);
5553
if(mapm_push_map_to_votelist(map, PUSH_BY_ONLINE_SORTER) == PUSH_BLOCKED) {

addons/amxmodx/scripting/map_manager_rtv.sma

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#endif
88

99
#define PLUGIN "Map Manager: Rtv"
10-
#define VERSION "0.0.3"
10+
#define VERSION "0.0.4"
1111
#define AUTHOR "Mistrick"
1212

1313
#pragma semicolon 1
@@ -85,7 +85,7 @@ public clcmd_rtv(id)
8585

8686
new need_votes;
8787
if(get_num(MODE) == MODE_PERCENTS) {
88-
need_votes = floatround(get_players_num() * get_num(PERCENT) / 100.0) - g_iVotes;
88+
need_votes = floatround(get_players_num() * get_num(PERCENT) / 100.0, floatround_ceil) - g_iVotes;
8989
} else {
9090
need_votes = get_num(PLAYERS) - g_iVotes;
9191
}

0 commit comments

Comments
 (0)