- 23
- 2
- Версия SA-MP
-
- 0.3.7 (R1)
cruise:
local enable = false
local speed = 0
local limit = 0
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
local font = renderCreateFont("Arial", 10, 9)
while true do
wait(0)
if isCharInAnyCar(playerPed) then
local _, y = getScreenResolution()
if isKeyJustPressed(0x26) then speed = speed + 3.576 end
if isKeyJustPressed(0x28) then speed = speed - 3.576 end
limit = speed
if enable then
local text = ("Cruise Control %s {FFCCCCCC}Speed: {FFFFFF00}%.0f, {FFCCCCCC}Limit: {FFFFFF00}%.0f"):format(enable and "{FF00CC00}ON" or "{FFCC0000}OFF", speed * 2.8, limit * 2.8 + 10)
renderDrawBox(0, y - 15, renderGetFontDrawTextLength(font, text) + 10, 15, 0xFF323232)
renderFontDrawText(font, text, 5, y - 15, 0xFFCCCCCC)
if getCarSpeed(storeCarCharIsInNoSave(playerPed)) < speed then
writeMemory(0xB73458 + 0x20, 255, 150, false)
end
if speed < 0 then
speed = 0
end
if getCarSpeed(storeCarCharIsInNoSave(playerPed)) > limit + 3.5 then
writeMemory(0xB73458 + 0x21, 255, 255, false)
end
end
if isKeyJustPressed(0xBB) then
enable = not enable
speed = 0
if enable and speed == 0 then
speed = getCarSpeed(storeCarCharIsInNoSave(playerPed))
end
end
end
end
end
tormoz:
if getCarSpeed(storeCarCharIsInNoSave(playerPed)) > limit + 3.5 then
writeMemory(0xB73458 + 0x21, 255, 255, false)
Последнее редактирование: