07.10.2009, 14:11
I tried now this:
IT WORKS, but why it do this: http://www.xfire.com/video/15a12b/
It reattaching the trailer!!
pawn Code:
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));
}
It reattaching the trailer!!