Follow this code to correctly add cars and actors to GTA 3
:1
0247: request_model #CHEETAH <-- Our car we are going to use, this is the model name of the "Cheetah"
0247: request_model #WORKER1 <-- Our actor we are going to use
038B: load_requested_models <-- This opcode is self-explanatory and loads the requested models
0247: request_model #CHEETAH <-- Our car we are going to use, this is the model name of the "Cheetah"
0247: request_model #WORKER1 <-- Our actor we are going to use
038B: load_requested_models <-- This opcode is self-explanatory and loads the requested models
We now add a second label and spawn the two models:
:2
00A5: $Cheetah = create_car #CHEETAH at 833.906 -948.8681 34.0095 <-- This spawns our car just down the road from where Claude spawns
009A: $Actor = create_actor 21 #WORKER1 at 834.6981 -944.2986 33.9302 <-- This spawns our actor near our car
End_thread <- We are now ending the thread, the car and actor will stay in the game but any code after the "End_thread" opcode will not be executed
00A5: $Cheetah = create_car #CHEETAH at 833.906 -948.8681 34.0095 <-- This spawns our car just down the road from where Claude spawns
009A: $Actor = create_actor 21 #WORKER1 at 834.6981 -944.2986 33.9302 <-- This spawns our actor near our car
End_thread <- We are now ending the thread, the car and actor will stay in the game but any code after the "End_thread" opcode will not be executed
Code breakdown!
00A5: $Cheetah <-- This is the handle for our car, we can name it anything, don't forget to add "$" (without quotes) before naming and don't use it anywhere else in the script, We are only allowed to use this handle with the car we gave it too! Same goes for every other handle we use with certain object/actors and cars!
create_car #CHEETAH <-- This part creates our car, the model name should be exactly the same as what it was in the "Request model" opcode
at 833.906 -948.8681 34.0095 <-- These are the coords of our location we want the car to spawn, In Sanny Builder there is an option to collect player coords, Go in game and stand at a place where you would like to spawn a car/actor or object, then minimize the game and focus on Sanny Builder, right click --> insert ->> Player coords.
This will insert the coords were your player is stood in game into Sanny Builder, I used this method to collect coords for the car and actor we are using now!
With this knowledge you can now breakdown the "Create_Actor" opcode so you know how that works too.
00A5: $Cheetah <-- This is the handle for our car, we can name it anything, don't forget to add "$" (without quotes) before naming and don't use it anywhere else in the script, We are only allowed to use this handle with the car we gave it too! Same goes for every other handle we use with certain object/actors and cars!
create_car #CHEETAH <-- This part creates our car, the model name should be exactly the same as what it was in the "Request model" opcode
at 833.906 -948.8681 34.0095 <-- These are the coords of our location we want the car to spawn, In Sanny Builder there is an option to collect player coords, Go in game and stand at a place where you would like to spawn a car/actor or object, then minimize the game and focus on Sanny Builder, right click --> insert ->> Player coords.
This will insert the coords were your player is stood in game into Sanny Builder, I used this method to collect coords for the car and actor we are using now!
With this knowledge you can now breakdown the "Create_Actor" opcode so you know how that works too.
Onwards, The full code now looks like this:
{$CLEO}
0000:
:1
0247: request_model #CHEETAH
0247: request_model #WORKER1
038B: load_requested_models
:2
00A5: $Cheetah = create_car #CHEETAH at 833.906 -948.8681 34.0095
009A: $Actor = create_actor 21 #WORKER1 at 834.6981 -944.2986 33.9302
End_thread
0000:
:1
0247: request_model #CHEETAH
0247: request_model #WORKER1
038B: load_requested_models
:2
00A5: $Cheetah = create_car #CHEETAH at 833.906 -948.8681 34.0095
009A: $Actor = create_actor 21 #WORKER1 at 834.6981 -944.2986 33.9302
End_thread
Compile it using F6 and run the game to test!