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

Some opcode?

Recommended Posts

Nesthor

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 

 

Share this post


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

Share this post


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

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.


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