local sampev = require 'samp.events'
require "lib.moonloader"
require "lib.sampfuncs"
local brownpidor = false
local randomss = 0
local xlast = 0
local ffi = require "ffi"
ffi.cdef[[
void keybd_event(int keycode, int scancode, int flags, int extra);
]]
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
sampAddChatMessage("{FF1493}[PBOT]{ffffff} PUBG BOT By {FF1493}vk.com/tip.samper{ffffff} ”спешно активирован команды: {FF1493}/pbot", -1)
sampRegisterChatCommand('pbot', function()
brownpidor = not brownpidor
printStyledString('PUBG BOT '..(brownpidor and 'ACTIVATED' or 'DEACTIVATED'),1000,2)
end)
while true do
wait(0)
while x == randomss do -- пока переменна¤ x равна переменной xlast (прошлое значение x)
x = math.random(1, 8) -- получить число от 1 до 3
end
randomss = x -- запомнить последнее значение переменной x
wait(4000)
end
end
function EmulateKey(key, isDown)
if not isDown then
ffi.C.keybd_event(key, 0, 2, 0)
else
ffi.C.keybd_event(key, 0, 0, 0)
end
end
function sampev.onShowDialog(id, style, title, but_1, but_2, text)
if id == 4306 then
sampSendDialogResponse(4306, 1, 0, 0)
elseif id == 4300 then
sampSendDialogResponse(4300, 1, 0, '1000')
end
end
function sampev.onServerMessage(color, text)
lua_thread.create(function()
if text:find('/pgps') and brownpidor then
wait(330000)
sampSendChat('/pubg')
wait(3000)
sampSendDialogResponse(541,1,1,0)
rtime = math.random(3000,20000)
wait(rtime)
tox = -1095.1889648438
toy = -1621.7766113281
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
tox = -1115.9633789063
toy = -1621.3603515625
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
wait(300)
sampSendDialogResponse(4306, 1, 0, 0)
wait(500)
sampSendDialogResponse(4300, 1, 0, '1000')
wait(1000)
tox = -1108.5629882813
toy = -1622.3879394531
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
if randomss == 1 then
tox = -1107.9689941406
toy = -1616.2944335938
elseif randomss == 2 then
tox = -1111.3167724609
toy = -1628.0114746094
elseif randomss == 3 then
tox = -1114.0068359375
toy = -1623.2193603516
elseif randomss == 4 then
tox = -1100.5604248047
toy = -1619.2772216797
elseif randomss == 5 then
tox = -1105.3448486328
toy = -1623.2098388672
elseif randomss == 6 then
tox = -1110.2153320313
toy = -1618.4888916016
elseif randomss == 7 then
tox = -1112.2430419922
toy = -1623.8990478516
elseif randomss == 8 then
tox = -1113.5629882813
toy = -1619.1657714844
end
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))
randomss = nil
if stopRun then
stopRun = false
break
end
end
end
if text:find('ћатч началс¤!') and brownpidor then
wait(15000)
setGameKeyState(15, 1)
wait(5000)
sampSendChat("/anim 1")
wait(3000)
setGameKeyState(15, 1)
end
end)
end