Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Get a vehicle model to obtain information about that vehicle
- as::vehicle_model my_model(VEHICLE_ID::SABRETURBO);
- as::vehicle_model my_model(206);
- as::vehicle_model my_model("Sabre Turbo");
- // You can also extract the vehicle model from another vehicle
- as::vehicle_model my_model(my_veh);
- // Use that vehicle module as a blueprint to create one or more vehicles with the same model
- vc::vehicle@ my_veh = my_model.vehicle(my_player.world, my_player.position + as::vector3(-10, 0, 0), 0, as::rgb(), as::rgb());
- // Create a vehicle using any of the overloaded constructors
- // Using the vehicle model we created above
- vc::vehicle@ my_veh(my_model, my_player.world, my_player.position + as::vector3(-10, 0, 0), 0, as::rgb(), as::rgb());
- // Pass the vehicle model ID directly
- vc::vehicle@ my_veh(VEHICLE_ID::SABRETURBO, my_player.world, my_player.position + as::vector3(-10, 0, 0), 0, as::rgb(), as::rgb());
- vc::vehicle@ my_veh(206, my_player.world, my_player.position + as::vector3(-10, 0, 0), 0, as::rgb(), as::rgb());
- // Pass the vehicle model name directly
- vc::vehicle@ my_veh("Sabre Turbo", my_player.world, my_player.position + as::vector3(-10, 0, 0), 0, as::rgb(), as::rgb());
- // Using another vehicle to extract the model, world, color etc. except the position
- vc::vehicle@ my_veh(another_veh, my_player.world, my_player.position + as::vector3(-10, 0, 0), 0, as::rgb(), as::rgb());
- // ALL OF THE ABOVE CODE ACHIEVE THE SAME THING
- // When the arrows point from the player instance to the vehicle instance
- // then the player embarks in that vehicle
- // Get in the vehicle
- my_veh << my_player;
- // Get in the vehicle
- my_player >> my_veh;
- // When the arrows point from the vehicle instance to the player instance
- // then the player disembarks from that vehicle
- // Get out the vehicle
- my_veh >> my_player;
- // Get out the vehicle
- my_player << my_veh;
- // Direct functions are also available also on both player and vehicle
- my_veh.embark(my_player);
- my_player.embark(my_veh);
- // They all have multiple overloads to allow you to customize the result
- // Extra arguments are: int slot, bool make_room, bool warp
- my_veh.embark(my_player, 0, true, true);
- // Extra arguments are: int slot, bool make_room, bool warp
- my_player.embark(my_veh, 0, true, true);
- my_player.disembark();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement