Posts: 6,129
Threads: 36
Joined: Jan 2009
You declared your entire variable as a float, that's why.
You should use an
enum, so you can use multiple types of variables.
An example of this would be:
pawn Code:
enum eVehicleData {
iModel,
Float: fPosition[3], // X, Y, Z angles
Float: fSpawnAngle,
iColor[2], // Cars have 2 colours. We're storing these in an array, like fPosition
iPrice,
iSpawnID,
}
new
aVehicleData[141][eVehicleData]; // 141 is what you set, so I'm going to use this as to how many slots can be declared
stock someVehicleFunction() {
for(new i = 0; i < 140; i++) { // Same again here with the slots
// A more efficient way would be creating a variable to store each ID in the enum. I say efficient, it's a bit more convenient
aVehicleData[i][iSpawnID] = AddStaticVehicleEx(aVehicleData[i][iModel], aVehicleData[i][fPosition][0], aVehicleData[i][fPosition][1], aVehicleData[i][fPosition][2], aVehicleData[i][fSpawnAngle], aVehicleData[i][iColor][0], aVehicleData[i][iColor][1], 200);
}
return 1;
}
Posts: 6,129
Threads: 36
Joined: Jan 2009
You'd have to manually set them like so:
pawn Code:
aVehicleData[0][iModel] = 412;
aVehicleData[0][fPosition][0] = 2119.83203125;
aVehicleData[0][fPosition][1] = -1784.43359375;
aVehicleData[0][fPosition][2] = 13.31082916;
aVehicleData[0][fSpawnAngle] = 90.00000000;
aVehicleData[0][iPrice] = 100;
aVehicleData[0][iColor][0] = -1;
aVehicleData[0][iColor][1] = 2;
and change the '[0]' after 'aVehicleData' each time.