Nesthor Posted June 5, 2019 Share Posted June 5, 2019 Is there an opcode that makes a ped always stand on one side of a vehicle? In a script I did a ped walk towards a car, but use the code to walk to a point, the problem is that it never stops where it should, in this code I try to simulate that it repairs the vehicle, so I would like He will stop at the front to open the chest and pretend to repair it. What opcode could you use to achieve this? {CLEO .cs} //-------------MAIN--------------- 03A4: name_thread 'TALLER' 0247: load_model #WMYMECH 04ED: load_animation "POOL" 04ED: load_animation "GANGS" 04ED: load_animation "COP_AMBIENT" :MICHAEL_45 0001: wait 0 ms 00D6: if 0248: model #WMYMECH available 04EE: animation "POOL" loaded 04EE: animation "GANGS" loaded 04EE: animation "COP_AMBIENT" loaded 004D: jump_if_false @MICHAEL_45 :MICHAEL_94 0001: wait 0 ms 00D6: if 0256: player $PLAYER_CHAR defined 004D: jump_if_false @MICHAEL_94 00D6: if 0038: $ONMISSION == 0 004D: jump_if_false @MICHAEL_132 :MICHAEL_132 0001: wait 0 ms 00D6: if 00FE: actor $PLAYER_ACTOR sphere 0 in_sphere -893.0284 2748.1965 46.4537 radius 200.0 200.0 50.0 004D: jump_if_false @MICHAEL_132 00D6: if and 009A: [email protected] = create_actor_pedtype 4 model #WMYMECH at -944.0225 2761.8542 46.212 0173: set_actor [email protected] Z_angle_to 268.0 06B0: AS_actor [email protected] sit_down 800000 ms 0811: $TEMPVAR_ACTOR_CAR = actor $PLAYER_ACTOR used_car :MICHAEL_820 0001: wait 0 ms 00D6: if 03C9: car $TEMPVAR_ACTOR_CAR damaged 0100: actor $PLAYER_ACTOR in_sphere -940.6201 2760.5442 46.212 radius 3.0 3.0 2.0 sphere 1 in_car 004D: jump_if_false @MICHAEL_820 0519: set_car $TEMPVAR_ACTOR_CAR locked 1 01B4: set_player $PLAYER_CHAR can_move 1 0657: car $TEMPVAR_ACTOR_CAR open_door 0 07CD: AS_actor [email protected] walk_to -941.6639 2760.8687 46.212 stop_with_angle 267.1167 within_radius 0.4 wait 3000 0605: actor [email protected] perform_animation "POOL_XLONG_SHOT" IFP "POOL" framedelta 4.0 loop 0 lockX 0 lockY 0 lockF 0 time -1 wait 500 0605: actor [email protected] perform_animation "PRTIAL_GNGTLKF" IFP "GANGS" framedelta 4.0 loop 0 lockX 0 lockY 0 lockF 0 time -1 wait 5000 0605: actor [email protected] perform_animation "COPBROWSE_LOOP" IFP "COP_AMBIENT" framedelta 4.0 loop 0 lockX 0 lockY 0 lockF 0 time -1 wait 5000 0605: actor [email protected] perform_animation "POOL_LONG_START" IFP "POOL" framedelta 4.0 loop 0 lockX 0 lockY 0 lockF 0 time -1 wait 5000 0605: actor [email protected] perform_animation "COPBROWSE_LOOP" IFP "COP_AMBIENT" framedelta 4.0 loop 0 lockX 0 lockY 0 lockF 0 time -1 wait 500 0A30: repair_car $TEMPVAR_ACTOR_CAR 07CD: AS_actor [email protected] walk_to -944.5569 2759.7749 46.212 stop_with_angle 267.1167 within_radius 0.5 0519: set_car $TEMPVAR_ACTOR_CAR locked 0 03EE: player $PLAYER_CHAR controllable wait 8000 jump @CLEAN :CLEAN WAIT 8000 80FE: not actor $PLAYER_ACTOR sphere 0 in_sphere -893.0284 2748.1965 46.4537 radius 200.0 200.0 200.0 0001: wait 0 ms 009B: destroy_actor [email protected] 0001: wait 1000 ms 0002: jump @MICHAEL_94 Link to comment Share on other sites More sharing options...
ZAZ Posted June 7, 2019 Share Posted June 7, 2019 (edited) in this way the actor walks to the front bumper of car 0407: create_coordinate 13@ 14@ 15@ from_car 0@ with_offset 0.0 2.5 0.0 07CD: AS_actor 11@ walk_to 13@ 14@ 15@ stop_with_angle 267.1167 within_radius 0.4 but, because different car models have different size, it needs to use following code 0441: 10@ = car 0@ model 07E4: get_model 10@ dimensions_cornerA_to 21@ 22@ 23@ dimensions_cornerB_to 24@ 25@ 26@ to give the right offset for 0407: 0407: create_coordinate 13@ 14@ 15@ from_car 0@ with_offset 0.0 25@ 0.0 I assume that the scene plays on a map mod, inside a garage, right? Edited June 7, 2019 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Nesthor Posted June 7, 2019 Author Share Posted June 7, 2019 11 hours ago, ZAZ said: I assume that the scene plays on a map mod, inside a garage, right? Thanks this Cleo especially if you play on a map mod, is a small mechanic workshop, but the actor is out, as I'm trying to recreate a workshop for trucks and buses, sometimes I get crash but in general works I will try to create the Cleo with the Opcodes that I indicated Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now