function main()
while true do
wait(0)
if isKeyDown(17) and isKeyJustPressed(88) and sampIsChatInputActive() then -- CTRL + X и открыт чат
local message = sampGetChatInputText()
if #message >= 2 then
sampSetChatInputText(string.rupper(message:sub(1,1))..message:sub(2, #message)..(message:sub(#message, #message) == '.' and '' or '.'))
end
end
end
end
function string.rupper(s)
s = s:upper()
local strlen = s:len()
if strlen == 0 then return s end
s = s:upper()
local output = ''
for i = 1, strlen do
local ch = s:byte(i)
if ch >= 224 and ch <= 255 then -- lower russian characters
output = output .. russian_characters[ch - 32]
elseif ch == 184 then -- ё
output = output .. russian_characters[168]
else
output = output .. string.char(ch)
end
end
return output
end