You are not logged in.
Pages: 1
I have some code here:
{$CLEO} 0A95: enable_thread_saving if 0@ == 0 then 014B: 1@ = init_parked_car_generator #petro color -1 -1 1 alarm 0 door_lock 0 0 10000 at 1648.537 -1068.407 24.378 angle 180.0 014C: set_parked_car_generator 1@ cars_to_generate_to 101 014B: 2@ = init_parked_car_generator #petrotr color -1 -1 1 alarm 0 door_lock 0 0 10000 at 1648.537 -1059.974 24.378 angle 180.0 014C: set_parked_car_generator 2@ cars_to_generate_to 101 wait 10 0893: put_trailer 2@ on_cab 1@ 0@ = 1 end 0A93: end_custom_thread
But the trailer isn't attaching to the cabine. I'm trying to create a mass spawn for trucks, but as long this ain't working, I can't get it offcourse. So can anyone tell what I'm doing wrong?
Offline
opcode 014B does not create a vehicle instantly. You need to use 00A5 to create a truck & trailer, and then attach the trailer with 0893. Search for examples of using 00A5.
Also, your script is executed only once. To make a mass spawn you need an endless loop, I think.
Offline
opcode 014B does not create a vehicle instantly. You need to use 00A5 to create a truck & trailer, and then attach the trailer with 0893. Search for examples of using 00A5.
Thanks for the help.
Also, your script is executed only once. To make a mass spawn you need an endless loop, I think.
Yes, I know. But I'm trying to spawn one truck to test this. If it works, I'm going to create an endless loop.
Offline
{$CLEO .cs} 0A95: enable_thread_saving if 0@ == 0 then 00A5: 1@ = create_car #petro at 1648.537 -1068.407 24.378 angle 180.0 00A5: 2@ = create_car #petrotr at 1648.537 -1059.974 24.378 angle 180.0 wait 10 0893: put_trailer 2@ on_cab 1@ 0@ = 1 end 0A93: end_custom_thread
Well, got this, but GTA still crashes.
{$CLEO .cs} 0A95: enable_thread_saving if 0@ == 0 then 00A5: $1 = create_car #petrotr at 1648.537 1068.407 24.378 angle 180.0 wait 500 00A5: $2 = create_car #petro at 1648.537 -1068.407 24.378 angle 180.0 wait 10 0893: put_trailer $1 on_cab $2 0@ = 1 end 0A93: end_custom_thread
I also tried this, but still doesn't work.
Offline
Does it work?
{$CLEO} 0A95: enable_thread_saving 014B: 1@ = init_parked_car_generator #petro color -1 -1 1 alarm 0 door_lock 0 0 10000 at 1648.537 -1068.407 24.378 angle 180.0 014C: set_parked_car_generator 1@ cars_to_generate_to 101 014B: 2@ = init_parked_car_generator #petrotr color -1 -1 1 alarm 0 door_lock 0 0 10000 at 1648.537 -1059.974 24.378 angle 180.0 014C: set_parked_car_generator 2@ cars_to_generate_to 101 wait 10 0893: put_trailer 2@ on_cab 1@ 0A93: end_custom_thread
Maybe you need longer WAIT ?
-=YariK=-
http://my-mods.org.ua/
Offline
You didn't load models #petro and #petrotr before create a car. And the first variant is better, as it uses local variables.
Offline
Does it work?
{$CLEO} 0A95: enable_thread_saving 014B: 1@ = init_parked_car_generator #petro color -1 -1 1 alarm 0 door_lock 0 0 10000 at 1648.537 -1068.407 24.378 angle 180.0 014C: set_parked_car_generator 1@ cars_to_generate_to 101 014B: 2@ = init_parked_car_generator #petrotr color -1 -1 1 alarm 0 door_lock 0 0 10000 at 1648.537 -1059.974 24.378 angle 180.0 014C: set_parked_car_generator 2@ cars_to_generate_to 101 wait 10 0893: put_trailer 2@ on_cab 1@ 0A93: end_custom_threadMaybe you need longer WAIT ?
This script works half. I get no crash, but it's only spawning the cab, not even the trailer.
{$CLEO} 0A95: enable_thread_saving 014B: 1@ = init_parked_car_generator #petrotr color -1 -1 1 alarm 0 door_lock 0 0 10000 at 1648.537 -1068.407 24.378 angle 180.0 014C: set_parked_car_generator 1@ cars_to_generate_to 101 wait 100 014B: 2@ = init_parked_car_generator #petro color -1 -1 1 alarm 0 door_lock 0 0 10000 at 1648.537 -1068.407 24.378 angle 180.0 014C: set_parked_car_generator 2@ cars_to_generate_to 101 wait 100 0893: put_trailer 1@ on_cab 2@ 0A93: end_custom_thread
Doesn't spawn me a cab, but just the trailer.
Also tried loading the models before spawning them, but it's no go.
I attached a screenshot, using the Yarik's script.
Edit: Added 2nd screenshot. As you can see, cab and trailer are spawning right now, but nothing happens to attatching.
Last edited by Eyon (20-05-2008 16:51)
Offline
I still don't have the scripts working. Even when using 00A5 as opcode. Maybe someone can provide a working script?
Offline
I can't help you with the code itself, because it looks good to me. But if you want, go to gta-action.com and take look at ZAZ's Truck+Trailer in Traffic Script (inside his CLEO Thread), he does what you want to archive. But iirc he takes a random car from traffic, places it for his needs and changes the model. Before attaching he sets visibility to 0.
Take a look inside, thats the way I learn best, maybe it helps you, too.
regards, Threep
Offline
first of all
Model.Load(#petro) Model.Load(#petrotr) wait 200 038B: load_requested_models 00A5: 4@ = create_car 514 at x y z 00A5: 5@ = create_car 584 at x y z ................. Other Code .... Model.Destroy(#petro) Model.Destroy(#petrotr)
But i think you have more mistakes than i show you.
Last edited by XotaBi4b (15-09-2008 16:17)
GTA SA CrashKiller by MadniX , Virtual_Key_Codes for opcode 0AB0
Offline
Pages: 1