Follow this code to correctly add cars and actors to SA
:1
0247: load_model #CHEETAH <-- Our car we are going to use, this is the model name of the "Cheetah"
0247: load_model #WBDYG2 <-- Our actor we are going to use
0247: load_model #CHEETAH <-- Our car we are going to use, this is the model name of the "Cheetah"
0247: load_model #WBDYG2 <-- Our actor we are going to use
We now add a second label and spawn the two models:
:2
00A5: $Cheetah = create_car #CHEETAH at 2475.5181 -1662.4388 13.3353 <-- This spawns our car to the left of were CJ spawns
009A: $Actor = create_actor_pedtype 4 model #WBDYG2 at 2475.0178 -1664.8026 13.321 <-- This spawns our actor to on top of 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 2475.5181 -1662.4388 13.3353 <-- This spawns our car to the left of were CJ spawns
009A: $Actor = create_actor_pedtype 4 model #WBDYG2 at 2475.0178 -1664.8026 13.321 <-- This spawns our actor to on top of 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 2475.5181 -1662.4388 13.3353 <-- 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 2475.5181 -1662.4388 13.3353 <-- 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: load_model #CHEETAH
0247: load_model #WBDYG2
038B: load_requested_models
:2
00A5: $Cheetah = create_car #CHEETAH at 2475.5181 -1662.4388 13.3353
009A: $Actor = create_actor 4 #WBDYG2 at 2475.0178 -1664.8026 13.321
End_thread
0000:
:1
0247: load_model #CHEETAH
0247: load_model #WBDYG2
038B: load_requested_models
:2
00A5: $Cheetah = create_car #CHEETAH at 2475.5181 -1662.4388 13.3353
009A: $Actor = create_actor 4 #WBDYG2 at 2475.0178 -1664.8026 13.321
End_thread
Compile it using F6 and run the game to test!