CLEO Help Speed limit - 0.3.7-R4

CLEO related

habinabi

Active member
Joined
Nov 10, 2019
Messages
51
Reaction score
2
Location
Czech Republic
hi, i needed to write a speed limit of 17 and in order to turn it on and off, I put a show text in there to let me write when the limit is on, but I don't know why, it always crashes right after I start the game

PHP:
{$CLEO .cs}

//-------------MAIN---------------
0001: wait 2000 ms
0006: 0@ = 0

if
    0AB0:   key_pressed 103
then
    if
        0039:   0@ == 1
    then
        0ACD: show_text_highpriority "~B~Speed limit ~R~OFF" time 1337
        0006: 0@ = 0 
    else
        0006: 0@ = 1
    end
end

if and
0039:   0@ == 1
0449:   actor $PLAYER_ACTOR in_a_car
then
0ACD: show_text_highpriority "~B~Speed limit ~G~ON" time 5
03C0: 1@ = actor $PLAYER_ACTOR car
00AD: set_car 1@ max_speed_to 17.0
end
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,133
Solutions
5
Reaction score
885
Location
Lithuania
PHP:
{$CLEO .cs}

0000:

wait 2000

while true
wait 0

if 0256:   player $PLAYER_CHAR defined
then
    if 0AB0:   key_pressed 103
    then
        if 0@ == 0
        then
            0@ = 1
            0ACD: show_text_highpriority "~B~Speed limit ~G~ON" time 1337 
        else
            0@ = 0
            0ACD: show_text_highpriority "~B~Speed limit ~R~OFF" time 1337
        end
        wait 1500 // anti key spam
    end
    
    if and
    0@ == 1
    00DF:   actor $PLAYER_ACTOR in_a_car
    then
        03C0: 1@ = actor $PLAYER_ACTOR car
        00AD: set_car 1@ max_speed_to 17.0
    end
end

end
 
Top