04.10.2009, 19:10
I made this now:
And it works. When i teleport its attached but only 1ms later it detaches :S Than i must attach it with my hands. And when i teleport on the same place again, and again and i repeating teleporting than it still attached! Whats the problem?
I mean the first teleport on one place causes a detach.
Код:
stock TeleportWithVehicleTrailer(playerid, Float:Vx, Float:Vy, Float:Vz, Float:Va, Float:Px, Float:Py, Float:Pz, Float:Pa) { if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Unknown command."); SetVehiclePos(GetPlayerVehicleID(playerid), Float:Vx, Float:Vy, Float:Vz); SetVehicleZAngle(GetPlayerVehicleID(playerid),Float:Va); SetCameraBehindPlayer(playerid); AttachTrailerToVehicle(GetVehicleTrailer(GetPlayerVehicleID(playerid)),GetPlayerVehicleID(playerid)); SetVehiclePos(GetVehicleTrailer(GetPlayerVehicleID(playerid)), Float:Vx, Float:Vy, Float:Vz); SetVehicleZAngle(GetVehicleTrailer(GetPlayerVehicleID(playerid)), Float:Va); } else { SetPlayerPos(playerid, Float:Px, Float:Py, Float:Pz); SetPlayerFacingAngle(playerid, Float:Pa); SetCameraBehindPlayer(playerid); } return 1; }
I mean the first teleport on one place causes a detach.