Помощь в изменении скриптов

FYP

Известный
Автор темы
Администратор
1,758
5,732
Здесь вы можете попросить других пользователей внести какие-то небольшие изменения в скрипт, например, изменить активацию.
Для вопросов по программированию и разработке на форуме есть отдельная категория Разработка.

Рекомендации:
  1. Не просите о редактировании .asi, .sf, .luac, .dll, .exe и прочих файлов, не поддающихся простой декомпиляции. Скрипты формата .ahk (AutoHotKey), .lua (Lua/MoonLoader) и .cs (CLEO) легко поддаются изменению.
  2. Сообщения по типу "спасибо, помог" по правилам форума считаются флудом и скорее всего будут удалены. Если вам помогли, вы можете нажать кнопку Мне нравится под ответом - это даст понять, что ответ верный.
  3. За злонамеренное распространение вредоносного ПО - перманентный бан. Имейте это в виду.
Удаление копирайтов является нарушением авторских прав, если автор не дал на это своего разрешения. Правила BlastHack запрещают нарушать авторские права, поэтому если вам нужно их убрать - обращайтесь к автору.
 
Последнее редактирование:

Rossi98

Новичок
4
0
Как сделать задержку между отправками сообщения в чат, т.к. сейчас оно делить длинное сообщение на 2, и отправляет его в одну и ту же секунду, а нужно между первой и второй строкой сделать задержку 1250мск?! Заранее спасибо.


Lua:
script_name("extraMessages")
script_version_number("0.3.1")
script_description("Divides one long message into two short messages.")
script_author("AppleThe")

local sampev = require 'lib.samp.events'
commands = {"f", "r", "t", "n", "w", "s"}
bi = false

function sampev.onSendCommand(msg)
    if bi then bi = false; return end
    local cmd, msg = msg:match("/(%S*) (.*)")
    if msg == nil then return end
    -- cmd = cmd:lower()

    --Рация, радио, ООС чат, шепот, крик (с поддержкой переноса ООС-скобок)
    for i, v in ipairs(commands) do if cmd == v then
        local length = msg:len()
        if msg:sub(1, 2) == "((" then
            msg = string.gsub(msg:sub(4), "%)%)", "")
            if length > 80 then divide(msg, "/" .. cmd .. " (( ", " ))"); return false end
        else
            if length > 80 then divide(msg, "/" .. cmd .. " ", ""); return false end
        end
    end end

    --РП команды
    if cmd == "me" or cmd == "do" then
        local length = msg:len()
        if length > 75 then divide(msg, "/" .. cmd .. " ", "", "ext"); return false end
    end

    --SMS
    if cmd == "sms" then
        local msg = "{}" .. msg
        local number, _msg = msg:match("{}(%d+) (.*)")
        local msg = msg:sub(3)
        if _msg == nil then -- если номер не указан, ищется ближайшее полученное/отправленное сообщение
            for i = 1, 99 do                     -- номер берется из него
                local test = sampGetChatString(i):match("SMS: .* | .*: (.*)")
                if test ~= nil then number = string.match(test, ".* %[.*%.(%d+)%]") end
            end
        else msg = _msg end
        if number == nil then return end
        local length = msg:len()

        -- long SMS
        if length > 66 then divide(msg, "/sms " .. number .. " ", "", "sms"); return false end

        -- short SMS
        if length < 66 then bi = true; sampSendChat("/sms " .. number .. " " .. msg); return false end
    end
end

function sampev.onServerMessage(color, text)
    if color == -65281 and text:find(" %| Получатель: ") then
        return {bit.tobit(0xFFCC00FF), text}
    end
end

function sampev.onSendChat(msg) -- IC чат
    if bi then bi = false; return end
    local length = msg:len()
    if length > 90 then
        divide(msg, "", "")
        return false
    end
end

function divide(msg, beginning, ending, doing) -- разделение сообщения msg на два
    if doing == "sms" then limit = 57 else limit = 72 end
    
    -- -- -- ВЕРСИЯ С ПРИОРИТЕТОМ ТЕКСТА ДЛЯ ПЕРВОГО СООБЩЕНИЯ (ХУЕТА) -- -- --
    -- local one, two = string.match(msg:sub(limit), "(%S*) (.*)")
    -- if one == nil then one = "" end
    -- local one, two = msg:sub(1, limit - 1) .. one .. "...", "..." .. two
    
    -- ВЕРСИЯ С ПРИОРИТЕТОМ ТЕКСТА ДЛЯ ВТОРОГО СООБЩЕНИЯ (ЗБС НО НЕ РАБОТАЕТ) --
    -- local one, two = string.match(msg:sub(1, msg:len() - limit), "(.*) (.*)")
    -- if two == nil then two = "" end
    -- local one, two = one .. "...", "..." .. two .. msg:sub(msg:len() - limit + 1, msg:len())
    
    -- ВЕРСИЯ С ПРИОРИТЕТОМ ТЕКСТА ДЛЯ ВТОРОГО СООБЩЕНИЯ (ПОКА ЧТО РАБОТАЕТ) --
    local one, two = string.match(msg:sub(1, limit), "(.*) (.*)")
    if two == nil then two = "" end
    local one, two = one .. "...", "..." .. two .. msg:sub(limit + 1, msg:len())

    bi = true; sampSendChat(beginning .. one .. ending)
    if doing == "ext" then
        beginning = "/do "
        if two:sub(-1) ~= "." then two = two .. "." end
    end
    bi = true; sampSendChat(beginning .. two .. ending)
end

function main()
  if not isCleoLoaded() or not isSampfuncsLoaded() or not isSampLoaded() then return end
  while not isSampAvailable() do wait(100) end
    if not sampGetCurrentServerName():find("Advance RolePlay") then return end
    wait(-1)
end
 

Brrskibidi

Новичок
1
0
Добрый день, нужно сделать так чтобы скрипт не бежал к маркеру со сменой формы, если на нем скин 240 id, буду благодарен.
 

Вложения

  • afkZP.lua
    5.6 KB · Просмотры: 0
  • settingsZP.ini
    5 байт · Просмотры: 0

Митя Евгеньевич

Известный
312
125
Как сделать задержку между отправками сообщения в чат, т.к. сейчас оно делить длинное сообщение на 2, и отправляет его в одну и ту же секунду, а нужно между первой и второй строкой сделать задержку 1250мск?! Заранее спасибо.


Lua:
script_name("extraMessages")
script_version_number("0.3.1")
script_description("Divides one long message into two short messages.")
script_author("AppleThe")

local sampev = require 'lib.samp.events'
commands = {"f", "r", "t", "n", "w", "s"}
bi = false

function sampev.onSendCommand(msg)
    if bi then bi = false; return end
    local cmd, msg = msg:match("/(%S*) (.*)")
    if msg == nil then return end
    -- cmd = cmd:lower()

    --Рация, радио, ООС чат, шепот, крик (с поддержкой переноса ООС-скобок)
    for i, v in ipairs(commands) do if cmd == v then
        local length = msg:len()
        if msg:sub(1, 2) == "((" then
            msg = string.gsub(msg:sub(4), "%)%)", "")
            if length > 80 then divide(msg, "/" .. cmd .. " (( ", " ))"); return false end
        else
            if length > 80 then divide(msg, "/" .. cmd .. " ", ""); return false end
        end
    end end

    --РП команды
    if cmd == "me" or cmd == "do" then
        local length = msg:len()
        if length > 75 then divide(msg, "/" .. cmd .. " ", "", "ext"); return false end
    end

    --SMS
    if cmd == "sms" then
        local msg = "{}" .. msg
        local number, _msg = msg:match("{}(%d+) (.*)")
        local msg = msg:sub(3)
        if _msg == nil then -- если номер не указан, ищется ближайшее полученное/отправленное сообщение
            for i = 1, 99 do                     -- номер берется из него
                local test = sampGetChatString(i):match("SMS: .* | .*: (.*)")
                if test ~= nil then number = string.match(test, ".* %[.*%.(%d+)%]") end
            end
        else msg = _msg end
        if number == nil then return end
        local length = msg:len()

        -- long SMS
        if length > 66 then divide(msg, "/sms " .. number .. " ", "", "sms"); return false end

        -- short SMS
        if length < 66 then bi = true; sampSendChat("/sms " .. number .. " " .. msg); return false end
    end
end

function sampev.onServerMessage(color, text)
    if color == -65281 and text:find(" %| Получатель: ") then
        return {bit.tobit(0xFFCC00FF), text}
    end
end

function sampev.onSendChat(msg) -- IC чат
    if bi then bi = false; return end
    local length = msg:len()
    if length > 90 then
        divide(msg, "", "")
        return false
    end
end

function divide(msg, beginning, ending, doing) -- разделение сообщения msg на два
    if doing == "sms" then limit = 57 else limit = 72 end
 
    -- -- -- ВЕРСИЯ С ПРИОРИТЕТОМ ТЕКСТА ДЛЯ ПЕРВОГО СООБЩЕНИЯ (ХУЕТА) -- -- --
    -- local one, two = string.match(msg:sub(limit), "(%S*) (.*)")
    -- if one == nil then one = "" end
    -- local one, two = msg:sub(1, limit - 1) .. one .. "...", "..." .. two
 
    -- ВЕРСИЯ С ПРИОРИТЕТОМ ТЕКСТА ДЛЯ ВТОРОГО СООБЩЕНИЯ (ЗБС НО НЕ РАБОТАЕТ) --
    -- local one, two = string.match(msg:sub(1, msg:len() - limit), "(.*) (.*)")
    -- if two == nil then two = "" end
    -- local one, two = one .. "...", "..." .. two .. msg:sub(msg:len() - limit + 1, msg:len())
 
    -- ВЕРСИЯ С ПРИОРИТЕТОМ ТЕКСТА ДЛЯ ВТОРОГО СООБЩЕНИЯ (ПОКА ЧТО РАБОТАЕТ) --
    local one, two = string.match(msg:sub(1, limit), "(.*) (.*)")
    if two == nil then two = "" end
    local one, two = one .. "...", "..." .. two .. msg:sub(limit + 1, msg:len())

    bi = true; sampSendChat(beginning .. one .. ending)
    if doing == "ext" then
        beginning = "/do "
        if two:sub(-1) ~= "." then two = two .. "." end
    end
    bi = true; sampSendChat(beginning .. two .. ending)
end

function main()
  if not isCleoLoaded() or not isSampfuncsLoaded() or not isSampLoaded() then return end
  while not isSampAvailable() do wait(100) end
    if not sampGetCurrentServerName():find("Advance RolePlay") then return end
    wait(-1)
end
Lua:
function divide(msg, beginning, ending, doing) -- разделение сообщения msg на два
    if doing == "sms" then limit = 57 else limit = 72 end
    local one, two = string.match(msg:sub(1, limit), "(.*)")
    if two == nil then two = "" end
    local one, two = one .. "...", "..." .. two .. msg:sub(limit + 1, msg:len())
    lua_thread.create(function()
        bi = true; sampSendChat(beginning .. one .. ending)
        if doing == "ext" then
            beginning = "/do "
            if two:sub(-1) ~= "." then two = two .. "." end
        end
        wait(1250) -- задержка
        bi = true; sampSendChat(beginning .. two .. ending)
    end)
end
 
Последнее редактирование:

Masterfada

Новичок
13
0
Доброе утро, нужно убрать логотип активации
1715488341490.png
 

Вложения

  • antiP.lua
    9.6 KB · Просмотры: 3

Rossi98

Новичок
4
0
Lua:
function divide(msg, beginning, ending, doing) -- разделение сообщения msg на два
    if doing == "sms" then limit = 57 else limit = 72 end
    local one, two = string.match(msg:sub(1, limit), "(.*)")
    if two == nil then two = "" end
    local one, two = one .. "...", "..." .. two .. msg:sub(limit + 1, msg:len())
    lua_thread.create(function()
        bi = true; sampSendChat(beginning .. one .. ending)
        if doing == "ext" then
            beginning = "/do "
            if two:sub(-1) ~= "." then two = two .. "." end
        end
        wait(1250) -- задержка
        bi = true; sampSendChat(beginning .. two .. ending)
    end)
end
Спасибо огромное. Но я уже раньше сделал, нашёл похожий скрипт, и там позаимствовал. А такой вопрос, можно ли это сделать так, что если сообщение ещё длиннее, то скрипт будет делить его на 3 штуки, или самп всё равно не даст отправить в чат более 128ми символов?!
Я делал, чтобы делило на 3, оно делит, но второе сообщение получается короткое, примерно в 8-10 символов...
 

Митя Евгеньевич

Известный
312
125

Masterfada

Новичок
13
0
В функции main убери из цикла while true do строчку renderFontDrawText(my_font, 'Anti - Polizei:\n'.. (act and '{00FF00}Включен' or '{FF0000}Выключен'), 50, pos, 0xFFFFFFFF)Сп
В функции main убери из цикла while true do строчку renderFontDrawText(my_font, 'Anti - Polizei:\n'.. (act and '{00FF00}Включен' or '{FF0000}Выключен'), 50, pos, 0xFFFFFFFF)
Спасибо. А можно сделать так что бы в углу экрана загоралась какая нибудь точка когда он включен
 

XSAS

Новичок
8
1
Доброго времени суток, нужна помощь по клео скрипту.
Нужно добавить возможность передвигать интерфейс скрипта по экрану или отключать его (сделать что либо из этого, что для вас будет проще)
Ранее использовался данный скрипт: www.blast.hk/threads/14068/ , в нем красивый интерфейс, но не работает сбив, прикладываю его к посту, может вы используете интерфейс из того скрипта, что бы исправить этот.
Мне неизвестно, заблокированы скрипты или нет, я не разбираюсь, помогите, пожалуйста.
 

Вложения

  • drugtimer.cs
    20.2 KB · Просмотры: 2
  • drugtimer.ini
    57 байт · Просмотры: 1

D3.Pheonix

🎹
Модератор
2,819
1,597
The T file was created for the Samp R1 version, when I use it with R4 and R5 the game crashes when I get into the car. Is there any way to make this compatible with newer versions of SAMP? I tried to do it myself, but it didn't work.
It seems to me that the dependence on sampfuncs is unnecessary for this script, since it only checks that the chat is closed upon activation.
I removed this check, the script still works, but keep in mind that it will also trigger on capslock, when chat is open.
You may want to change the activation, so I added a configuration file (will appear after the first launch) where you can change the key. The default is capslock.
List of keycodes: click
 

Вложения

  • AtravessarParedesComVeiculos.cs
    19.8 KB · Просмотры: 1