SA-MP Forums Archive
How to make a car spawn inside of an interior? - 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)
+--- Thread: How to make a car spawn inside of an interior? (/showthread.php?tid=191333)



How to make a car spawn inside of an interior? - Lars_Frederiksen - 18.11.2010

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
	}



Re: How to make a car spawn inside of an interior? - calanda1 - 19.11.2010

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


Re: How to make a car spawn inside of an interior? - Ruffles. - 19.11.2010

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


Re: How to make a car spawn inside of an interior? - Zonoya - 24.10.2011

Bumped a year old thread, Deleted