- 125
- 19
- Версия MoonLoader
- .026-beta
Ребят, какие клавиши нужно вставить в sendKey, чтобы срабатывало нажатие в onDisplayGameText. PS эти не работают
Lua:
function sampev.onDisplayGameText(style, time, text)
if active == true then
if text == "~w~Press ~g~~k~~PED_LOCK_TARGET" then
lua_thread.create(function()
wait(700)
sendKey(6)
end)
end
if text == "~w~Press ~g~~k~~PED_FIREWEAPON" then
lua_thread.create(function()
wait(700)
sendKey(17)
end)
end
end
end
function sendKey(key)
local _, myId = sampGetPlayerIdByCharHandle(PLAYER_PED)
local data = allocateMemory(68)
sampStorePlayerOnfootData(myId, data)
setStructElement(data, 36, 1, key, false)
sampSendOnfootData(data)
freeMemory(data)
end