CLEO Help How I Can Fps Limit With Ini For Samp 0.3.DL

CLEO related
Status
Not open for further replies.

Bloodriver the Conqueror

Active member
Joined
Mar 23, 2020
Messages
67
Reaction score
14
Location
Turkey
first, hi, i want to do the fps limitation for samp 0.3.DL with ini. how can i do that? sry for my english because my english bad.
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:FPSUNLOCK
{
    0.3.DL
    0AB1: @FPSUNLOCK 0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0xA2400
    0A8D: 30@ = read_memory 31@ size 4 virtual_protect 1
    IF NOT 30@ == 0x5051FF15
    THEN 0A8C: write_memory 31@ size 4 value 0x5051FF15 virtual_protect 1
    END
END
0AB2: ret 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
{$CLEO .cs}

0000:

WAIT 8500

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined
THEN
    IF 0AAB:   file_exists "CLEO\FpsLimiter.ini"
    THEN
        0AF0: 0@ = get_int_from_ini_file "CLEO\FpsLimiter.ini" section "Settings" key "FpsLimit"
        0AB1: @FPS_UNLOCK 0
        0AB1: @SET_FPS 1 FPS_VALUE 0@
    ELSE
        0AB1: @CHECK_FILE_EXIST 0
    END
END

END

:CHECK_FILE_EXIST
// 0AB1: @CHECK_FILE_EXIST 0
IF 8AAB: not_file_exists "CLEO\FpsLimiter.ini"
THEN // create file
    WHILE 8A9A: 20@ = openfile "CLEO\FpsLimiter.ini" mode "at" // IF and SET
    wait 0
    END
    0AD9: write_text "[Settings] %c" in_file 20@ 0xA // 0xA - NEW LINE
    0AD9: write_text "FpsLimit=49 %c" in_file 20@ 0xA // 0xA - NEW LINE
    
    0AD9: write_text "%c" in_file 20@ 0xA // 0xA - NEW LINE
    
    0A9B: closefile 20@
END
0AB2: 0

:FPS_UNLOCK
{
    0.3.DL
    0AB1: @FPS_UNLOCK 0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0xA2400
    0A8D: 30@ = read_memory 31@ size 4 virtual_protect 1
    IF NOT 30@ == 0x5051FF15
    THEN 0A8C: write_memory 31@ size 4 value 0x5051FF15 virtual_protect 1
    END
END
0AB2: ret 0

:SET_FPS
{
    0.3.DL
    0AB1: @SET_FPS 1 FPS_VALUE 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x2ACA0C // samp misc
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
    0A8E: 30@ = 31@ + 0x5D
    0A8E: 29@ = 31@ + 0x31
    IF 0@ > 0
    THEN
        0A8D: 28@ = read_memory 30@ size 4 virtual_protect 0
        IF 803B: 28@ == 0@
        THEN 0A8C: write_memory 30@ size 4 value 0@ virtual_protect 0
        END
        0A8D: 27@ = read_memory 29@ size 4 virtual_protect 0
        IF 803B: 27@ == 0@
        THEN 0A8C: write_memory 29@ size 4 value 0@ virtual_protect 0
        END
        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 14 ms frame delay
        END
        0A8D: 25@ = read_memory 0x619626 size 4 virtual_protect 1
        IF 803B: 25@ == 0@
        THEN 0A8C: write_memory 0x619626 size 4 value 0@ virtual_protect 1
        END
        0A8D: 24@ = read_memory 0xC1704C size 4 virtual_protect 0
        IF 803B: 24@ == 0@
        THEN 0A8C: write_memory 0xC1704C size 4 value 0@ virtual_protect 0
        END
    END
END
0AB2: ret 0
 
Status
Not open for further replies.
Top