CLEO Help Change My FPS Value

CLEO related

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
I am trying to manually change My MAX FPS value into anything I want for SAMP 0.3.7 R1 via Memory Patching, but I cant find any documentaries about it.

Then I saw this topic which is what I was looking for, but was built for 0.3DL.

If someone knows a snippet/documentary/script regarding changing fps value, kindly share it here.

I am avoiding the usage of processing /fpslimit <value> because this is too unpractical, since I am planning on dynamically change my FPS Limit(for some personal reasons). So manual memory patching would be my best options.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
- FPS growth is different for everyone ( depending on the PC );
- To achieve the effect, you must disable the frame limiter in the game settings;

PHP:
:FPUSUNLOCK
{
    0.3.7 R1
    0AB1: @FPS_UNLOCK 0
}
IF 0AA2: 0@ = "samp.dll"
THEN
    0@ += 0x9D9D0
    0A8C: write_memory 0@ size 4 value 0x5051FF15 virtual_protect 1
END
0AB2: ret 0


:SET_FPS
{
    0.3.7 R1
    0AB1: @SET_FPS 1 FPS_VALUE 0@
}
0A8D: 26@ = read_memory 0xC0BC15 size 4 virtual_protect 1
IF NOT 26@ == 0
THEN 0A8C: write_memory 0xC0BC15 size 4 value 0 virtual_protect 1 // removes frame delay
END
0A8D: 25@ = read_memory 0xBAB318 size 1 virtual_protect 1
IF NOT 25@ == 0
THEN 0A8C: write_memory 0xBAB318 size 1 value 0 virtual_protect 1 // removes frame delay
END
0A8D: 24@ = read_memory 0x53E94C size 1 virtual_protect 1
IF NOT 24@ == 0
THEN 0A8C: write_memory 0x53E94C size 1 value 0 virtual_protect 1 // removes frame delay
END
0A8D: 23@ = read_memory 0x619626 size 4 virtual_protect 1
IF 803B: 23@ == 0@
THEN 0A8C: write_memory 0x619626 size 4 value 0@ virtual_protect 1
END
0A8D: 22@ = read_memory 0xC1704C size 4 virtual_protect 0
IF 803B: 22@ == 0@
THEN 0A8C: write_memory 0xC1704C size 4 value 0@ virtual_protect 0
END
0AB2: ret 0
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
- FPS growth is different for everyone ( depending on the PC );
- To achieve the effect, you must disable the frame limiter in the game settings;

PHP:
:FPUSUNLOCK
{
    0.3.7 R1
    0AB1: @FPS_UNLOCK 0
}
IF 0AA2: 0@ = "samp.dll"
THEN
    0@ += 0x9D9D0
    0A8C: write_memory 0@ size 4 value 0x5051FF15 virtual_protect 1
END
0AB2: ret 0


:SET_FPS
{
    0.3.7 R1
    0AB1: @SET_FPS 1 FPS_VALUE 0@
}
0A8D: 26@ = read_memory 0xC0BC15 size 4 virtual_protect 1
IF NOT 26@ == 0
THEN 0A8C: write_memory 0xC0BC15 size 4 value 0 virtual_protect 1 // removes frame delay
END
0A8D: 25@ = read_memory 0xBAB318 size 1 virtual_protect 1
IF NOT 25@ == 0
THEN 0A8C: write_memory 0xBAB318 size 1 value 0 virtual_protect 1 // removes frame delay
END
0A8D: 24@ = read_memory 0x53E94C size 1 virtual_protect 1
IF NOT 24@ == 0
THEN 0A8C: write_memory 0x53E94C size 1 value 0 virtual_protect 1 // removes frame delay
END
0A8D: 23@ = read_memory 0x619626 size 4 virtual_protect 1
IF 803B: 23@ == 0@
THEN 0A8C: write_memory 0x619626 size 4 value 0@ virtual_protect 1
END
0A8D: 22@ = read_memory 0xC1704C size 4 virtual_protect 0
IF 803B: 22@ == 0@
THEN 0A8C: write_memory 0xC1704C size 4 value 0@ virtual_protect 0
END
0AB2: ret 0



Thanks, but why is this not working?
Code:
{$CLEO}
0000:

wait 5000

while true
    wait 0
        // idea:
            // 1) type fpsba to manually Backup first
            // 2) type fpsse to manually set fps to 10.0
            // 3) wait 5000ms
            // 4) type fpsbe to manually set fps to 200.0
            // 5) wait 5000ms
            // 6) type fpsre to manually reset FPS settings

    if 0ADC: test_cheat "fpsba"
    then
        0AB1: @Backup_FPS 0
        0AD1: "backup" 1000
        wait 1000
    end

    if 0ADC: test_cheat "fpsse"
    then
        0AB1: @Set_FPS 1 _Value 10 // not working
        // 0AB1: @Set_FPS 1 _Value 10.0 // not working too
        0AD1: "set 10" 1000
        wait 1000
    end

    if 0ADC: test_cheat "fpsbe"
    then
        0AB1: @Set_FPS 1 _Value 200 // not working
        // 0AB1: @Set_FPS 1 _Value 200.0 // not working too
        0AD1: "set 200" 1000
        wait 1000
    end

    if 0ADC: test_cheat "fpsre"
    then
        0AB1: @Reset_FPS 0
        0AD1: "reset" 1000
        wait 1000
    end

    0A8D: 0@ = read_memory 0xB7CB50 size 4 virtual_protect TRUE {float} // get FPS thanks to Darkp1xel
    0AD1: "FPS: %f" 200 0@
end

:Set_FPS
{
    0.3.7 R1 - Pointers from Parazitas
    0AB1: @Set_FPS 1 _Value 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
        // FPUSUNLOCK
    31@ += 0x9D9D0
    0A8C: write_memory 31@ size 4 value 0x5051FF15 virtual_protect 1
        //
        // remove frame delay
    0A8D: 26@ = read_memory 0xC0BC15 size 4 virtual_protect 1
    IF 26@ <> 0
    THEN 0A8C: write_memory 0xC0BC15 size 4 value 0 virtual_protect 1 // removes frame delay
    END
    0A8D: 25@ = read_memory 0xBAB318 size 1 virtual_protect 1
    IF 25@ <> 0
    THEN 0A8C: write_memory 0xBAB318 size 1 value 0 virtual_protect 1 // removes frame delay
    END
    0A8D: 24@ = read_memory 0x53E94C size 1 virtual_protect 1
    IF 24@ <> 0
    THEN 0A8C: write_memory 0x53E94C size 1 value 0 virtual_protect 1 // removes frame delay
    END
        //
        // set fps
    0A8D: 23@ = read_memory 0x619626 size 4 virtual_protect 1
    IF 803B: not 23@ == 0@
    THEN 0A8C: write_memory 0x619626 size 4 value 0@ virtual_protect 1
    END
    0A8D: 22@ = read_memory 0xC1704C size 4 virtual_protect 0
    IF 803B: not 22@ == 0@
    THEN 0A8C: write_memory 0xC1704C size 4 value 0@ virtual_protect 0
    END
        //
END
0AB2: ret 0

:Reset_FPS
{
    0.3.7 R1 - Pointers from Parazitas
    0AB1: @Reset_FPS 0
}
IF 0AA2: 30@ = "samp.dll"
THEN
        // FPUSUNLOCK
    30@ += 0x9D9D0
    0A8D: 28@ = read_memory 30@ size 4 virtual_protect 1
    0AC6: 31@ = label @FPSDataBackup pointer
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    if 803B: not 28@ == 29@
    then 0A8C: write_memory 30@ size 4 value 29@ virtual_protect 1
    end
        //
        // frame delay
    31@ += 4
    0A8D: 30@ = read_memory 0xC0BC15 size 4 virtual_protect 1
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    if 803B: not 30@ == 29@
    then 0A8C: write_memory 0xC0BC15 size 4 value 29@ virtual_protect 1
    end
    31@ += 4
    0A8D: 30@ = read_memory 0xBAB318 size 1 virtual_protect 1
    0A8D: 29@ = read_memory 31@ size 1 virtual_protect 1
    if 803B: not 30@ == 29@
    then 0A8C: write_memory 0xBAB318 size 1 value 29@ virtual_protect 1
    end
    31@++
    0A8D: 30@ = read_memory 0x53E94C size 1 virtual_protect 1
    0A8D: 29@ = read_memory 31@ size 1 virtual_protect 1
    if 803B: not 30@ == 29@
    then 0A8C: write_memory 0x53E94C size 1 value 29@ virtual_protect 1
    end
        //
        // set fps
    31@++
    0A8D: 30@ = read_memory 0x619626 size 4 virtual_protect 1
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    if 803B: not 30@ == 29@
    then 0A8C: write_memory 0x619626 size 4 value 29@ virtual_protect 1
    end
    31@ += 4
    0A8D: 30@ = read_memory 0xC1704C size 4 virtual_protect 0
    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
    if 803B: not 30@ == 29@
    then 0A8C: write_memory 0xC1704C size 4 value 29@ virtual_protect 1
    end
        //
END
0AB2: ret 0

:Backup_FPS
{
    0.3.7 R1 - Pointers from Parazitas
    0AB1: @Backup_FPS 0
}
IF 0AA2: 31@ = "samp.dll"
THEN
        // FPUSUNLOCK
    31@ += 0x9D9D0
    0A8D: 30@ = read_memory 31@ size 4 virtual_protect 1
    0AC6: 31@ = label @FPSDataBackup pointer
    0A8C: write_memory 31@ size 4 value 30@ virtual_protect 1
        //
        // frame delay
    31@ += 4
    0A8D: 30@ = read_memory 0xC0BC15 size 4 virtual_protect 1
    0A8C: write_memory 31@ size 4 value 30@ virtual_protect 1
    31@ += 4
    0A8D: 30@ = read_memory 0xBAB318 size 1 virtual_protect 1
    0A8C: write_memory 31@ size 4 value 30@ virtual_protect 1
    31@++
    0A8D: 30@ = read_memory 0x53E94C size 1 virtual_protect 1
    0A8C: write_memory 31@ size 4 value 30@ virtual_protect 1
        //
        // set fps
    31@++
    0A8D: 30@ = read_memory 0x619626 size 4 virtual_protect 1
    0A8C: write_memory 31@ size 4 value 30@ virtual_protect 1
    31@ += 4
    0A8D: 30@ = read_memory 0xC1704C size 4 virtual_protect 0
    0A8C: write_memory 31@ size 4 value 30@ virtual_protect 1
        //
END
0AB2: ret 0

:FPSDataBackup
hex
    00 00 00 00
    00 00 00 00
    00
    00
    00 00 00 00
    00 00 00 00
end
 
Top