Как в плагине на бинд клавишу LUA добавить сочетание клавиш?

MARSx13

Участник
Автор темы
102
5
Это пример:

local key = require 'vkeys'

function main()
while true do
wait(0)
if wasKeyPressed(key.VK_F) then
sampSendChat('/fixcar')
end
end
end
 
Решение
Не, не работает
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(300) end
while true do wait(0)
if isKeyDown(0xA4) and isKeyJustPressed(0x4B) and not sampIsChatInputActive() and not sampIsDialogActive() then --Alt+K
sampSendChat("/fixcar")
end
end
end

на таком примере все работает

ice_ice

Участник
61
14
Не, не работает
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(300) end
while true do wait(0)
if isKeyDown(0xA4) and isKeyJustPressed(0x4B) and not sampIsChatInputActive() and not sampIsDialogActive() then --Alt+K
sampSendChat("/fixcar")
end
end
end

на таком примере все работает
 

Hinаta

Известный
783
358
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(300) end
while true do wait(0)
if isKeyDown(0xA4) and isKeyJustPressed(0x4B) and not sampIsChatInputActive() and not sampIsDialogActive() then --Alt+K
sampSendChat("/fixcar")
end
end
end

на таком примере все работает
1697905616689.png