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@