04/12/2022 19:42
Quando utilizo for() para percorrer um array na Callback OnGameModeInit, simplesmente não funcionar ou não consigo ver o problema.
Código:
// Veiculos
new VehicleDmPolominio[14] = 0;
public OnGameModeInit()
{
VehicleDmPolominio[0] = CreateVehicle (518,2209.5073,110.3718,26.8693,267.8989,0,0, 30);
SetVehicleVirtualWorld(VehicleDmPolominio[0], World_DmPolominio);
VehicleDmPolominio[1] = CreateVehicle (451,2403.0305,105.8698,26.8667,0.4936,123,123, 30);
VehicleDmPolominio[2] = CreateVehicle (518,2263.9644,105.1105,26.7079,356.5874,0,0, 30);
VehicleDmPolominio[3] = CreateVehicle (515,2278.9983,-5.3087,28.1957,180.0700,123,0, 30);
VehicleDmPolominio[4] = CreateVehicle (560,2240.1484,-7.0267,27.0675,178.3491,123,123, 30);
VehicleDmPolominio[5] = CreateVehicle (522,2206.4771,-37.8522,26.7752,94.8557,0,0, 30);
VehicleDmPolominio[6] = CreateVehicle (579,2190.9514,-45.6606,27.4152,89.8567,0,0, 30);
VehicleDmPolominio[7] = CreateVehicle (605,2206.2229,-46.1343,26.6756,89.4399,0,0, 30);
VehicleDmPolominio[8] = CreateVehicle (411,2493.8579,87.3181,26.2114,178.2872,17,17, 30);
VehicleDmPolominio[9] = CreateVehicle (411,2469.3030,127.6661,26.2036,0.1653,17,17, 30);
VehicleDmPolominio[10] = CreateVehicle (411,2528.6353,129.4158,26.2115,358.4294,17,17, 30);
VehicleDmPolominio[11] = CreateVehicle (597,2424.6479,-57.5501,27.1976,358.8207,1,0, 30);
VehicleDmPolominio[12] = CreateVehicle (482,2420.5574,85.9662,26.5897,182.2224,123,123, 30);
VehicleDmPolominio[13] = CreateVehicle (411,2406.2703,105.7939,26.8746,0.7416,123,123, 30);
for(new x = 0; x > 13; x++){
printf("Teste array");
SetVehicleVirtualWorld(VehicleDmPolominio[x], World_DmPolominio);
}
return 1;
}