PDA

View Full Version : How to make a car spawn inside of an interior?


Lars_Frederiksen
18/11/2010, 08:51 PM
Here's my code, I'm working on a Garage system for my server, only problem is the car won't spawn inside of the interior, can somebody please help me fix this problem?

new Float:Carx = HouseInfo[playerid][hHouseCarX];
new Float:Cary = HouseInfo[playerid][hHouseCarY];
new Float:Carz = HouseInfo[playerid][hHouseCarZ];
new Float:Carangle = HouseInfo[playerid][hHouseCarAngle];
new Float:CarGaragex = GarageInfo[playerid][gGarageParkX];
new Float:CarGaragey = GarageInfo[playerid][gGarageParkY];
new Float:CarGaragez = GarageInfo[playerid][gGarageParkZ];

new garageint = GarageInfo[playerid][gGarageInt];
new garagevw = GarageInfo[playerid][gGarageVW];

new CarId = HouseInfo[playerid][hHouseCarId];

if(HouseInfo[playerid][hHouseCarColorChosen] == 0) // Random color
{
new randcolor = 1 + random(125);
if (GarageInfo[playerid][gOwnsGarage] == 1)
{
playercarid[playerid] = SetVehicleVirtualWorld(AddStaticVehicleEx(CarId,Ca rGaragex,CarGaragey,CarGaragez,Carangle,randcolor, randcolor,300000),garagevw);//Sultan
LinkVehicleToInterior(CarId,garageint);
SetVehicleVirtualWorld(CarId,garageint);
}
else
{
playercarid[playerid] = CreateVehicle(CarId,Carx,Cary,Carz,Carangle,randco lor,randcolor,300000);
}
}
else if(HouseInfo[playerid][hHouseCarColorChosen] == 1) // bought colors
{
new color1 = HouseInfo[playerid][hHouseCarColor1];
new color2 = HouseInfo[playerid][hHouseCarColor2];
if (GarageInfo[playerid][gOwnsGarage] == 1)
{
playercarid[playerid] = CreateVehicle(CarId,CarGaragex,CarGaragey,CarGarag ez,Carangle,color1,color1,300000);
LinkVehicleToInterior(CarId,garageint);
SetVehicleVirtualWorld(CarId,garageint);
}
else
{
playercarid[playerid] = CreateVehicle(CarId,Carx,Cary,Carz,Carangle,color1 ,color2,300000);
}
}
for (new i=0; i<MAX_POINTS; i++)
{
new cartolock = playercarid[playerid];
SetVehicleParamsForPlayer(cartolock,i,0,0);
HouseInfo[playerid][hHouseCarLocked] = 0; // unlocked
}

calanda1
19/11/2010, 06:13 PM
I'm pretty sure vehicles can't be spawned inside interiors

Ruffles.
19/11/2010, 06:38 PM
Set the vehicle interior id to I think it was 1, that's the default for all SP interiors I think.

This forum requires that you wait 120 seconds between posts. Please try again in 74 seconds.


I'm pretty sure vehicles can't be spawned inside interiors
I think that too, I think they will appears invisible

Zonoya
24/10/2011, 12:05 PM
Bumped a year old thread, Deleted