Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Forum Support

    3. Suggestions

Convoy Trucks


Nesthor
 Share

Recommended Posts

Hello everyone.

 

This time I ask for help to correct my cleo, I thought it was simple but I don't know what I'm doing wrong. 😌

 

Basically what it does is that when pressing that combination of screen keys two trucks with their trailers will appear, and these should follow me

funcona, when pressing the keys the trucks appear, but do not follow me, they only drive without meaning, besides, if for some reason it closes, or I close the game, the trucks disappear, but not the trailers, they stay there forever .

// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
03A4: name_thread 'Convoy_Nesthor' 

:Start
0001: wait 0 ms 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @Start 
00D6: if
00DD:   actor $PLAYER_ACTOR driving_car_with_model #RDTRAIN 
jf @Start
00D6: if 
00E1:   player 3 pressed_key 1
004D: jump_if_false @Start 
00D6: if 
00E1:   player 3 pressed_key 7
004D: jump_if_false @Start 


:Convoy_001
03C0: [email protected] = actor $PLAYER_ACTOR car 
0247: load_model #ARTICT1 
0247: load_model #RDTRAIN 
0247: load_model #BMYAP 
038B: load_requested_models 
009A: [email protected] = create_actor_pedtype 8 model #BMYAP at 0.0 0.0 0.0 
0430: put_actor [email protected] into_car [email protected] passenger_seat 0
0172: $ANGLE = actor $PLAYER_ACTOR Z_angle 
00A5: [email protected] = create_car #ARTICT1 at 0.0 0.0 0.0
0893: put_trailer [email protected] on_cab [email protected]
0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 -15.0 0.0 
wait 500
00A5: [email protected] = create_car #RDTRAIN at [email protected] [email protected] [email protected]
0175: set_car [email protected] Z_angle_to $ANGLE
00A5: [email protected] = create_car #ARTICT1 at 0.0 0.0 0.0
0893: put_trailer [email protected] on_cab [email protected]
0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 -15.0 0.0 
009A: [email protected] = create_actor_pedtype 8 model #BMYAP at 0.0 0.0 0.0 
072A: put_actor [email protected] into_car [email protected] driverseat
009A: [email protected] = create_actor_pedtype 8 model #BMYAP at 0.0 0.0 0.0 
0430: put_actor [email protected] into_car [email protected] passenger_seat 0
00A5: [email protected] = create_car #RDTRAIN at [email protected] [email protected] [email protected]
0175: set_car [email protected] Z_angle_to $ANGLE
00A5: [email protected] = create_car #ARTICT1 at 0.0 0.0 0.0
0893: put_trailer [email protected] on_cab [email protected]
009A: [email protected] = create_actor_pedtype 8 model #BMYAP at 0.0 0.0 0.0 
009A: [email protected] = create_actor_pedtype 8 model #BMYAP at 0.0 0.0 0.0 
072A: put_actor [email protected] into_car [email protected] driverseat
0430: put_actor [email protected] into_car [email protected] passenger_seat 0
wait 2000
05F3: set_car [email protected] follow_car [email protected] keep_6o_clock
05F3: set_car [email protected] follow_car [email protected] keep_6o_clock
//07F8: car [email protected] follow_car [email protected] radius 30.0
//07F8: car [email protected] follow_car [email protected] radius 30.0

:verification_car
wait 0
if 
    Player.Defined($PLAYER_CHAR)
ELSE_JUMP @CLEANUP
if  and
8119: car [email protected] wrecked
8119: car [email protected] wrecked
8119: car [email protected] wrecked
8119: car [email protected] wrecked
8119: car [email protected] wrecked
else_jump @verification_car

:verification_ped
wait 0
if 
    Player.Defined($PLAYER_CHAR)
ELSE_JUMP @CLEANUP
if  and
8118: actor [email protected] dead
8118: actor [email protected] dead
8118: actor [email protected] dead
8118: actor [email protected] dead
8118: actor [email protected] dead
else_jump @verification_ped

:End
wait 0
if
0202:   actor $PLAYER_ACTOR near_car [email protected] radius 35.0 35.0 sphere 0
jf @End
if and
00E1:   player 3 pressed_key 4
jf @End
jump @Cleanup

:Cleanup
wait 1000
009B: destroy_actor [email protected]
009B: destroy_actor [email protected]
009B: destroy_actor [email protected]
009B: destroy_actor [email protected]
009B: destroy_actor [email protected]
00A6: destroy_car [email protected]
00A6: destroy_car [email protected]
00A6: destroy_car [email protected]
00A6: destroy_car [email protected]
00A6: destroy_car [email protected]
wait 2000
jump @Start

what could I be doing wrong?

Link to comment
Share on other sites

 

 

 

3 hours ago, Nesthor said:

 

00D6: if 
00E1:   player 3 pressed_key 1
004D: jump_if_false @Start 
00D6: if 
00E1:   player 3 pressed_key 7
004D: jump_if_false @Start 

 

first parameter depends to player instance, default player instance = 0
so it must be

00E1:   player 0 pressed_key 1
00E1:   player 0 pressed_key 7

 

0172: $ANGLE = actor $PLAYER_ACTOR Z_angle

don't use global vars like $ANGLE in cleo scripts
it can cause bugs and crashs

 

if and
00E1:   player 3 pressed_key 4
jf @End

"if and" is wrong because there's only one condition

Enable "Conditions check" in Sannybuilder Options (section General)

Also, it must be

00E1:   player 0 pressed_key 4

Do you have newest version of sannybuilder? it's 3.2.4


 

 

Quote

if for some reason it closes, or I close the game, the trucks disappear, but not the trailers, they stay there forever .

 

this code checks if car is wrecked

0119:   car 1@ wrecked

 

changing first digit into 8 give the opcode the opposit meaning

so this code checks if car is not wrecked

8119:   car 1@ wrecked

 

changing first digit into 8 to give the opcode the opposit meaning works for all opcodes!

 

you should build the code blocks after the spawnment in this way:

:verification_car
wait 0
if 
    Player.Defined($PLAYER_CHAR)
ELSE_JUMP @CLEANUP
if  and
0119: car 1@ wrecked
0119: car 2@ wrecked
0119: car 3@ wrecked
0119: car 4@ wrecked
0119: car 5@ wrecked
else_jump @verification_ped
jump @Cleanup

:verification_ped
if  and
0118: actor 11@ dead
0118: actor 12@ dead
0118: actor 13@ dead
0118: actor 14@ dead
0118: actor 15@ dead
else_jump @End
jump @Cleanup

:End
if or
0119: car 0@ wrecked
00E1:   player 0 pressed_key 4
jf @End2
jump @Cleanup

:End2
if
8202:  not actor $PLAYER_ACTOR near_car 0@ radius 35.0 35.0 sphere 0
jf @verification_car

:Cleanup
009B: destroy_actor 11@
009B: destroy_actor 12@
009B: destroy_actor 13@
009B: destroy_actor 14@
009B: destroy_actor 15@
00A6: destroy_car 1@
00A6: destroy_car 2@
00A6: destroy_car 3@
00A6: destroy_car 4@
00A6: destroy_car 5@
wait 2000
jump @Start

 

 

Quote

the trucks appear, but do not follow me

this works, maybe lower the speed

07F8: car 2@ follow_car 0@ radius 30.0
07F8: car 4@ follow_car 2@ radius 30.0
00AD: set_car 2@ max_speed_to 50.0
00AD: set_car 4@ max_speed_to 50.0
00AE: set_car 2@ traffic_behaviour_to 2 
00AE: set_car 4@ traffic_behaviour_to 2

consider that they only can drive on paths and that they can stuck because they're big

 

Edited by ZAZ
Link to comment
Share on other sites

2 hours ago, ZAZ said:

 

 

 

first parameter depends to player instance, default player instance = 0
so it must be

00E1:   player 0 pressed_key 1
00E1:   player 0 pressed_key 7

 

0172: $ANGLE = actor $PLAYER_ACTOR Z_angle

don't use global vars like $ANGLE in cleo scripts
it can cause bugs and crashs

 

if and
00E1:   player 3 pressed_key 4
jf @End

"if and" is wrong because there's only one condition

Enable "Conditions check" in Sannybuilder Options (section General)

Also, it must be

00E1:   player 0 pressed_key 4

Do you have newest version of sannybuilder? it's 3.2.4


 

 

 

this code checks if car is wrecked

0119:   car 1@ wrecked

 

changing first digit into 8 give the opcode the opposit meaning

so this code checks if car is not wrecked

8119:   car 1@ wrecked

 

changing first digit into 8 to give the opcode the opposit meaning works for all opcodes!

 

you should build the code blocks after the spawnment in this way:

:verification_car
wait 0
if 
    Player.Defined($PLAYER_CHAR)
ELSE_JUMP @CLEANUP
if  and
0119: car 1@ wrecked
0119: car 2@ wrecked
0119: car 3@ wrecked
0119: car 4@ wrecked
0119: car 5@ wrecked
else_jump @verification_ped
jump @Cleanup

:verification_ped
if  and
0118: actor 11@ dead
0118: actor 12@ dead
0118: actor 13@ dead
0118: actor 14@ dead
0118: actor 15@ dead
else_jump @End
jump @Cleanup

:End
if or
0119: car 0@ wrecked
00E1:   player 0 pressed_key 4
jf @End2
jump @Cleanup

:End2
if
8202:  not actor $PLAYER_ACTOR near_car 0@ radius 35.0 35.0 sphere 0
jf @verification_car

:Cleanup
009B: destroy_actor 11@
009B: destroy_actor 12@
009B: destroy_actor 13@
009B: destroy_actor 14@
009B: destroy_actor 15@
00A6: destroy_car 1@
00A6: destroy_car 2@
00A6: destroy_car 3@
00A6: destroy_car 4@
00A6: destroy_car 5@
wait 2000
jump @Start

 

 

this works, maybe lower the speed

07F8: car 2@ follow_car 0@ radius 30.0
07F8: car 4@ follow_car 2@ radius 30.0
00AD: set_car 2@ max_speed_to 50.0
00AD: set_car 4@ max_speed_to 50.0
00AE: set_car 2@ traffic_behaviour_to 2 
00AE: set_car 4@ traffic_behaviour_to 2

consider that they only can drive on paths and that they can stuck because they're big

 

Thank you very much for the help, now I am at work but I try it later, after all so simple mining 🥺

Link to comment
Share on other sites

@ZAZ

I've tried the script and it doesn't work, the truks keep spinning without following the player.

 

Change the 3 to the 0 as you suggested, but it stopped working, that is, the cleo did not run when you pressed the combination on the screen, so I put it back to 3.

 

On 8/14/2019 at 12:59 PM, Nesthor said:

 

if and
00E1:   player 3 pressed_key 4
jf @End

"if and" is wrong because there's only one condition

Enable "Conditions check" in Sannybuilder Options (section General)

Also, it must be

00E1:   player 0 pressed_key 4

 

 

  Will it have something to do with the trick having a trailer attached?  and why the peds do not follow?

 

Link to comment
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
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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