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

    3. Suggestions

CLEO car spawn help


lpgunit
 Share

Recommended Posts

OK, so I experimented a car spawn CLEO script that I saw in this board, since I don't feel like altering the original SCM files. The syntax goes like this, much like the vehicle spawn script in the MAIN.SCM files:

 

 

{$CLEO .cs}// GTA SAN ANDREAS CAR SPAWNER014B: [email protected] = init_parked_car_generator #STAFFORD color -1 -1 1 alarm 0 door_lock 0 0 10000 at 2491.173 -1681.651 13.33686 angle 88.6415014C: set_parked_car_generator [email protected] cars_to_generate_to 101 0A95: enable_thread_saving0A93: end_custom_thread

 

 

The problem is that when I try to add a license plate string (one of which taken from Deji's custom SCMs), the game crashes. Is there a proper way of spawning a car with a number plate in CLEO?

76561198000404928.png

Link to comment
Share on other sites

The code below is the plated version of the code you were using.

 

09E2: [email protected] = parked_car_generator_w_numberplate #STAFFORD -1 -1 0 alarm 50 door_lock 0 0 10000 plate "_SHERM__" at 2491.173 -1681.651 13.33686 angle 88.6415

 

 

However, these are not standard spawn car codes. These codes create a new parked car generator that will be added permanently to the save file so anytime you drive by that location the car should spawn. If you run these codes again you'll add yet another car to the map. Add too many cars and the generator pool will become full and cars won't spawn as reliably. If you add new generators then you should find a way to flag the script so that it only creates the car once. The maximum custom plates that can be created with 09E2: is 15. 11 are used by the standard game.

 

Check in to some of these other spawn car codes. The process is a little more complicated, but offers considerable more control over the vehicle. This isn't a working code segment, it's a sample of some of the codes you can use when spawning cars. The lines unrelated to your stated goals are commented. You'll need to create a loop for the model available condition to get this working correctly. There are plenty of examples in the standard scripts to work from.

 

0247: load_model #STAFFORD038B: load_requested_models 0248:   model #STAFFORD available  //  If Condition <-- make the script loop until model is loaded//0506: set_car_model 0 next_variation -1 -10674: set_car_model #STAFFORD numberplate "_ASSMAN_" 00A5: [email protected] = create_car #STAFFORD at 2491.173 -1681.651 13.33686 0175: set_car [email protected] Z_angle_to 88.6415 //02AC: set_car [email protected] immunities BP 0 FP 0 EP 0 CP 0 MP 0 //0229: set_car [email protected] primary_color_to 51 secondary_color_to 73//0A11: set_car [email protected] tertiary_color_to 83 quaternary_color_to 0//06E7: [email protected] = add_car_component #WHEEL_SR5 to_car [email protected] // load model before using//01C3: remove_references_to_car [email protected] // Like turning a car into any random car 0249: release_model #STAFFORD

 

Edited by OrionSR
Link to comment
Share on other sites

 

The code below is the plated version of the code you were using.

 

09E2: [email protected] = parked_car_generator_w_numberplate #STAFFORD -1 -1 0 alarm 50 door_lock 0 0 10000 plate "_SHERM__" at 2491.173 -1681.651 13.33686 angle 88.6415

 

 

However, these are not standard spawn car codes. These codes create a new parked car generator that will be added permanently to the save file so anytime you drive by that location the car should spawn. If you run these codes again you'll add yet another car to the map. Add too many cars and the generator pool will become full and cars won't spawn as reliably. If you add new generators then you should find a way to flag the script so that it only creates the car once. The maximum custom plates that can be created with 09E2: is 15. 11 are used by the standard game.

 

Check in to some of these other spawn car codes. The process is a little more complicated, but offers considerable more control over the vehicle. This isn't a working code segment, it's a sample of some of the codes you can use when spawning cars. The lines unrelated to your stated goals are commented. You'll need to create a loop for the model available condition to get this working correctly. There are plenty of examples in the standard scripts to work from.

 

0247: load_model #STAFFORD038B: load_requested_models 0248:   model #STAFFORD available  //  If Condition <-- make the script loop until model is loaded//0506: set_car_model 0 next_variation -1 -10674: set_car_model #STAFFORD numberplate "_ASSMAN_" 00A5: [email protected] = create_car #STAFFORD at 2491.173 -1681.651 13.33686 0175: set_car [email protected] Z_angle_to 88.6415 //02AC: set_car [email protected] immunities BP 0 FP 0 EP 0 CP 0 MP 0 //0229: set_car [email protected] primary_color_to 51 secondary_color_to 73//0A11: set_car [email protected] tertiary_color_to 83 quaternary_color_to 0//06E7: [email protected] = add_car_component #WHEEL_SR5 to_car [email protected] // load model before using//01C3: remove_references_to_car [email protected] // Like turning a car into any random car 0249: release_model #STAFFORD

 

Thanks, but how do I do that? Any looping examples?

76561198000404928.png

Link to comment
Share on other sites

 

thread 'GREN' :GREN_11wait 0 if Player.Defined($PLAYER_CHAR)else_jump @GREN_11 if andnot Actor.Dead($PLAYER_ACTOR)84AD: not actor $PLAYER_ACTOR in_water Actor.Driving($PLAYER_ACTOR)else_jump @GREN_11if and84A7: not actor $PLAYER_ACTOR driving_boat 84A9: not actor $PLAYER_ACTOR driving_heli not Actor.DrivingPlane($PLAYER_ACTOR)else_jump @GREN_11:GREN_220Model.Destroy(#GRENADE)0108: destroy_object [email protected]([email protected])Actor.SetImmunities($PLAYER_ACTOR, 0, 0, 0, 0, 0)jump @GREN_11

 

 

This code does not have anything to do with car spawning and it is not mine, but it shows a loop. The end of the thread says go back to :GREN_11 so the script keeps running.

Link to comment
Share on other sites

Yes. As I mentioned, there are lots of examples in the default scripts. Here's one of the simplest examples I managed find.

 

 

:SYN1_345Model.Load(#MTBIKE)038B: load_requested_models :SYN1_352if   not Model.Available(#MTBIKE)jf @SYN1_379 wait 0 jump @SYN1_352 :[email protected] = Car.Create(#MTBIKE, [email protected], [email protected], [email protected])Car.Angle([email protected]) = [email protected]

 

Link to comment
Share on other sites

 

Yes. As I mentioned, there are lots of examples in the default scripts. Here's one of the simplest examples I managed find.

 

 

:SYN1_345Model.Load(#MTBIKE)038B: load_requested_models :SYN1_352if   not Model.Available(#MTBIKE)jf @SYN1_379 wait 0 jump @SYN1_352 :[email protected] = Car.Create(#MTBIKE, [email protected], [email protected], [email protected])Car.Angle([email protected]) = [email protected]

 

Sorry, but I still don't get it. The bike spawn syntax seems fine, but what about the plate syntax?

Edited by lpgunit
76561198000404928.png

Link to comment
Share on other sites

I might tweak a line or two but I'm not going to write your code for you. Try experimenting with what you've got and check into the scripts or other cleo mods if you get stuck.

Link to comment
Share on other sites

I might tweak a line or two but I'm not going to write your code for you. Try experimenting with what you've got and check into the scripts or other cleo mods if you get stuck.

You mean, like, use the plated version:

 

 

09E2: [email protected] = parked_car_generator_w_numberplate #STAFFORD -1 -1 0 alarm 50 door_lock 0 0 10000 plate "_SHERM__" at 2491.173 -1681.651 13.33686 angle 88.6415

 

 

And then loop it? Or modify the code segment that you gave to me? Thanks, but if it still doesn't work, I'll probably resort to SCM editing...

76561198000404928.png

Link to comment
Share on other sites

Nope, don't loop the car generator code. That'll create way too many car generators, and all of them in the same place. That code will work fine as long as you only use it once for each car to be created, you don't use those codes again if you save the changes, and you don't try to add more than 4 more cars with plates.

Link to comment
Share on other sites

Nope, don't loop the car generator code. That'll create way too many car generators, and all of them in the same place. That code will work fine as long as you only use it once for each car to be created, you don't use those codes again if you save the changes, and you don't try to add more than 4 more cars with plates.

So I'll just make the generator run just once? Hmm, it seems as though I should've used the STAFFRD code instead of STAFFORD.

 

How about this?

 

 

09E2: $STF = parked_car_generator_w_numberplate #STAFFRD alarm 50 door_lock  0  0  10000 plate "TEXTHERE" at 2491.173 -1681.651 13.33686 angle 88.6415014C: set_parked_car_generator $STF cars_to_generate_to  50

 

76561198000404928.png

Link to comment
Share on other sites

Strange, #STAFFORD is working fine for me.

 

 

09E2: $STF = parked_car_generator_w_numberplate #STAFFRD alarm 50 door_lock  0  1  10000 plate "TEXTHERE" at 2491.173 -1681.651 13.33686 angle 88.6415

 

 

I turned on the force spawn flag in the line above. The car will spawn more reliably, especially if located near a hideout.

 

 

014C: set_parked_car_generator $STF cars_to_generate_to  50 

 

 

If I understand this code correctly (and I haven't tested this so I'm not really sure) then your vehicle will spawn 50 times and then stop generating new cars. You'll want to set it to 101 if you want it to always be available.

 

The problem with getting your code to only run once per save is that if you leave that script in the cleo folder then it will run every time you load a save or start the game. If you have already added the car once to that save, then you will have two, and next time perhaps three. It can be managed but you will need to be careful.

Link to comment
Share on other sites

Strange, #STAFFORD is working fine for me.

 

 

09E2: $STF = parked_car_generator_w_numberplate #STAFFRD alarm 50 door_lock  0  1  10000 plate "TEXTHERE" at 2491.173 -1681.651 13.33686 angle 88.6415

 

 

I turned on the force spawn flag in the line above. The car will spawn more reliably, especially if located near a hideout.

 

 

014C: set_parked_car_generator $STF cars_to_generate_to  50 

 

 

If I understand this code correctly (and I haven't tested this so I'm not really sure) then your vehicle will spawn 50 times and then stop generating new cars. You'll want to set it to 101 if you want it to always be available.

 

The problem with getting your code to only run once per save is that if you leave that script in the cleo folder then it will run every time you load a save or start the game. If you have already added the car once to that save, then you will have two, and next time perhaps three. It can be managed but you will need to be careful.

OK, thanks. Maybe I'll try it when I run the other PC.

76561198000404928.png

Link to comment
Share on other sites

I use this opcode to make plate with my idea.

 

0674: set_car_model #your_car_model numberplate "your_name_plate" 

 

HHnErXC.png


Link to comment
Share on other sites

I use this opcode to make plate with my idea.

 

0674: set_car_model #your_car_model numberplate "your_name_plate" 

 

What is so difficult about this?

Ive been looking at this thread for 4 days and still see no progress. Just use this code City_Poke shows you, and it will work.

 

wink.gif

Yl8KS.jpg
Link to comment
Share on other sites

I use this opcode to make plate with my idea.

 

0674: set_car_model #your_car_model numberplate "your_name_plate" 

 

What is so difficult about this?

Ive been looking at this thread for 4 days and still see no progress. Just use this code City_Poke shows you, and it will work.

 

wink.gif

OK, noted. Oh, and is it only a single line of code? How about the coordinates?

76561198000404928.png

Link to comment
Share on other sites

Okay, one more try.

 

Take that mt bike code and change the SYN1 labels to something else, it doesn't matter what as long as they are unique.

Change the [email protected] local variables to your coordinates.

Compile and run the code, see if it spawns a Mt Bike.

If so, then change the models to the Stafford and compile and run again.

If that works, then try that plate line just before creating the car.

 

If you run into trouble it might be because the vehicle is too far away from CJ when it spawns. Try using the cleo example of showsavescreen to save near those coordinates. You may also consider adapting the showsavescreen code to spawn your car. Change the key code line to look for F3 or F5 instead of F4, and then replace the show save screen line with your code. Then whenever you press that button your vehicle should spawn. Later you can replace the keypress line for a check of when CJ is in that area.

 

Link to comment
Share on other sites

  • 2 years later...

 

Strange, #STAFFORD is working fine for me.

 

 

09E2: $STF = parked_car_generator_w_numberplate #STAFFRD alarm 50 door_lock  0  1  10000 plate "TEXTHERE" at 2491.173 -1681.651 13.33686 angle 88.6415

 

 

I turned on the force spawn flag in the line above. The car will spawn more reliably, especially if located near a hideout.

 

 

014C: set_parked_car_generator $STF cars_to_generate_to  50 

 

 

If I understand this code correctly (and I haven't tested this so I'm not really sure) then your vehicle will spawn 50 times and then stop generating new cars. You'll want to set it to 101 if you want it to always be available.

 

The problem with getting your code to only run once per save is that if you leave that script in the cleo folder then it will run every time you load a save or start the game. If you have already added the car once to that save, then you will have two, and next time perhaps three. It can be managed but you will need to be careful.

I've made a script of generating a car with a custom plate number but I can't seems to make it work... the code is:

09E2: $WASHING = init_parked_car_generator_w_numberplate #WASHING 0 0 0 alarm 0 door_lock 0 0 10000 plate "_VEDAD__" at 2424.242 -1635.456 13.314 angle 0.0 014C: set_parked_car_generator $WASHING cars_to_generate_to 101 0A95: enable_thread_saving 0A93: end_custom_thread

 

 

please reply what have I've bin doing wrong?

Edited by megaaj02
Link to comment
Share on other sites

These codes worked for me. I changed out your global variable for a local variable ([email protected]) since user defined globals in a CLEO script is a very bad idea. You never know what game variables you might be writing over, or how the game might alter your variables. I doubt that was the problem though; still I don't even want to test a code with globals in it. I also change the "force spawn" flag to 1 (before alarm) so the car would spawn without having to leave the area and return.

 

 

09E2: [email protected] = init_parked_car_generator_w_numberplate #WASHING 0 0 1 alarm 0 door_lock 0 0 10000 plate "_VEDAD__" at 2424.242 -1635.456 13.314 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101

 

 

Perhaps it isn't working because you tried several variations of the script and now there are several copies of your car in that location. The thread saving should have prevented that. Try again on a fresh save. Also, 11 of the 15 custom plates are used. If you've already created 4 then the plates won't show up for the 5th.

Edited by OrionSR
Link to comment
Share on other sites

 

These codes worked for me. I changed out your global variable for a local variable ([email protected]) since user defined globals in a CLEO script is a very bad idea. You never know what game variables you might be writing over, or how the game might alter your variables. I doubt that was the problem though; still I don't even want to test a code with globals in it. I also change the "force spawn" flag to 1 (before alarm) so the car would spawn without having to leave the area and return.

 

 

09E2: [email protected] = init_parked_car_generator_w_numberplate #WASHING 0 0 1 alarm 0 door_lock 0 0 10000 plate "_VEDAD__" at 2424.242 -1635.456 13.314 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101

 

 

Perhaps it isn't working because you tried several variations of the script and now there are several copies of your car in that location. The thread saving should have prevented that. Try again on a fresh save. Also, 11 of the 15 custom plates are used. If you've already created 4 then the plates won't show up for the 5th.

Thanks for the tip... I'll edit this reply after I've tested it.... [{Edit: It works perfectly!! biggrin.gif Thanks....}] [{Edit2: PS. How can I make the car in the parked car generator w numperplate invulnerable, like bulletproof, fireproof, collisionproof, and explosionproof. Particularly, Everything Proof.

Edited by megaaj02
Link to comment
Share on other sites

You can't add immunities to a car generator. However, it is possible to simulate a car generator with a CLEO script that spawns a car when CJ is near. It's a fairly complicated process. I recommend reading a coding tutorial that describes the process. ZAZ has a pretty good one.

 

http://www.gtaforums.com/index.php?showtopic=403594

Edited by OrionSR
Link to comment
Share on other sites

  • 4 years later...

Hey guys can someone help me with this serious problem about my Gta sa? I've installed a car mod properly and perfectly and when I use carspawner to spawn the car, the car 'show. I cannot control the game anymore and I'm forced to close it in other words, it became unresponsive. How do I fix this?

Edited by Bravura123
Link to comment
Share on other sites

  • 6 years later...

Can someone please help me, I edited this script so that the car would be at a custom position but now the car is facing north, i changed the angle of the car but it still faces north please help me

 

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.