77#endif
88
99# define PLUGIN " Map Manager: Informer"
10- # define VERSION " 0.0.2 "
10+ # define VERSION " 0.0.3 "
1111# define AUTHOR " Mistrick"
1212
1313#pragma semicolon 1
@@ -26,7 +26,7 @@ new g_pCvars[Cvars];
2626
2727new g_iTeamScore[2 ];
2828new g_szCurMap[MAPNAME_LENGTH];
29- new PREFIX[ 32 ];
29+ new g_sPrefix[ 48 ];
3030
3131public plugin_init ()
3232{
@@ -40,7 +40,6 @@ public plugin_init()
4040 register_event (" TeamScore" , " event_teamscore" , " a" );
4141
4242 get_mapname (g_szCurMap, charsmax (g_szCurMap));
43- mapm_get_prefix (PREFIX, charsmax (PREFIX));
4443}
4544public plugin_cfg ()
4645{
@@ -49,6 +48,8 @@ public plugin_cfg()
4948 g_pCvars[MAXROUNDS] = get_cvar_pointer (" mp_maxrounds" );
5049 g_pCvars[NEXTMAP] = get_cvar_pointer (" amx_nextmap" );
5150 g_pCvars[EXTENDED_TYPE] = get_cvar_pointer (" mapm_extended_type" );
51+
52+ mapm_get_prefix (g_sPrefix, charsmax (g_sPrefix));
5253}
5354public event_teamscore ()
5455{
@@ -60,52 +61,51 @@ public clcmd_timeleft(id)
6061 new win_limit = get_num (WINLIMIT);
6162 new max_rounds = get_num (MAXROUNDS);
6263
64+ // TODO : need subtract left_wins/left_rounds if mapm_change_type 0 or 1
6365 if ((win_limit || max_rounds) && get_num (EXTENDED_TYPE) == EXTEND_ROUNDS) {
6466 new text[128 ], len;
6567 len = formatex (text, charsmax (text), " % L " , LANG_PLAYER, " MAPM_TIME_TO_END" );
6668 if (win_limit) {
6769 new left_wins = win_limit - max (g_iTeamScore[0 ], g_iTeamScore[1 ]);
68- // TODO : add to ML MAPM_WINS
6970 len += formatex (text[len], charsmax (text) - len, " %d % L" , left_wins, LANG_PLAYER, " MAPM_WINS" );
7071 }
7172 if (win_limit && max_rounds) {
7273 len += formatex (text[len], charsmax (text) - len, " % L " , LANG_PLAYER, " MAPM_TIMELEFT_OR" );
7374 }
7475 if (max_rounds) {
7576 new left_rounds = max_rounds - g_iTeamScore[0 ] - g_iTeamScore[1 ];
76- // TODO : add to ML MAPM_ROUNDS
7777 len += formatex (text[len], charsmax (text) - len, " %d % L" , left_rounds, LANG_PLAYER, " MAPM_ROUNDS" );
7878 }
79- client_print_color (0 , print_team_default, " %s ^1 %s ." , PREFIX , text);
79+ client_print_color (0 , print_team_default, " %s ^1 %s ." , g_sPrefix , text);
8080 } else {
8181 if (get_num (TIMELIMIT)) {
8282 new a = get_timeleft ();
83- client_print_color (0 , id, " %s ^1 % L:^3 %d :%02d " , PREFIX , LANG_PLAYER, " MAPM_TIME_TO_END" , (a / 60 ), (a % 60 ));
83+ client_print_color (0 , id, " %s ^1 % L:^3 %d :%02d " , g_sPrefix , LANG_PLAYER, " MAPM_TIME_TO_END" , (a / 60 ), (a % 60 ));
8484 } else {
8585 if (is_vote_will_in_next_round ()) {
8686 // TODO : add ML
87- client_print_color (0 , print_team_default, " %s ^1 Wait vote in next round." , PREFIX );
87+ client_print_color (0 , print_team_default, " %s ^1 Wait vote in next round." , g_sPrefix );
8888 } else {
89- client_print_color (0 , print_team_default, " %s ^1 % L" , PREFIX , LANG_PLAYER, " MAPM_NO_TIMELIMIT" );
89+ client_print_color (0 , print_team_default, " %s ^1 % L" , g_sPrefix , LANG_PLAYER, " MAPM_NO_TIMELIMIT" );
9090 }
9191 }
9292 }
9393}
9494public clcmd_thetime (id)
9595{
9696 new curtime[64 ]; get_time (" % Y/% m/%d - % H:% M:%S " , curtime, charsmax (curtime));
97- client_print_color (0 , print_team_default, " %s ^3 % L" , PREFIX , LANG_PLAYER, " MAPM_THETIME" , curtime);
97+ client_print_color (0 , print_team_default, " %s ^3 % L" , g_sPrefix , LANG_PLAYER, " MAPM_THETIME" , curtime);
9898}
9999public clcmd_nextmap (id)
100100{
101101 if (is_vote_finished ()) {
102102 new map[MAPNAME_LENGTH]; get_pcvar_string (g_pCvars[NEXTMAP], map, charsmax (map));
103- client_print_color (0 , id, " %s ^1 % L ^3%s ^1." , PREFIX , LANG_PLAYER, " MAPM_NEXTMAP" , map);
103+ client_print_color (0 , id, " %s ^1 % L ^3%s ^1." , g_sPrefix , LANG_PLAYER, " MAPM_NEXTMAP" , map);
104104 } else {
105- client_print_color (0 , id, " %s ^1 % L ^3% L^1." , PREFIX , LANG_PLAYER, " MAPM_NEXTMAP" , LANG_PLAYER, " MAPM_NOT_SELECTED" );
105+ client_print_color (0 , id, " %s ^1 % L ^3% L^1." , g_sPrefix , LANG_PLAYER, " MAPM_NEXTMAP" , LANG_PLAYER, " MAPM_NOT_SELECTED" );
106106 }
107107}
108108public clcmd_currentmap (id)
109109{
110- client_print_color (0 , id, " %s ^1 % L" , PREFIX , LANG_PLAYER, " MAPM_CURRENT_MAP" , g_szCurMap);
110+ client_print_color (0 , id, " %s ^1 % L" , g_sPrefix , LANG_PLAYER, " MAPM_CURRENT_MAP" , g_szCurMap);
111111}
0 commit comments