How to make a car spawn inside of an interior?
#1

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,CarGaragex,CarGaragey,CarGaragez,Carangle,randcolor,randcolor,300000),garagevw);//Sultan
			LinkVehicleToInterior(CarId,garageint);
			SetVehicleVirtualWorld(CarId,garageint);
		}
 		else
		{
			playercarid[playerid] = CreateVehicle(CarId,Carx,Cary,Carz,Carangle,randcolor,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,CarGaragez,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
	}
Reply
#2

I'm pretty sure vehicles can't be spawned inside interiors
Reply
#3

Set the vehicle interior id to I think it was 1, that's the default for all SP interiors I think.

Quote:

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

Quote:
Originally Posted by calanda1
Посмотреть сообщение
I'm pretty sure vehicles can't be spawned inside interiors
I think that too, I think they will appears invisible
Reply
#4

Bumped a year old thread, Deleted
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)