03.01.2015, 17:53
Quote:
@CutX
Why would you add Float tag to every item in the array since you added the tag to the array's name? |
the array has the float tag meaning that there should be floating point numbers.
but 2 ain't a float, so we're kinda "type casting" it

if i were to remove the tag from the whole array, it'd look like:
pawn Код:
new RandomCarSpawn[][] = //now we have to add the tag 4 times every row
{//instead of just three and the same goes when using it
{427,_:2239.6694,_:2441.9373,_:3.4053,_:88.4534,0,1},
{427,_:2239.6694,_:2441.9373,_:3.4053,_:88.4534,0,1},
{427,_:2239.6694,_:2441.9373,_:3.4053,_:88.4534,0,1},
{427,_:2239.6694,_:2441.9373,_:3.4053,_:88.4534,0,1},
{427,_:2239.6694,_:2441.9373,_:3.4053,_:88.4534,0,1}
//and so on for 80 cars
};
public OnFilterScriptInit()
{
for(new i=0,x; i<80; i++)
{
x = random(sizeof RandomCarSpawn);// 4 times _: instead of just 3 LAZYNESS :P
AddStaticVehicle(RandomCarSpawn[x][0],
_:RandomCarSpawn[x][1],
_:RandomCarSpawn[x][2],
_:RandomCarSpawn[x][3],
_:RandomCarSpawn[x][4],
RandomCarSpawn[x][5],
RandomCarSpawn[x][6]);
}
return 1;
}