If that vehicle is not occupied yet, you should put him in that boat right after spawn (this will force the boat to stream in) and then remove him again. This will set the player on the boat. This can be done with any seat (in case only the driver or the passenger seat (if existing) is occupied).
If the boat is occupied and doesn't have any free seats, you must teleport the player to the boat and freeze him (TogglePlayerControllable). After the boat streamed in (which can take up to 1 second) you should unfreeze him and check if the boat is still under his feet. If not, set position again using GetVehiclePos and SetPlayerPos.
However I don't know how you would detect the boat's position without GetVehiclePos, I assume that someone might drive the boat.
If you want to calculate a fixed point on the boat (like the heck of the boat), you must get the boat's Z angle and calculate a position based on that angle using sin/cos.
However while the boat is driving, it is really hard to set someone on it. The calculated position will always be behind the boat, so the player will fall into water.
This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.
Recommended article from FiveFilters.org: Most Labour MPs in the UK Are Revolting.
Spawn on boat
Aucun commentaire:
Enregistrer un commentaire