Lua [ARZ] CWanted | Быстрый поиск игроков с розыском

VRush

https://t.me/vrushscript
Проверенный
2,344
1,093
уже есть такой скрипт...


Код:
local sampev = require 'samp.events'

require 'lib.moonloader'

function msg(arg)
    sampAddChatMessage("{1E90FF}[TomPolice]: {FFFFFF} "..arg)
end

local rabota = 1

function main()
    while not isSampAvailable() do wait(100) end
    msg("Загружено!")
    sampRegisterChatCommand("findwanted", function()
        rabota = true
        msg("Идёт загрузка!")
        for i = 0, 1000 do
            if sampIsPlayerConnected(i) then
                local result, Pedped = sampGetCharHandleBySampPlayerId(i)
                if result then
                    if rabota then
                        sampSendChat("/find ".. i)
                    end
                end
            end
        end
        rabota = false
        msg("Скрипт завершил свою работу!")
    end)
    while true do
        wait(0)
    end
end

function sampev.onServerMessage(color, text)
    if rabota then
        if text:find("Вы не можете разыскивать игрока который не преступник!") then
            return false
        end
        if text:find("Местоположение (%a+_%a+)%[(%d+)%] отмечено на карте красным маркером!") then
            rabota = false
        end
    end
end