16.04.2011, 12:58
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:
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;
}