stock CreateVehicleEx(vehicletype,Float:x,Float:y,Float:z,Float:rot,color1,color2,resp,owner[],cost)
{
VehicleCount++;
new str[128];
format(str,128,"WSSFILES/CARDATA/%d.xcu",VehicleCount);
if(fexist(str))
{
VehicleVar[VehicleCount][vtype]=djInt(str,"VehicleType",false);
VehicleVar[VehicleCount][carX]=djFloat(str,"X",false);
VehicleVar[VehicleCount][carY]=djFloat(str,"Y",false);
VehicleVar[VehicleCount][carZ]=djFloat(str,"Z",false);
VehicleVar[VehicleCount][carRot]=djFloat(str,"Rot",false);
VehicleVar[VehicleCount][vcolor1]=djInt(str,"color1",false);
VehicleVar[VehicleCount][vcolor2]=djInt(str,"color2",false);
VehicleVar[VehicleCount][resp_time]=djInt(str,"Resp",false);
CreateVehicle(VehicleVar[VehicleCount][vtype],VehicleVar[VehicleCount][carX],VehicleVar[VehicleCount][carY],VehicleVar[VehicleCount][carZ],VehicleVar[VehicleCount][carRot],VehicleVar[VehicleCount][vcolor1],VehicleVar[VehicleCount][vcolor2],VehicleVar[VehicleCount][resp_time]);
format(VehicleVar[VehicleCount][ownername],24,"%s",dj(str,"Owner",false));
VehicleVar[VehicleCount][value]=djInt(str,"Cost",false);
}
else
{
// ....
}
if(!strcmp(VehicleVar[VehicleCount][ownername],"ForSale"))
{
VehicleVar[VehicleCount][locked]=0;
}
if(!strcmp(VehicleVar[VehicleCount][ownername],"SFPD"))
{
VehicleVar[VehicleCount][locked]=1;
}
VehicleVar[VehicleCount][engine]=0;
return VehicleCount;
}

|
Originally Posted by Y_Leѕѕ
Why are you creating a vehicle then loading another vehicle with information about that vehicle from a file? Why not just load the information in the first place?
|