SA-MP Forums Archive
What causes reattaching the trailer? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What causes reattaching the trailer? (/showthread.php?tid=101400)



What causes reattaching the trailer? - yugokoral - 10.10.2009

I made a script to teleport a vehicle with trailer:
pawn Код:
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);

    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;
}


public OnVehicleStreamIn(vehicleid, forplayerid)
{
    AttachTrailerToVehicle(GetVehicleTrailer(GetPlayerVehicleID(forplayerid)),GetPlayerVehicleID(forplayerid));
}
but why this script causes this reattaching, without teleporting too?
http://www.xfire.com/video/15a12b/