local samp = require 'lib.samp.events'
local odej = false
local musor = false
local yashik = false
local kyhnya = false
local ckyhnya = false
local tpPositions = {{292, 2446.54, 1501}, {296.76, 2446.54, 1501}}
local tpPositionId = 1
function main()
while not isSampAvailable() do wait(0) end wait(1)
wait(100)
sampAddChatMessage("{808080}ТСР БОТ {ffffff}| loaded. developed {db27a2}GoxaShow / youtube.com/goxashow",-1)
sampRegisterChatCommand("otsr", function()
odej = not odej
printStringNow("~y~~h~[OdezhdaTSR] ~w~" .. (odej and "ON!" or "OFF!"), 2500)
end)
sampRegisterChatCommand("yatsr", function()
yashik = not yashik
printStringNow("~y~~h~[YashikiTSR] ~w~" .. (yashik and "ON!" or "OFF!"), 2500)
end)
sampRegisterChatCommand("ktsr", function()
kyhnya = not kyhnya
ckyhnya = kyhnya
printStringNow("~y~~h~[KyhnyaTSR] ~w~" .. (kyhnya and "ON!" or "OFF!"), 2500)
end)
sampRegisterChatCommand("mtsr", function()
musor = not musor
printStringNow("~y~~h~[MusorTSR] ~w~" .. (musor and "ON!" or "OFF!"), 2500)
end)
sampRegisterChatCommand("ctsr", function()
SENDSpectatorAlt(-109.44, 2374.27, 1501)
SENDSpectatorAlt(-109.44, 2374.27, 1501)
SENDSpectatorAlt(-109.44, 2374.27, 1501)
end)
while true do wait(0)
if odej then
if findodejda() then
SENDSpectatorAlt(findodejda())
SENDSpectatorAlt(findodejda())
SENDSpectatorAlt(findodejda())
wait(10)
SENDSpectatorAlt(338.8, 2429.7, 1501)
SENDSpectatorAlt(338.8, 2429.7, 1501)
SENDSpectatorAlt(338.8, 2429.7, 1501)
wait(10)
end
end
if musor then
if findmusor() then
SENDSpectatorAlt(findmusor())
SENDSpectatorAlt(findmusor())
SENDSpectatorAlt(findmusor())
wait(10)
SENDSpectatorAlt(-29.2, 1797.6, 17.71)
SENDSpectatorAlt(-29.2, 1797.6, 17.71)
SENDSpectatorAlt(-29.2, 1797.6, 17.71)
wait(10)
end
end
if yashik then
SENDSpectatorAlt(-25.43, 1859.05, 17.71)
wait(10)
SENDSpectatorAlt(-7.80, 1831.51, 17.7)
wait(10)
end
if kyhnya and ckyhnya then
SENDSpectatorAlt(tpPositions[tpPositionId][1], tpPositions[tpPositionId][2], tpPositions[tpPositionId][3])
SENDSpectatorAlt(tpPositions[tpPositionId][1], tpPositions[tpPositionId][2], tpPositions[tpPositionId][3])
SENDSpectatorAlt(tpPositions[tpPositionId][1], tpPositions[tpPositionId][2], tpPositions[tpPositionId][3])
wait(200)
end
end
end
function findodejda()
for i=0, 2048 do
if sampIs3dTextDefined(i) then
local text, color, posX, posY, posZ, distance, ignoreWalls, playerId, vehicleId = sampGet3dTextInfoById(i)
if text:find("Закончила работу") and text:find("Заберите чистые вещи!") then
return posX, posY, posZ-0.8
end
end
end
return false
end
function findmusor()
for a = 1, 1024 do
local pX, pY, pZ = getCharCoordinates(playerPed)
local finded, objecthandle = findAllRandomObjectsInSphere(pX, pY, pZ, 300.0, true)
if finded and doesObjectExist(objecthandle) then
local result, oX, oY, oZ = getObjectCoordinates(objecthandle)
local objmodel = getObjectModel(objecthandle)
if objmodel == 2674 then
return oX, oY, oZ
end
end
end
return false
end
function onSendPacket(id)
if odej or musor or yashik or kyhnya then
if id == 207 or id == 212 then return false end
end
end
function SENDSpectatorAlt(x, y, z)
local data = allocateMemory(18)
PUSSY = not PUSSY
setStructElement(data, 4, 2, PUSSY and 1024 or 0, true)
setStructFloatElement(data, 6, x, true)
setStructFloatElement(data, 10, y, true)
setStructFloatElement(data, 14, z, true)
sampSendSpectatorData(data)
freeMemory(data)
end
function onReceiveRpc(id, bs)
if odej or musor or yashik or kyhnya then
if id == 14 or id == 55 then return false end
if id == 93 then
raknetBitStreamIgnoreBits(bs, 32)
local len = raknetBitStreamReadInt32(bs)
local message = ""
if len > 0 then message = raknetBitStreamReadString(bs, len) end
if message == "[Ошибка] {FFFFFF}У вас в руках нет чистой одежды!" or message == "[Ошибка] {FFFFFF}У вас в руках нет грязной одежды!" or message == "[Подсказка] {FFFFFF}Вы вернули коробку на своё место." or message == "[Ошибка] {FFFFFF}У вас в руках нет ящика!" or message == "[Ошибка] {FFFFFF}У вас в руках нет мусора!" or message == "[Ошибка] {FFFFFF}У вас в руках нет готовой еды!" then return false end
if message:find("Вы достали кусок готового мяса из духовки") or message:find("Ваши руки заняты") then
ckyhnya = false
SENDSpectatorAlt(288.45, 2446.43, 1501)
SENDSpectatorAlt(288.45, 2446.43, 1501)
SENDSpectatorAlt(288.45, 2446.43, 1501)
end
if message:find("Вы успешно положили в холодильник") then
ckyhnya = true
tpPositionId = 1
end
end
end
end
function samp.onShowDialog(dialogId, style, title, btn1, btn2, text)
if kyhnya then
if title:find("Печка") then
tpPositionId = tpPositionId + 1
if tpPositionId == #tpPositions + 1 then tpPositionId = 1 end
local number = 0
for s in string.gmatch(text, "[^[]+") do
if s:find('{FFDB56}Готовое мясо{FFFFFF}') then
sampSendDialogResponse(dialogId, 1, number - 1)
break
else
number = number + 1
end
end
return false
end
end
end