ищу скрипт

Решение
Lua:
local ev = require("samp.events")
local active = false
pref = "{ff0000}[{ffffff}CAREJECTOR{ff0000}]{ffffff} "
function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand("carejector", function ()
        active = not active
        if active then sampAddChatMessage(pref.."Выбрасыватель из тачек {00ff00}АКТИВИРОВАН.", -1)
        else sampAddChatMessage(pref.."Выбрасыватель из тачек {ff0000}ДЕАКТИВИРОВАН.", -1) end
    end)
    sampAddChatMessage(pref.."Выбрасыватель из тачек {ffff00}загружен. {ffffff}Автор: stool (bg, tg: @sto_ol)", -1)
    lua_thread.create(function ()
        while true do
            if isCharInAnyCar(PLAYER_PED) and active...

stool

Известный
426
342
Lua:
local active = false
function autoeject()
    while true do
        if isCharInAnyCar(PLAYER_PED) and active then
            local car = storeCarCharIsInNoSave(PLAYER_PED)
            local maxPeds = getMaximumNumberOfPassengers(car)
            for i=1, maxPeds do
                if not isCarPassengerSeatFree(car, i) and i ~= 1 then
                    local ped = getCharInCarPassengerSeat(car, i)
                    local pedID = sampGetPlayerIdByCharHandle(ped)
                    sampSendChat(("/eject %s"):format(pedID))
                    wait(1000)
                end
            end
        end
        wait(10)
    end
end
function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand("carejector", function () active = not active end)
    lua_thread.create(autoeject)
    while true do wait(0) end
end
попробуй вот это
команда для активации /carejector
каждые 10мс будет искать в тачке кого угодно кроме тебя и каждую секунду будет пытаться его выкинуть из машины (любое количество пассажиров)
 
  • Нравится
  • Эм
Реакции: MLycoris и MonarhisT

asdasd12390

Новичок
Автор темы
16
4
Lua:
local active = false
function autoeject()
    while true do
        if isCharInAnyCar(PLAYER_PED) and active then
            local car = storeCarCharIsInNoSave(PLAYER_PED)
            local maxPeds = getMaximumNumberOfPassengers(car)
            for i=1, maxPeds do
                if not isCarPassengerSeatFree(car, i) and i ~= 1 then
                    local ped = getCharInCarPassengerSeat(car, i)
                    local pedID = sampGetPlayerIdByCharHandle(ped)
                    sampSendChat(("/eject %s"):format(pedID))
                    wait(1000)
                end
            end
        end
        wait(10)
    end
end
function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand("carejector", function () active = not active end)
    lua_thread.create(autoeject)
    while true do wait(0) end
end
попробуй вот это
команда для активации /carejector
каждые 10мс будет искать в тачке кого угодно кроме тебя и каждую секунду будет пытаться его выкинуть из машины (любое количество пассажиров)
не работает
 
  • Грустно
Реакции: штукатур

stool

Известный
426
342
Lua:
local ev = require("samp.events")
local active = false
pref = "{ff0000}[{ffffff}CAREJECTOR{ff0000}]{ffffff} "
function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand("carejector", function ()
        active = not active
        if active then sampAddChatMessage(pref.."Выбрасыватель из тачек {00ff00}АКТИВИРОВАН.", -1)
        else sampAddChatMessage(pref.."Выбрасыватель из тачек {ff0000}ДЕАКТИВИРОВАН.", -1) end
    end)
    sampAddChatMessage(pref.."Выбрасыватель из тачек {ffff00}загружен. {ffffff}Автор: stool (bg, tg: @sto_ol)", -1)
    lua_thread.create(function ()
        while true do
            if isCharInAnyCar(PLAYER_PED) and active then
                local car = storeCarCharIsInNoSave(PLAYER_PED)
                local maxPeds = getMaximumNumberOfPassengers(car)
                local _, playerPedID = sampGetPlayerIdByCharHandle(PLAYER_PED)
                for i=0, maxPeds do
                    if not isCarPassengerSeatFree(car, i) then
                        -- print(os.time(), "DA SUKA RABOTAI!! PASSENGER SEAT :", i)
                        local ped = getCharInCarPassengerSeat(car, i)
                        local result, pedID = sampGetPlayerIdByCharHandle(ped)
                        if result then
                            if pedID ~= playerPedID then
                                -- sampAddChatMessage("NAHUI PASSAJIRA: " .. pedID, -1)
                                sampSendChat(("/eject %s"):format(pedID))
                                wait(10)
                            end
                        end                      
                    end
                end
            end
            wait(10)
        end
    end)
    while true do wait(0) end
end
function ev.onServerMessage(color, text)
    if active then
        if text:find("Не флуди!") then return false end
        if text:find("попытался выкинуть из транспорта игрока") then return false end
    end
end

на лаунчере не работает, только на сборке

Lua:
local ev = require("samp.events")
local active = false
local interval = 0.1
local lasttry = 0
pref = "{ff0000}[{ffffff}CAREJECTOR{ff0000}]{ffffff} "

function main()
    if not isSampLoaded() then return end
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand("carejector", function ()
        active = not active
        if active then sampAddChatMessage(pref.."Выбрасыватель из тачек {00ff00}АКТИВИРОВАН.", -1)
        else sampAddChatMessage(pref.."Выбрасыватель из тачек {ff0000}ДЕАКТИВИРОВАН.", -1) end
    end)
    sampAddChatMessage(pref.."Выбрасыватель из тачек {ffff00}загружен. {ffffff}Автор: stool (bg, tg: @sto_ol)", -1)
    while true do wait(0) end
end

function ev.onServerMessage(color, text)
    if active then
        if text:find("Не флуди!") then return false end
        if text:find("попытался выкинуть из транспорта игрока") then return false end
    end
end

function ev.onPassengerSync(player_id, passengersyncdata)
    if active and ((os.clock() - lasttry) > interval) then
        lasttry = os.clock()
        sampSendChat(("/eject %s"):format(player_id))
    end
end

попытка зарешать это на лаунчере (p.s. работает)

release: https://www.blast.hk/threads/212530/
 
Последнее редактирование:
  • Нравится
Реакции: asdasd12390