SA-MP Forums Archive
How to teleport player and his veh ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to teleport player and his veh ? (/showthread.php?tid=462276)



How to teleport player and his veh ? - bustern - 06.09.2013

How to teleport player and if he is in veh to teleport the player in veh...


Re: How to teleport player and his veh ? - Dragonsaurus - 06.09.2013

Just set the vehicle positions instead player positions:
pawn Код:
if(!IsPlayerInAnyVehicle(playerid)) SetPlayerPos(playerid, ...);   // Check if player is NOT in any vehicle and sets the player's position.
else SetVehiclePos(GetPlayerVehicleID(playerid), ...);  // Else (If he is in a vehicle) set the vehicle's position.



Re: How to teleport player and his veh ? - Konstantinos - 06.09.2013

I don't want to be rude but every question comes to your mind, you create a thread for. Just search, there are dozen of results out there.

@Dragonsaurus: Checking if a player is vehicle is not that good. If someone is passenger, it will teleport the vehicle instead of removing the player and teleport them on foot.


Re: How to teleport player and his veh ? - Dragonsaurus - 06.09.2013

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
@Dragonsaurus: Checking if a player is vehicle is not that good. If someone is passenger, it will teleport the vehicle instead of removing the player and teleport them on foot.
Ehm, you are right... but that was the first thing that came to my mind... Yeah, I should have used playerstate for that one... Thanks for the correction though