From 7e23047c539060f28984fb1b06718f82c6e76998 Mon Sep 17 00:00:00 2001 From: OciXCrom Date: Tue, 11 Sep 2018 20:19:28 +0200 Subject: [PATCH] Fix admin chat displaying the wrong language (#559) * Fix admin chat displaying the wrong language * Switch %L to %l * Improve loop * %L to %l again * Change git add . to != 0 --- plugins/adminchat.sma | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/plugins/adminchat.sma b/plugins/adminchat.sma index 1f5681d7..d5a7e621 100755 --- a/plugins/adminchat.sma +++ b/plugins/adminchat.sma @@ -216,20 +216,18 @@ public cmdSayAdmin(id) log_amx("Chat: ^"%s<%d><%s><>^" chat ^"%s^"", name, userid, authid, message[1]) log_message("^"%s<%d><%s><>^" triggered ^"amx_chat^" (text ^"%s^")", name, userid, authid, message[1]) - if (is_user_admin(id)) // no diff here if admins have g_AdminChatFlag access or not, but we don't want to print "PLAYER" - format(message, charsmax(message), "(%L) %s : %s", id, "ADMIN", name, message[1]) - else - format(message, charsmax(message), "(%L) %s : %s", id, "PLAYER", name, message[1]) - get_players(players, inum, "ch") - for (new i = 0; i < inum; ++i) + for (new bool:is_sender_admin = is_user_admin(id) != 0, i = 0; i < inum; ++i) { pl = players[i] + if (pl == id || get_user_flags(pl) & g_AdminChatFlag) - client_print(pl, print_chat, "%s", message) + { + client_print(pl, print_chat, "(%l) %s : %s", is_sender_admin ? "ADMIN" : "PLAYER", name, message[1]) + } } - + return PLUGIN_HANDLED }