Quote:
Originally Posted by » JoFi »
Well Here is Example, This Will Add Text: "Vehicle Owner: OwnerName" on every car which is in cars.cfg
FIND:
pawn Код:
for(new h = 184; h < sizeof(CarInfo); h++) { SetVehicleParamsForPlayer(h,playerid,0,CarInfo[h][cLock]); }
Change To
pawn Код:
new Text3D:Vehicle3D; for(new h = 184; h < sizeof(CarInfo); h++) { SetVehicleParamsForPlayer(h,playerid,0,CarInfo[h][cLock]); format(string, 40, "Vehicle Owner: %s",CarInfo[h][cOwner]); Vehicle3D = Create3DTextLabel(string, 0x32CD32AA, 0.0, 0.0, 0.0, 20.0, 0, 1 ); Attach3DTextLabelToVehicle(Vehicle3D,h, 0.0, 0.0, 1.0); }
- Hope It Works Didn't Test..
|
Almost what I needed, I just need the Car Plate thingy not the Owner, making the plate thing right now, hopefully will work
EDIT!!!!
SO here's the problem:
On the car it shows 123 numbers only although i made into cars.cfg DSD,123 so it should show DSD 123
HEre's the code:
for(new h = 184; h < sizeof(CarInfo); h++)
{
SetVehicleParamsForPlayer(h,playerid,0,CarInfo[h][cLock]);
format(string, 40, "%s_%d",CarInfo[h][c3DT],CarInfo[h][c3DN]);
Vehicle3D = Create3DTextLabel(string, 0x32CD32AA, 0.0, 0.0, 0.0, 20.0, 0, 1 );
Attach3DTextLabelToVehicle(Vehicle3D,h, 0.0, 0.0, 1.0);
}
public LoadCar()
{
new arrCoords[15][64];
new strFromFile2[256];
new File: file = fopen("cfg/cars.cfg", io_read);
if (file)
{
new idx = 184;
while (idx < sizeof(CarInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
CarInfo[idx][cModel] = strval(arrCoords[0]);
CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);
CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);
CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);
CarInfo[idx][cAngle] = floatstr(arrCoords[4]);
CarInfo[idx][cColorOne] = strval(arrCoords[5]);
CarInfo[idx][cColorTwo] = strval(arrCoords[6]);
strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
CarInfo[idx][cValue] = strval(arrCoords[9]);
CarInfo[idx][cLicense] = strval(arrCoords[10]);
CarInfo[idx][cOwned] = strval(arrCoords[11]);
CarInfo[idx][cLock] = strval(arrCoords[12]);
CarInfo[idx][c3DT] = strlen(arrCoords[13]);
CarInfo[idx][c3DN] = strval(arrCoords[14]);
printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]);
idx++;
}
}
return 1;
}