SA:MP Авто доклад авто скрин

KayTushka

Новичок
Автор темы
5
1
Помогите скрипт найти/сделать что бы раз в 10 минут авто тайм + авто скрин был и пост что бы докладывал пожауйста
 

santov

Участник
24
4
pisun:
local screenshotTimer = nil
local isScreenshotActive = false
local fCommandText = "Пост: деньги, тёлки, тачки"
local delayBetweenCycles = 600000

function main()
    sampRegisterChatCommand("fpost", function()
        toggleScreenshotTimer()
    end)
    wait(-1)
end

function toggleScreenshotTimer()
    if isScreenshotActive then
        if screenshotTimer then
            screenshotTimer:terminate()
            screenshotTimer = nil
        end
        isScreenshotActive = false
    else
        screenshotTimer = lua_thread.create(function()
            while true do
                if isSampLoaded() then
                    sampSendChat("/r " .. fCommandText)
                    wait(2000)

                    sampSendChat("/time")
                    wait(1000)

                    require("ffi").cast("void (*__stdcall)()", sampGetBase() + 0x70FC0)()
                end
                wait(delayBetweenCycles)
            end
        end)
        isScreenshotActive = true
    end
end
 
  • Нравится
Реакции: KayTushka

KayTushka

Новичок
Автор темы
5
1
pisun:
local screenshotTimer = nil
local isScreenshotActive = false
local fCommandText = "Пост: деньги, тёлки, тачки"
local delayBetweenCycles = 600000

function main()
    sampRegisterChatCommand("fpost", function()
        toggleScreenshotTimer()
    end)
    wait(-1)
end

function toggleScreenshotTimer()
    if isScreenshotActive then
        if screenshotTimer then
            screenshotTimer:terminate()
            screenshotTimer = nil
        end
        isScreenshotActive = false
    else
        screenshotTimer = lua_thread.create(function()
            while true do
                if isSampLoaded() then
                    sampSendChat("/r " .. fCommandText)
                    wait(2000)

                    sampSendChat("/time")
                    wait(1000)

                    require("ffi").cast("void (*__stdcall)()", sampGetBase() + 0x70FC0)()
                end
                wait(delayBetweenCycles)
            end
        end)
        isScreenshotActive = true
    end
end
А активация?
 

kinamaster22

Известный
1,353
210
Спасибо!

Warning(s007): Exception 0xC0000005 at 0x4B20FC0 - Не скринит и вылазиет варнинг
Lua:
require("moonloader")
require("sampfuncs")
local ffi = require("ffi")

local screenshotTimer = nil
local isScreenshotActive = false
local fCommandText = "ТВОЙ ТЕКСТ ДЛЯ ОТПРАВКИ В РАЦИЮ КАЖДЫЕ 10 МИНУТ"
local delayBetweenCycles = 600000 -- 10 минут

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then
        return
    end
   
    sampRegisterChatCommand("fpost", toggleScreenshotTimer)
   
    wait(-1)
end

function toggleScreenshotTimer()
    if isScreenshotActive then
        if screenshotTimer then
            screenshotTimer:terminate()
            screenshotTimer = nil
        end
        isScreenshotActive = false
    else
        screenshotTimer = lua_thread.create(function()
            while true do
                if isSampLoaded() then
                    sampSendChat("/r " .. fCommandText)
                    wait(2000)

                    sampSendChat("/time")
                    wait(1000)

                    ffi.cast("void (*__stdcall)()", sampGetBase() + 0x70FC0)()
                end
                wait(delayBetweenCycles)
            end
        end)
        isScreenshotActive = true
    end
end
 

KayTushka

Новичок
Автор темы
5
1
Lua:
require("moonloader")
require("sampfuncs")
local ffi = require("ffi")

local screenshotTimer = nil
local isScreenshotActive = false
local fCommandText = "ТВОЙ ТЕКСТ ДЛЯ ОТПРАВКИ В РАЦИЮ КАЖДЫЕ 10 МИНУТ"
local delayBetweenCycles = 600000 -- 10 минут

function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then
        return
    end
  
    sampRegisterChatCommand("fpost", toggleScreenshotTimer)
  
    wait(-1)
end

function toggleScreenshotTimer()
    if isScreenshotActive then
        if screenshotTimer then
            screenshotTimer:terminate()
            screenshotTimer = nil
        end
        isScreenshotActive = false
    else
        screenshotTimer = lua_thread.create(function()
            while true do
                if isSampLoaded() then
                    sampSendChat("/r " .. fCommandText)
                    wait(2000)

                    sampSendChat("/time")
                    wait(1000)

                    ffi.cast("void (*__stdcall)()", sampGetBase() + 0x70FC0)()
                end
                wait(delayBetweenCycles)
            end
        end)
        isScreenshotActive = true
    end
end
Warning(s007): Exception 0xC0000005 at 0x4AD0FC0
 
  • Вау
Реакции: santov