Hi, me and some other people have a problem and we can't find a solution.
Code:
if(dialogid == 109 && response == 1)
{
if(listitem == 0)
{
new Float:x, Float:y, Float:z,Float:a, world, interior;
GetPlayerPos(playerid, x, y, z);
GetXYInFrontOfPlayer(playerid, x, y, 5.0);
GetPlayerFacingAngle(playerid, a);
world = GetPlayerVirtualWorld(playerid);
interior = GetPlayerInterior(playerid);
Geefveh = AddStaticVehicleEx(537, x, y, z + 2.0, a + 90.0, -1, -1, 5000);
SetVehicleVirtualWorld(Geefveh, world);
LinkVehicleToInterior(Geefveh, interior);
PutPlayerInVehicle(playerid, Geefveh, 0);
SendClientMessage(playerid, COLOR_WHITE, "Vehicle spawned!");
}
if(listitem == 1)
{
new Float:x, Float:y, Float:z,Float:a, world, interior;
GetPlayerPos(playerid, x, y, z);
GetXYInFrontOfPlayer(playerid, x, y, 5.0);
GetPlayerFacingAngle(playerid, a);
world = GetPlayerVirtualWorld(playerid);
interior = GetPlayerInterior(playerid);
Geefveh = AddStaticVehicleEx(538, x, y, z + 2.0, a + 90.0, -1, -1, 5000);
SetVehicleVirtualWorld(Geefveh, world);
LinkVehicleToInterior(Geefveh, interior);
PutPlayerInVehicle(playerid, Geefveh, 0);
SendClientMessage(playerid, COLOR_WHITE, "Vehicle spawned!");
}
if(listitem == 2)
{
new Float:x, Float:y, Float:z,Float:a, world, interior;
GetPlayerPos(playerid, x, y, z);
GetXYInFrontOfPlayer(playerid, x, y, 5.0);
GetPlayerFacingAngle(playerid, a);
world = GetPlayerVirtualWorld(playerid);
interior = GetPlayerInterior(playerid);
Geefveh = AddStaticVehicleEx(449, x, y, z + 2.0, a + 90.0, -1, -1, 5000);
SetVehicleVirtualWorld(Geefveh, world);
LinkVehicleToInterior(Geefveh, interior);
PutPlayerInVehicle(playerid, Geefveh, 0);
SendClientMessage(playerid, COLOR_WHITE, "Vehicle spawned!");
}
return 1;
}
Normally when you exit a vehicle the camera switches back to the player.
But when you spawn a vehicle and you emidiatly put yourself in the Freight/Streak/Tram and you exit the vehicle the camera is still behind the train and doesnt follow the player. (Look at the video)
This is only with the Freight/Streak/Tram because I think they use as special cameraposition.