Jump to content

Temporal B/F/E/C/M proof


Recommended Posts

Guys im trying to do something like this.

 

Store 1@ near vehicle with model #PATRIOT

Then

Set 2@ random numbet between 1 20

If 2@ == 1

Then

 Make 1@ bullet proof

If not 2@ == 1

Then

 Make 1@ non bullet proof

-------

Store 1@ near vehicle with model #ENFO

Then

Set 2@ random numbet between 1 5

If 2@ == 1

Then

 Make 1@ bullet proof

If not 2@ == 1

Then

 Make 1@ non bullet proof

 

But i want this process repeats every second with all vehicles even if they where stored already

 

 

 

Please help, as i dont know how to increase vehicles health (with cleo) im just trying to give them random temporal B/F/E/C/M proof (for military/police vehicles only)

 

Link to comment
https://gtaforums.com/topic/975226-temporal-bfecm-proof/
Share on other sites

It's difficult to get more different cars in traffic

Test the script below, a blue marker above car shows which car was found and was mady very heavy and got 20000 health

{$CLEO .cs}
thread 'RANDCAR'
0@ = -1

while true
wait 0
    if
    0256:   player $PLAYER_CHAR defined 
    then
        077E: get_active_interior_to 31@
        
        if //and
            31@ == 0
            //0AB0:   key_pressed 8// backspace
        then
            30@ = 0
            29@ = 0
            5@(29@,7i) = -1
            for 4@ = 0 to 50
                wait 0
                gosub @RANDCAR_Car_Search
                if
                    30@ > 9
                then
                    break
                end
            end


            wait 500

            for 30@ = 0 to 9
                wait 0
                if                                                                                               
                    8039:   NOT   5@(30@,7i) ==  -1                                                                          
                then                
                    0164: disable_marker 15@(30@,7i)           
                end
                5@(30@,7i) = -1                
            end
                                        
        end
    end
end



:RANDCAR_Car_Search
04C4: create_coordinate 1@ 2@ 3@ from_actor $PLAYER_ACTOR offset  0.0  0.0  0.0
if                                                                                                   
    0AE2: 0@ = random_vehicle_near_point 1@ 2@ 3@ in_radius 70.0 find_next 0 pass_wrecked 0 //IF and SET 
then                                                                                                 
    if                                                                                               
        8039:   NOT   0@ ==  -1                                                                          
    then                                                                                             
        if
            8119:   not car 0@ wrecked 
        then
            if  and
                80DB:   actor $PLAYER_ACTOR in_car 0@
                803B: not  0@ == 5@(29@,7i)  
            then           
                0085: 5@(30@,7i) = 0@ // (int)
                0186: 15@(30@,7i) = create_marker_above_car 5@(30@,7i)
                07E0: set_marker 15@(30@,7i) type_to 1
                01EC: make_car 5@(30@,7i) very_heavy 1
                0224: set_car 5@(30@,7i) health_to 20000
                0085: 29@ = 30@
                30@ += 1
            end                                                                                                       
        end                                                                                                                                                                   
    end                                                                                               
end                                                            
//wait 50
return

 

Link to comment
https://gtaforums.com/topic/975226-temporal-bfecm-proof/#findComment-1071632144
Share on other sites

The problem is that i want to "get" the same cars again.

 

GIF HERE

Spoiler

dpUagbs.gif

 

I was trying this one

{$CLEO .cs}

{$CLEO}
0000:
//10@ = 0

WHILE 8256:   NOT   player $PLAYER_CHAR defined
    wait 250
END

WHILE TRUE
    wait 0
    00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
    IF
        0AE2: 30@ = random_vehicle_near_point 0@ 1@ 2@ in_radius 1000.0 find_next 0 pass_wrecked 1
    THEN
        REPEAT
            
            if 056E:   car 30@ defined
            then
            if 8118:   actor $PLAYER_ACTOR dead
            then
            //----------------------
                IF or
                    0137:   car 30@ model == #PATRIOT
                    0137:   car 30@ model == #ENFORCER
                THEN
                    gosub @Inmus            
                END 
            //----------------------
            end
            end
                        
        UNTIL 8AE2:   NOT   30@ = random_vehicle_near_point 0@ 1@ 2@ in_radius 0.1 find_next 1 pass_wrecked 1
    END
END

:Inmus
10@ = 1
///////----------------------------------------------------------
if 056E:   car 30@ defined
then
if 8119:   car 30@ wrecked
then 
////----------------------------------------------------------
////----------------------------------------------------------
////----------------------------------------------------------
////----------------------------------------------------------
////----------------------------------------------------------
if 056E:   car 30@ defined
then
if 0137:   car 30@ model == #PATRIOT
then
    0209: 20@ = random_int_in_ranges 1 10
    if 20@ == 1
    then
        02AC: set_car 30@ immunities BP 0 FP 0 EP 0 CP 0 MP 0
        0ACD: show_text_highpriority "Lost" time 400
    end     
    if not 20@ == 1
    then
        02AC: set_car 30@ immunities BP 1 FP 0 EP 0 CP 1 MP 1
        //0ACD: show_text_highpriority "Enabled" time 400
    end
end
end
wait 0
////----------------------------------------------------------
////----------------------------------------------------------  
////----------------------------------------------------------
////----------------------------------------------------------
////----------------------------------------------------------
if 056E:   car 30@ defined
then
if 0137:   car 30@ model == #BARRACKS
then
02AC: set_car 30@ immunities BP 1 FP 0 EP 0 CP 1 MP 1
end
end
wait 0
////----------------------------------------------------------
////----------------------------------------------------------  
////----------------------------------------------------------
////----------------------------------------------------------
////----------------------------------------------------------
if 056E:   car 30@ defined
then
if 0137:   car 30@ model == #ENFORCER
then
//02AC: set_car 30@ immunities BP 0 FP 0 EP 0 CP 1 MP 1
    0209: 20@ = random_int_in_ranges 1 10
    if 20@ == 1
    then
        02AC: set_car 30@ immunities BP 0 FP 0 EP 0 CP 0 MP 0
        0ACD: show_text_highpriority "Lost" time 400
    end     
    if not 20@ == 1
    then
        02AC: set_car 30@ immunities BP 1 FP 0 EP 0 CP 1 MP 1
        0ACD: show_text_highpriority "Enabled" time 400
    end
//06A3: get_car 30@ mass_to 1000
end
end   
0085: 30@ = 29@ // (int)
10@ = 0
//Car.RemoveReferences(30@)


end
end
wait 500
/////----------------------------------------------------------
return         

 

But it is not taking Enforcers :/ and its also crashing my game after i die

Edited by Hydromass
Link to comment
https://gtaforums.com/topic/975226-temporal-bfecm-proof/#findComment-1071632388
Share on other sites

 

you first check if player_char is defined

WHILE 8256:   NOT   player $PLAYER_CHAR defined
    wait 250
END

 

and then you let the code permanently running in a while loop WITHOUT checking if player_char is defined

WHILE TRUE
    wait 0
    00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
    IF
        0AE2: 30@ = random_vehicle_near_point 0@ 1@ 2@ in_radius 1000.0 find_next 0 pass_wrecked 1
    THEN
        REPEAT
            
            if 056E:   car 30@ defined
            then
            if 8118:   actor $PLAYER_ACTOR dead
            then
            //----------------------
                IF or
                    0137:   car 30@ model == #PATRIOT
                    0137:   car 30@ model == #ENFORCER
                THEN
                    gosub @Inmus            
                END 
            //----------------------
            end
            end
                        
        UNTIL 8AE2:   NOT   30@ = random_vehicle_near_point 0@ 1@ 2@ in_radius 0.1 find_next 1 pass_wrecked 1
    END
END

 

 

that's bullsh*t :nervous:

 

please read the comment of goodidea83 and read high level tut

 

you may have this code in the loop

if 8118:   actor $PLAYER_ACTOR dead

 

but it doesn't protect against this code

00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@

 

it also doesn't protect if player get arrested

 

 

In Addition, the REPEAT-UNTIL loop needs a wait 0

this could be the reason for the crash

 

 

Furthermore, you should try this code that have a parameter to insert model id

053E: 7@ = get_random_car_with_model #PACKER in_rectangle_cornerA 1@ 2@ cornerB 4@ 5@

 

Somebody wrote a script to attach cars on the packer which worked really good

 

but in practice, you're standing infront of the packer, when get_car code should be executed

in this case the random_car_search works fine

 

the bigger the range of the search, the more badly it works

also, the search engine ofter find the same car again instead these which we want

 

 

 

 

 

 

 

 

 

Edited by ZAZ
Link to comment
https://gtaforums.com/topic/975226-temporal-bfecm-proof/#findComment-1071632747
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.