LUA Help How can I receive rpc event when the game is paused

Solution
How? I've been trying to figure it out about this one.
This function keeps your game running even when you're ALT + Tabbed out, allowing the game to continue in real-time. Additionally, you can simulate being AFK (Away From Keyboard)

Remember, if you press ESC, the game will be paused, and none of this will work.

Code:
local sampev = require 'lib.samp.events'

function main()
    while not isSampAvailable() do wait(100) end
    if not isSampLoaded() or not isSampfuncsLoaded() then return end

    antiPause()

end

function sampev.onSendPlayerSync()
    -- Use return false to simulate that u are AFK
end

function antiPause()
    writeMemory(7634870, 1, 1, 1)
    writeMemory(7635034, 1, 1, 1)
    memory.fill(7623723, 144, 8)...

Halfastrc24

Active member
Joined
Jun 4, 2021
Messages
45
Solutions
1
Reaction score
6
Location
Greenland
How? I've been trying to figure it out about this one.
This function keeps your game running even when you're ALT + Tabbed out, allowing the game to continue in real-time. Additionally, you can simulate being AFK (Away From Keyboard)

Remember, if you press ESC, the game will be paused, and none of this will work.

Code:
local sampev = require 'lib.samp.events'

function main()
    while not isSampAvailable() do wait(100) end
    if not isSampLoaded() or not isSampfuncsLoaded() then return end

    antiPause()

end

function sampev.onSendPlayerSync()
    -- Use return false to simulate that u are AFK
end

function antiPause()
    writeMemory(7634870, 1, 1, 1)
    writeMemory(7635034, 1, 1, 1)
    memory.fill(7623723, 144, 8)
    memory.fill(5499528, 144, 6)
end
 
Solution

maldivass

Member
Joined
Dec 25, 2022
Messages
12
Reaction score
1
Code:
local memory = require 'memory'
local afk = true

function main()
wait(3000)
    while true do
        wait(0)

        if testCheat('AFK') then
            afk = not afk
            printStringNow(afk and '~g~ AFK ON' or '~r~ AFK OFF', 2000)
        end

        if afk then
            memory.setuint8(7634870, 1, false)
            memory.setuint8(7635034, 1, false)
            memory.fill(7623723, 144, 8, false)
            memory.fill(5499528, 144, 6, false)
        else
            memory.setuint8(7634870, 0, false)
            memory.setuint8(7635034, 0, false)
            memory.hex2bin('0F 84 7B 01 00 00', 7623723, 8)
            memory.hex2bin('50 51 FF 15 00 83 85 00', 5499528, 6)
        end
    end
end
 

Tissue

Member
Joined
Jun 23, 2017
Messages
6
Reaction score
0
This function keeps your game running even when you're ALT + Tabbed out, allowing the game to continue in real-time. Additionally, you can simulate being AFK (Away From Keyboard)

Remember, if you press ESC, the game will be paused, and none of this will work.

Code:
local sampev = require 'lib.samp.events'

function main()
    while not isSampAvailable() do wait(100) end
    if not isSampLoaded() or not isSampfuncsLoaded() then return end

    antiPause()

end

function sampev.onSendPlayerSync()
    -- Use return false to simulate that u are AFK
end

function antiPause()
    writeMemory(7634870, 1, 1, 1)
    writeMemory(7635034, 1, 1, 1)
    memory.fill(7623723, 144, 8)
    memory.fill(5499528, 144, 6)
end
Ooh I see, but what those memory fill means? Like is there any function name in gta/samp that needs to be patched?
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,251
Solutions
6
Reaction score
923
Location
Lithuania
This function keeps your game running even when you're ALT + Tabbed out, allowing the game to continue in real-time. Additionally, you can simulate being AFK (Away From Keyboard)

Remember, if you press ESC, the game will be paused, and none of this will work.

Code:
local sampev = require 'lib.samp.events'

function main()
    while not isSampAvailable() do wait(100) end
    if not isSampLoaded() or not isSampfuncsLoaded() then return end

    antiPause()

end

function sampev.onSendPlayerSync()
    -- Use return false to simulate that u are AFK
end

function antiPause()
    writeMemory(7634870, 1, 1, 1)
    writeMemory(7635034, 1, 1, 1)
    memory.fill(7623723, 144, 8)
    memory.fill(5499528, 144, 6)
end

SAME THING IN CLEO
PHP:
{$CLEO .cs}

0000:

REPEAT
IF 8256:   player $PLAYER_CHAR defined
THEN 0A93: end_custom_thread
END
WAIT 1500
UNTIL 0256:   player $PLAYER_CHAR defined   

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined
THEN
    IF
    0ADC:   test_cheat "AFK"
    THEN
        IF 31@ == FALSE
        THEN
            31@ = TRUE
            0AD1: "~Y~Anti GamePause: ~G~ON" 1337
            0A8C: write_memory 0x747FB6 size 1 value 1 virtual_protect 1 
            0A8C: write_memory 0x74805A size 1 value 1 virtual_protect 1 
            0A8C: write_memory 0x53EA88 size 4 value 0x90909090 virtual_protect 1   
            0A8C: write_memory 0x53EA8C size 2 value 0x9090 virtual_protect 1  
            0A8C: write_memory 0x74542B size 4 value 0x90909090 virtual_protect 1   
            0A8C: write_memory 0x74542F size 4 value 0x90909090 virtual_protect 1 
        ELSE
            31@ = FALSE
            0AD1: "~Y~Anti GamePause: ~R~OFF" 1337
            0A8C: write_memory 0x747FB6 size 1 value 0 virtual_protect 1 
            0A8C: write_memory 0x74805A size 1 value 0 virtual_protect 1 
            0A8C: write_memory 0x53EA88 size 4 value 0x017B840F virtual_protect 1   
            0A8C: write_memory 0x53EA8C size 2 value 0x0000 virtual_protect 1  
            0A8C: write_memory 0x74542B size 4 value 0x15FF5150 virtual_protect 1   
            0A8C: write_memory 0x74542F size 4 value 0x00858300 virtual_protect 1 
        END
    END
END

END
 
Top