18.11.2010, 20:51
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 }