Как поменять цвет в сообщении

Nasvai616

Новичок
Автор темы
7
4
Версия SA-MP
  1. Любая
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampAddChatMessage("" .. tag, main_color)
while true do
wait(0)

if isKeyJustPressed(VK_L) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/lock") end

if isKeyJustPressed(VK_K) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/key") end

if isKeyJustPressed(VK_X) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/style") end

if isKeyJustPressed(VK_P) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/phone") end

if isKeyJustPressed(VK_Z) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampSendChat("/plt") end

if isKeyJustPressed(VK_C) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampAddChatMessage("123123123") end


end
end



Вопрос, я очень тупенький, но как поменять цвет сообщения в последней строке (if isKeyJustPressed(VK_C) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then sampAddChatMessage("123123123") end) чтоб 123123123 писалось не стандартным чёрным
 
Решение
Lua:
if isKeyJustPressed(VK_C) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
    sampAddChatMessage("123123123", -1)
end

Можешь просто указать -1, это будет белый, но если тебе нужен цветной текст, то вот: https://colorscheme.ru/html-colors.html
На этом сайте смотри HEX значение цветов, и потом можешь указать это значение в sampAddChatMessage или где-то ещё.

Пример:

RED - #FF0000 (HEX)

sampAddChatMessage("123123123", 0xFF0000)

Урок:


(Про sampAddChatMessage 7:56)

arpix

Активный
119
32
Lua:
if isKeyJustPressed(VK_C) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
    sampAddChatMessage("123123123", -1)
end

Можешь просто указать -1, это будет белый, но если тебе нужен цветной текст, то вот: https://colorscheme.ru/html-colors.html
На этом сайте смотри HEX значение цветов, и потом можешь указать это значение в sampAddChatMessage или где-то ещё.

Пример:

RED - #FF0000 (HEX)

sampAddChatMessage("123123123", 0xFF0000)

Урок:


(Про sampAddChatMessage 7:56)
 
  • Нравится
Реакции: Nasvai616