MoonBot

Shepard

Активный
Автор темы
459
88
Версия MoonLoader
Другое
Lua:
function onBotRPC(bot, rpcId, bs)
    local bot = mb.getBotHandleByIndex(index)
    if rpcId == 68 then
        local team = bs:readInt8()
        local skin = bs:readInt32()
        local unk = bs:readInt8()
        local x, y, z = bs:readFloat(), bs:readFloat(), bs:readFloat()
        bot.position = {x = x, y = y, z = z}
    end
    if rpcId == 32 or rpcId == 33 then
        sampAddChatMessage("Закрылся")
    end
    if rpcId == 134 then
        local tdId = bs:readInt16()
        sampfuncsLog('td: ' .. tdId)
        if tdId == 637 then
            bot:sendClickTextdraw(637)
            sampAddChatMessage('skin selected', -1)
            bot:sendRequestSpawn()
            bot:sendSpawn()
        end
    end
    if rpcId == 93 then
        local color = bs:readInt32()
        local msg = bs:readString32()
        sampfuncsLog('message: ' .. msg)
        if msg:find("Пока вы") then
            bot:sendRequestSpawn()
            bot:sendSpawn()
        end
    end
    if rpcId == 61 then
        local dialogId = bs:readInt16()
        local style = bs:readInt8()
        local title = bs:readString8()
        local btn1 = bs:readString8()
        local btn2 = bs:readString8()
        sampAddChatMessage(title)
        if title:find('%(1/4%)') then
            bot:sendDialogResponse(dialogId, 1, 0, '123123')
        end
        if title:find("%[2/4%]") then
            local bot = mb.getBotHandleByIndex(index)
            bot:sendDialogResponse(dialogId, 1, 0, '')
        end
        if title:find("%[3/4%]") then
            local bot = mb.getBotHandleByIndex(index)
            bot:sendDialogResponse(dialogId, 1, 1, '')
        end
        if title:find("%[4/4%]") then
            bot:sendDialogResponse(dialogId, 1, 2, '')
            sampAddChatMessage("Отправили",-1)
            bot:sendRequestSpawn()
            bot:sendSpawn()
        end
    end
end
Не выбирает текстдрав "Selected" - выбор скина на аризоне, что сделать?
 
Решение
Lua:
if rpcId == 134 then
    local tdId = bs:readInt16()
    bs:ignoreBits(8 + 32 + 32 + 32 + 32 + 32 + 32 + 8 + 8 + 32 + 8 + 8)
    local x, y = math.floor(bs:readFloat()), math.floor(bs:readFloat())
    if x == 233 and y == 337 then
        local data = mb.getPlayerData()
        data.health = bot.hp
        data.armor = bot.armor
        data.position.x, data.position.y, data.position.z = bot.position.x, bot.position.y, bot.position.z
        bot:sendPlayerData(data)
        bot:sendClickTextdraw(tdId)
        sampAddChatMessage('Выбираю скин', -1)
    end
end

Lolendor

вотофак
Проверенный
546
567
Lua:
if rpcId == 134 then
    local tdId = bs:readInt16()
    bs:ignoreBits(8 + 32 + 32 + 32 + 32 + 32 + 32 + 8 + 8 + 32 + 8 + 8)
    local x, y = math.floor(bs:readFloat()), math.floor(bs:readFloat())
    if x == 233 and y == 337 then
        local data = mb.getPlayerData()
        data.health = bot.hp
        data.armor = bot.armor
        data.position.x, data.position.y, data.position.z = bot.position.x, bot.position.y, bot.position.z
        bot:sendPlayerData(data)
        bot:sendClickTextdraw(tdId)
        sampAddChatMessage('Выбираю скин', -1)
    end
end
 
  • Нравится
Реакции: Shepard