script_name("BOT MAIN BY BONDY")
script_authors("Bondy")
script_version("0.1")
script_dependencies("CLEO")
require("lib.moonloader")
slot0 = require("samp.events")
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then
return
end
sampRegisterChatCommand("gom", cmd_bot)
slot0 = {}
slot1 = {}
slot2 = {}
while true do
wait(0)
if isPlayerPlaying(playerHandle) and enabled then
BeginToPoint(-1905.97998, -1649.910034, 21.780001, 1, -255, false)
wait(1000)
wait(1000)
BeginToPoint(-1855.089966, -1630.550049, 21.93, 1, -255, false)
BeginToPoint(-1857.060059, -1611.599976, 21.799999, 1, -255, false)
wait(1000)
wait(1000)
BeginToPoint(-1857.76001, -1633.109985, 21.790001, 1, -255, false)
end
end
end
function BeginToPoint(slot0, slot1, slot2, slot3, slot4, slot5)
repeat
slot6, slot7, slot8 = GetCoordinates()
SetAngle(slot0, slot1, slot2)
MovePlayer(slot4, slot5)
slot9 = getDistanceBetweenCoords3d(slot0, slot1, slot2, slot6, slot7, slot2)
wait(0)
until not enabled or slot9 < slot3
end
function MovePlayer(slot0, slot1)
setGameKeyState(1, slot0)
if slot1 then
setGameKeyState(16, 255)
end
end
function SetAngle(slot0, slot1, slot2)
slot3, slot4, slot5 = GetCoordinates()
if isCharInAnyCar(playerPed) then
setCarHeading(storeCarCharIsInNoSave(playerPed), getHeadingFromVector2d(slot0 - slot3, slot1 - slot4))
else
setCharHeading(playerPed, slot8)
end
restoreCameraJumpcut()
end
function GetCoordinates()
if isCharInAnyCar(playerPed) then
return getCarCoordinates(storeCarCharIsInNoSave(playerPed))
else
return getCharCoordinates(playerPed)
end
end
function cmd_bot(slot0)
enabled = not enabled
if enabled then
sampAddChatMessage(string.format("[%s]: Активирован", thisScript().name), 4259648)
else
sampAddChatMessage(string.format("[%s]: Деактивирован", thisScript().name), 16728128)
end
end
function setEntityCoordinates(slot0, slot1, slot2, slot3)
if slot0 ~= 0 and readMemory(slot0 + 20, 4, false) ~= 0 then
slot5 = slot4 + 48
writeMemory(slot5 + 0, 4, representFloatAsInt(slot1), false)
writeMemory(slot5 + 4, 4, representFloatAsInt(slot2), false)
writeMemory(slot5 + 8, 4, representFloatAsInt(slot3), false)
end
end