CLEO Help Is Checkpoint active

CLEO related
Status
Not open for further replies.

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
So i tried to make a code which allows u to disable the checkpoint by pressing the key K.
When you press K it sees if there is an active checkpoint, then types /killcp, however, it crashes.
Code:
WHILE TRUE
WAIT 0

    IF AND
    NOT SAMP.ChatInputOpened()
    key_down 75
    THEN
        IF 0AB1: @is_racecp_active 0
        THEN
            say "/killcp"
        ELSE
            chatmsg "{ff0000}[TaxiCMD]: {cecece}There is no active checkpoint." -1
        END
        wait 1000
    END
END

:is_racecp_active
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x212A94
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x49
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0
 

JaggerJam

Active member
Joined
Sep 14, 2017
Messages
97
Reaction score
21
So i tried to make a code which allows u to disable the checkpoint by pressing the key K.
When you press K it sees if there is an active checkpoint, then types /killcp, however, it crashes.
Code:
WHILE TRUE
WAIT 0

    IF AND
    NOT SAMP.ChatInputOpened()
    key_down 75
    THEN
        IF 0AB1: @is_racecp_active 0
        THEN
            say "/killcp"
        ELSE
            chatmsg "{ff0000}[TaxiCMD]: {cecece}There is no active checkpoint." -1
        END
        wait 1000
    END
END

:is_racecp_active
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x212A94
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0x49
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    IF 1@ == TRUE
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
    0AA3: freelib 0@
END
0AB2: ret 0
Code:
{$CLEO}
0000:

repeat
wait 0
until SAMP.Available()


while true
wait 0

    if and
    not SAMP.ChatInputOpened()
    0C89:  key_just_pressed 75
    THEN
        IF 0AB1: call @isActive_cp 0
        THEN
            say "/killcp"
        ELSE
            chatmsg "{ff0000}[TaxiCMD]: {cecece}There is no active checkpoint." -1
        END
    END

END

:isActive_cp
0BB2: samp 3@ = get_misc_info_ptr
3@ += 36
0A8D: 4@ = read_memory 3@ size 4 virtual_protect 0
if 4@ == true
then    
   0485:  return_true
else  
   059A:  return_false
end
ret 0
 
Status
Not open for further replies.
Top