script_author("step")
script_name("farmhelp")
script_version(1)
require("lib.moonloader")
require("lib.sampfuncs")
require("lib.vkeys")
slot0 = require("lib.samp.events")
slot1 = 56576
slot2 = 255
slot3 = 65535
slot4 = 16711680
slot5 = 0
slot6 = 16777215
slot7 = 16711935
slot8 = 10027263
slot9 = 65280
stat = false
coords = {
{
z = 1044,
x = 2559,
y = -1287
},
{
z = 1044,
x = 2551,
y = -1287
},
{
z = 1044,
x = 2542,
y = -1287
},
{
z = 1044,
x = 2543,
y = -1300
},
{
z = 1044,
x = 2551,
y = -1300
},
{
z = 1044,
x = 2559,
y = -1300
},
{
z = 1044,
x = 2564,
y = -1293
}
}
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then
return
end
while not isSampAvailable() do
wait(100)
end
sampAddChatMessage("{00FF00}FarmHelp load", uv0)
sampRegisterChatCommand("farmhelp", dmg_cmd)
math.randomseed(os.time())
while true do
wait(0)
end
end
function farmhelp()
slot0, slot1, slot2, slot3 = getTargetBlipCoordinates()
coord = getCharCoordinates(PLAYER_PED)
if slot0 then
while true do
wait(5000)
sampSendChat("/mn")
wait(10000)
sampSendChat("/stats")
wait(100000)
sampSendChat("Я устал играть")
wait(2000000)
runToPoint(slot1, slot2)
wait(100000)
sampSendChat("Господи, что за игра?")
wait(200000)
sampSendChat("/fhelp")
end
end
end
function runToPoint(slot0, slot1)
slot2, slot3, slot4 = getCharCoordinates(PLAYER_PED)
setCameraPositionUnfixed(math.random(-50, 50) / 100, math.rad(getHeadingFromVector2d(slot0 - slot2, slot1 - slot3) - 90))
stopRun = false
while getDistanceBetweenCoords2d(slot2, slot3, slot0, slot1) > 0.8 do
setGameKeyState(1, -255)
setGameKeyState(16, 1)
wait(1)
slot2, slot3, slot4 = getCharCoordinates(PLAYER_PED)
setCameraPositionUnfixed(slot6, math.rad(getHeadingFromVector2d(slot0 - slot7, slot1 - slot8) - 90))
if stopRun then
stopRun = false
break
end
end
end
function runToRandom()
if math.random(7) > 0 then
runToPoint(coords[slot0].x, coords[slot0].y, coords[slot0].z)
end
end
function dmg_cmd()
if not stat then
stat = true
tread = lua_thread.create(farmhelp)
sampAddChatMessage("FarmHelp activated", uv0)
sost = 1
else
stat = false
tread:terminate()
sampAddChatMessage("FarmHelp deactivated", uv1)
end
end