- 11
- 0
- Версия MoonLoader
- .026-beta
Because when I enter the game and start running, my game crashes. How can I activate this hook via checkbox?
If I put wait(-1) it works but in my script I use while true do in main
If I put wait(-1) it works but in my script I use while true do in main
Lua:
local hooks = require("hooks")
local inicfg = require 'inicfg'
local directIni = "sprinthook.ini"
local ini = inicfg.load({
config = {
speed = 0.25
}
}, directIni)
local checbox = ImBool(false)
local original_GetButtonSprintResults
function GetButtonSprintResults_hooked(CPlayerPed, sprintType)
local result = original_GetButtonSprintResults(CPlayerPed, sprintType);
if checbox.v then
result = result + 0.25
end
return result
end
function main()
while not isSampAvailable() do wait(0) end
if checbox.v then
original_GetButtonSprintResults = hooks.jmp.new("float(__thiscall*)(void* CPlayerPed, int sprintType)", GetButtonSprintResults_hooked, 0x60A820)
end
while true do wait(0)
end
end