Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Nesthor

Convoy Trucks

Recommended Posts

Nesthor

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?

Share this post


Link to post
Share on other sites
ZAZ
Posted (edited)

 

 

 

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

Share this post


Link to post
Share on other sites
Nesthor
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 🥺

Share this post


Link to post
Share on other sites
Nesthor

@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?

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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