Skip to content

Commit

Permalink
Fix admin chat displaying the wrong language (#559)
Browse files Browse the repository at this point in the history
* Fix admin chat displaying the wrong language

* Switch %L to %l

* Improve loop

* %L to %l again

* Change git add . to != 0
  • Loading branch information
OciXCrom authored and Arkshine committed Sep 13, 2018
1 parent 91f36f2 commit 7e23047
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions plugins/adminchat.sma
Expand Up @@ -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
}

Expand Down

0 comments on commit 7e23047

Please sign in to comment.