CLEO Help Checkpoint Freeze dont work?

CLEO related
Status
Not open for further replies.

FetterTyp

Member
Joined
Sep 9, 2017
Messages
8
Reaction score
0
I want to get a Freeze for 15 Sec. when i drive into a Checkpoint but why the f*+ it dont work?


Code:
{$CLEO .cs}
THREAD "freeze"

repeat
wait 100
until 0AFA:

0B34: "freeze" @freeze 

while true
wait 0
end

:freeze
if
Actor.Driving($PLAYER_ACTOR)
then
if
CALL @is_cp_active 0
then
call @get_cp 0 1@ 2@ 3@
if
Actor.Stopped($PLAYER_ACTOR 1@ 2@ 3@)
then
4@ = Actor.CurrentCar($PLAYER_ACTOR)
05ED: freeze_car 4@
Player.CanMove($PLAYER_CHAR) = False
Actor.LockInCurrentPosition($PLAYER_ACTOR) = True
018C: play_sound 1058 at 0.0 0.0 0.0
wait 15000
05EE: unfreeze_car 4@
Player.CanMove($PLAYER_CHAR) = True
Actor.LockInCurrentPosition($PLAYER_ACTOR) = False
018C: play_sound 1058 at 0.0 0.0 0.0
end
end
end
cmdret

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

:get_cp
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C                     
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0xC
0A8D: 2@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 3@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 4@ = readMem 1@ sz 4 vp 0
0AA3: freelib 0@
0AB2: ret 3 2@ 3@ 4@
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,492
Reaction score
236
Location
( ͡° ͜ʖ ͡°)
FetterTyp said:
Please anyone?

Since you're trying....


PHP:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY



WHILE TRUE
    WAIT 0
    IF
    00DF:   actor $PLAYER_ACTOR driving
    THEN
        03C0: 0@ = actor $PLAYER_ACTOR car
        IF
        0AB1: @is_cp_active 0 // are we in a checkpoint?
        THEN
            0AB1: @get_cp 0 1@ 2@ 3@ // get checkpoint pos
            0407: store_coords_to 4@ 5@ 6@ from_car 0@ with_offset 0.0 0.0 0.0
            050A: 7@ = distance_between_XYZ 1@ 2@ 3@ and_XYZ 4@ 5@ 6@
            IF
            7@ < 4.0 // Radius of Checkpoint, if its smaller then 4 then Stop car
            THEN
                33@ = 0 // reset timer, increases +1 each millisecond
                repeat
                wait 0
                IF
                80DF:   actor $PLAYER_ACTOR driving
                THEN
                    BREAK                
                END
                04BA: set_car 0@ speed_to 0.0 // stop car
                until 33@ > 15000
                REPEAT
                wait 0
                IF
                80DF:   actor $PLAYER_ACTOR driving
                THEN
                    BREAK                
                END
                0407: store_coords_to 4@ 5@ 6@ from_car 0@ with_offset 0.0 0.0 0.0
                050A: 7@ = distance_between_XYZ 1@ 2@ 3@ and_XYZ 4@ 5@ 6@                
                UNTIL 7@ > 4.0 // If is out of the checkpoint...
                wait 3000
                


            END
        END
    END
END
 
Status
Not open for further replies.
Top