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. Support

    3. Suggestions

Happy Holidays from the GTANet team!

Some opcode?


Nesthor
 Share

Recommended Posts

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

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 by ZAZ
Link to comment
Share on other sites

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

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.