Nesthor Posted August 14, 2019 Share Posted August 14, 2019 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 More sharing options...
ZAZ Posted August 14, 2019 Share Posted August 14, 2019 (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 August 14, 2019 by ZAZ Nesthor 1 CLEO MODS   CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Nesthor Posted August 14, 2019 Author Share Posted August 14, 2019 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 More sharing options...
Nesthor Posted August 17, 2019 Author Share Posted August 17, 2019 @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 More sharing options...