Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      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

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

Adding Carmods To Racing Opponent


sirusxxxx
 Share

Recommended Posts

Hey guys I am doing a racing script and I am trying to get the opponents car to spawn with wheels and a paint job does anyone know if I did this correctly?

 

 

 

06BB: set_actor [email protected] drive_car [email protected] speed 999.0 along_SCM_path Car.LockInCurrentPosition([email protected]) = False09E9: car [email protected] add_single_nitro 06E5: (unknown) $CARMOD_CAR $10449($2515,16i) $10465($2515,16i) 06E6: (unknown) $10188 $10189 06E7: [email protected] = add_car_component #WHEEL_OR1 to_car [email protected] 06E9: request_car_component #WHEEL_OR1 06EA:   car_component $10415 available 06EB: release_car_component #WHEEL_OR1 06EC: (unknown) $CARMOD_CAR $10446 06ED: set_car [email protected] paintjob 0 06D5: [email protected] = create_racing_checkpoint_at 2166.64 -1850.868 3.984375 point_to 2165.723 -1848.055 3.5026 type 1 radius 8.0 

 

 

 

As well is their a way to randomize which paint jobs are choosen?

 

As well is their a way to switch wheels if the first wheel choice isnt set in the handling lines for the opponents car choosen?

Link to comment
Share on other sites

you must set your codes into a context script

 

opcode 0209 choose randomly a value between 2 values of the last 2 parameters

and submit to the variable

 

0209: [email protected] = random_int  0  606ED: set_car [email protected] paintjob [email protected]

 

then it choose one of paintjob 0,1,2,3,4,5 or 6

if the model don't have such a paintjob txd, it do do nothing

 

 

 

0209: [email protected] = random_int  0  206ED: set_car [email protected] paintjob [email protected]

 

choose between 0 and 2 would have a better chance to give the car a paintjob

 

you can change the wheels of all vehicles which have wheels

and choose all available wheels, defined in veh_mods.ide

Link to comment
Share on other sites

Thanks ZaZ for the spawn color random code!

 

 

you might remeber I am the old memebr but lost my password: 1stGenLX-Turbo and the nfs run script...

 

Anyways I also have other race scripts where you race a harder opponents after each win and if you lose you go back to start. Since each opponent is seperate in the script I want them to spawn with different modifications. Is that possible?

 

Easy oponent - spawns with wheels, wings, scoops 1 stage nitrous

 

hard oponent - spawns with easy stuff, and body kit, stage 10 nirtous

 

So far all I can spawn is paint jobs and first stage nos, do you know a add car component line to spawn at race start?

 

 

 

 

Link to comment
Share on other sites

 

So far all I can spawn is paint jobs and first stage nos, do you know a add car component line to spawn at race start?

A capitel of CLEO Script Tutorial:

 

Tuning parts

It needs 4 steps

 

1. first step to load the tuning part

 

06E9: request_car_component #hydralics06E9: request_car_component #NTO_B_S06E9: request_car_component 1115

 

2. second step to prove if the model is loaded in an extra "load-model-check-Loop"

 

:Load_Model_Check0001: wait  0 msif  and06EA:   car_component_available #hydralics06EA:   car_component_available #NTO_B_S06EA:   car_component_available 1115004D: jump_if_false @Load_Model_Check

 

3. The tuning part can be created as soon as the model file is loaded by attaching to the car

 

06E7: [email protected] = add_car_component #NTO_B_S to_car [email protected]: [email protected] = add_car_component #hydralics to_car [email protected]: [email protected] = add_car_component 1115 to_car [email protected]

 

4. release the loaded tuning part model file if it is not needed anymore

 

06EB: release_car_component #hydralics06EB: release_car_component #NTO_B_S06EB: release_car_component 1115

 

To release the defined item from script is not nessesary

 

 

The script below spawns the car SLAMVAN with nitro, hydraulics and front bumper

and the paintjob 1 in Grovestreet if player goes into red marker

Adding paintjobs needs first to give the car white colors

Painjobs requires existing paintjob textures

These are additional txd files which have the same name like the dff model and its basic txd with an additional number

slamvan.dff and slamvan.txd as basic model files

slamvan1.txd as paintjob 0, slamvan2.txd as paintjob 1, etc...

If player leave the spot the car will be released from script and the reading process jumps back into 1.Loop

 

{$CLEO .cs}:TuneP_103A4: name_thread 'TuneP':TuneP_20001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false @TuneP_200D6: if  000FF:   actor $PLAYER_ACTOR  1 (in-sphere)near_point_on_foot 2491.5  -1667.5  13.35 radius  1.0  1.0  1.0004D: jump_if_false @TuneP_20247: request_model #SLAMVAN06E9: request_car_component #hydralics06E9: request_car_component #NTO_B_S06E9: request_car_component 1115:Load_Model_Check0001: wait  0 msif  and0248:   model #SLAMVAN available06EA:   car_component_available #hydralics06EA:   car_component_available #NTO_B_S06EA:   car_component_available 1115004D: jump_if_false @Load_Model_Check00A5: [email protected] = create_car #SLAMVAN at 2487.5  -1660.5  13.350175: set_car [email protected] z_angle_to 180.006E7: [email protected] = add_car_component #NTO_B_S to_car [email protected]: [email protected] = add_car_component #hydralics to_car [email protected]: [email protected] = add_car_component 1115 to_car [email protected]: set_car [email protected] color_to  1  106ED: set_car [email protected] paintjob  106EB: release_car_component #hydralics06EB: release_car_component #NTO_B_S06EB: release_car_component 11150249: release_model #SLAMVAN:TuneP_40001: wait  0 ms00D6: if  00256:   player $PLAYER_CHAR defined004D: jump_if_false @TuneP_400D6: if  080FF:   NOT   actor $PLAYER_ACTOR  0 ()near_point_on_foot 2491.5  -1667.5  13.35 radius  2.0  2.0  2.0004D: jump_if_false @TuneP_401C3: remove_references_to_car [email protected]  // Like turning a car into any random car0002: jump @TuneP_2

 

 

 

the 3 Nitro item definition of veh_mods.ide

1008, nto_b_l, vehicle, 70, 0

1009, nto_b_s, vehicle, 70, 0

1010, nto_b_tw, vehicle, 70, 0

2xnitro

5xnitro

10xnitro

 

 

 

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.