{$CLEO}  // 0 - 48 , 9 -57
var 
    0@: array 5 of Integer  // digits     0 1 2 3 4
    17@: Integer             // index
    6@: Integer             // current_digit
    7@: Integer             // SUM
    8@: Integer             // KEY_HOLD
    15@: Integer             // KEY
end
const
    DIGIT = 0@
    i = 17@
    CURRENT_DIGIT = 6@
    SUM = 7@
    KEY_HOLD = 8@
    KEY = 15@
end
CURRENT_DIGIT = 1
while true
    wait 0
    if or
        not player.Defined($PLAYER_CHAR)
        $ONMISSION <> 0
    then    
        CURRENT_DIGIT = 1
        SUM = 0
        KEY_HOLD = False
        for i = 0 to 4
            0006: DIGIT[i] = 0  
        end
        continue
    end
    if
        8AB0: not key_pressed 2
    then
        if and
            SUM > 0
            SUM < 19010
        then
            if
                07DE: model SUM exists // versionB 
            then
                0AA7: call_function 0x4C5AA0 num_params 1 pop 1 SUM 9@ // isModelCar
                0AA7: call_function 0x4C5B60 num_params 1 pop 1 SUM 10@ // isModelBike
                0AA7: call_function 0x4C5C20 num_params 1 pop 1 SUM 11@ // isModelBmx
                0AA7: call_function 0x4C5BF0 num_params 1 pop 1 SUM 12@ // isModelQuad
                0AA7: call_function 0x4C5C50 num_params 1 pop 1 SUM 13@ // isModelTrailer 
                0AA7: call_function 0x4C5BC0 num_params 1 pop 1 SUM 14@ // isModelMTruck
                if or
                    081E:   model SUM boat
                    081F:   model SUM plane
                    0820:   model SUM heli 
                    9@ == True
                then
                    0ADD: spawn_car_with_model SUM at_player_location
                else
                    if or
                        10@ == 8766721 // True
                        11@ == 8766721 // True
                        12@ == 8766721 // True
                        13@ == 8766721 // True
                        14@ == True
                    then
                        0ADD: spawn_car_with_model SUM at_player_location
                    end
                end 
            end
        end
        CURRENT_DIGIT = 1
        SUM = 0
        KEY_HOLD = False
        for i = 0 to 4
            0006: DIGIT[i] = 0  
        end
        continue
    end    // key pressed 2
    if
        KEY_HOLD == False
    then
        if
            0AB0: key_pressed 8
        then
            KEY_HOLD = True
            if
                CURRENT_DIGIT > 1
            then
                CURRENT_DIGIT /= 10
                008F: 16@ = integer CURRENT_DIGIT to_float 
                0AEF: 16@ = log 16@ base 10.0 //all floats
                SUM = 0
                0092: 16@ = float 16@ to_integer
                16@ -= 1 
                for i = 0 to 16@ 
                    0016: DIGIT[i] /= 10
                    005A: SUM += DIGIT[i] // (int)
                end
            end
        else
            if
                SUM >= 19010
            then
                continue
            end
            KEY = 48
            for i = 0 to 9
                if
                    0AB0: key_pressed KEY
                then
                    008F: 16@ = integer CURRENT_DIGIT to_float 
                    0AEF: 16@ = log 16@ base 10.0 //all floats
                    SUM = 0
                    0092: 16@ = float 16@ to_integer 
                    0085: DIGIT[16@] = i   // int
                    for i = 0 to 16@
                        if
                            001D:   16@ > i // (int)
                        then 
                            0012: DIGIT[i] *= 10
                        end
                        005A: SUM += DIGIT[i] // (int)
                    end 
                    CURRENT_DIGIT *= 10
                    KEY_HOLD = True
                    break
                end
                KEY += 1
            end
        end
    else  //  KEY_HOLD == True
        if and
            8AB0: not key_pressed 48
            8AB0: not key_pressed 49
            8AB0: not key_pressed 50
            8AB0: not key_pressed 51
            8AB0: not key_pressed 52
        then
            if and
                8AB0: not key_pressed 53
                8AB0: not key_pressed 54
                8AB0: not key_pressed 55
                8AB0: not key_pressed 56
                8AB0: not key_pressed 57
                8AB0: not key_pressed 8
            then
                KEY_HOLD = False
            end
        end
    end  // KEY_HOLD == False 
    if
        CURRENT_DIGIT > 1
    then
        03F0: enable_text_draw 1
        045A: draw_text_1number 320.0 240.0 GXT 'NUMBER' number SUM
    end 
end