diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index 4ac58441..41adea06 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -337,6 +337,12 @@ static cell AMX_NATIVE_CALL client_print_color(AMX *amx, cell *params) /* 3 para g_langMngr.SetDefLang(i); msg = format_amxstring(amx, params, 3, len); + if (*msg > 4) // Insert default color code at the start if not present, otherwise message will not be colored. + { + memmove(msg + 1, msg, ke::Min(len++, 191)); + *msg = 1; + } + if (len > 190) // Server crashes after byte 190. (190 + \n = 191) { len = 190; @@ -369,6 +375,12 @@ static cell AMX_NATIVE_CALL client_print_color(AMX *amx, cell *params) /* 3 para msg = format_amxstring(amx, params, 3, len); + if (*msg > 4) // Insert default color code at the start if not present, otherwise message will not be colored. + { + memmove(msg + 1, msg, ke::Min(len++, 191)); + *msg = 1; + } + if (len > 190) // Server crashes after byte 190. (190 + \n = 191) { len = 190;