- 81
- 8
- Версия MoonLoader
- .027.0-preview
Lua:
local run = false
function runToPoint(tox, toy)
local x, y, z = getCharCoordinates(PLAYER_PED)
local angle = getHeadingFromVector2d(tox - x, toy - y)
local xAngle = math.random(-50, 50)/100
setCameraPositionUnfixed(xAngle, math.rad(angle - 90))
stopRun = false
while getDistanceBetweenCoords2d(x, y, tox, toy) > 0.8 do
setGameKeyState(1, -255)
--setGameKeyState(16, 1)
wait(1)
x, y, z = getCharCoordinates(PLAYER_PED)
angle = getHeadingFromVector2d(tox - x, toy - y)
setCameraPositionUnfixed(xAngle, math.rad(angle - 90))
if stopRun then
stopRun = false
break
end
end
end
function main()
repeat wait(0) until isSampAvailable()
sampRegisterChatCommand('cmds',function()
run = not run
sampAddChatMessage('Состояние: ' ..(run and 'Вкл' or 'Выкл'),-1)
end)
while true do wait(0)
if run then
for i = 0,2048 do
if sampIs3dTextDefined(i) then
text, clr, posX, posY, posZ, dist, wh, plid, vehid = sampGet3dTextInfoById(i)
if string.match(text,'урожая') then
runToPoint(posX,posY)
run = false
end
end
end
end
end
end