Quote:
Originally Posted by lamarr007
Use my function:
pawn Код:
stock TeleportPlayerTo(playerid, interior, Float:x, Float:y, Float:z, Float:angle) { SetPlayerInterior(playerid, interior); if(IsPlayerInAnyVehicle(playerid)){ new vehicle = GetPlayerVehicleID(playerid); SetVehicleVirtualWorld(vehicle, vworld); LinkVehicleToInterior(vehicle, interior); SetVehiclePos(vehicle, x, y, z); SetVehicleZAngle(vehicle, angle); SetCameraBehindPlayer(playerid);}else{ SetPlayerPos(playerid, x, y, z); SetPlayerFacingAngle(playerid, angle); SetCameraBehindPlayer(playerid);} }
|
Wrong.
if(IsPlayerInAnyVehicle(playerid)) would still detect passengers as well. So if they are driving along with somebody and decide to teleport, the driver of the vehicle will be teleported with them... not very convenient.