11.09.2009, 02:18
Don't Understand both of ya.
1 - Why Bicycles is wrong?
2 - I think I've created the variables and arrays outside the callbacks.
I've found that the problem is this two lines:
If I compile them in the Global area, it fails; inside OnFilterScriptInit() it compiles good (still I can't see the cars that it should generate from taking a random number from an array).
I've found a working way, but every car is the same:
I still don't know why it fails to compile when I use the Randoms Outside the Callbacks.
1 - Why Bicycles is wrong?
2 - I think I've created the variables and arrays outside the callbacks.
I've found that the problem is this two lines:
Код:
new NRandom = random(sizeof(Normal_Cars)); // Random Normal Cars new BRandom = random(sizeof(Bicycles)); // Random bicycles
I've found a working way, but every car is the same:
Код:
#include <a_samp> new Normal_Cars[]= {401,402,404,405,410,412,413,418,419,421, 422,426,436,439,445,458,466,467,474,475,478,479,480,489,491,492,496,507, 516,517,518,526,527,529,533,534,536,542,543,546,547,549,550,551,554,558, 561,566,575,576,580,585,600}; // Normal Cars new Bicycles[] = {509,481,510}; public OnFilterScriptInit() { new NRandom = random(sizeof(Normal_Cars)); // Random Normal Cars new BRandom = random(sizeof(Bicycles)); // Random bicycles AddStaticVehicle(Normal_Cars[NRandom],1836.7377,-1854.2983,13.1691,358.8890,0,1); // cheapcar1 AddStaticVehicle(Normal_Cars[NRandom],1841.1429,-1870.9862,13.1690,180.3903,0,1); // cheapcar2 AddStaticVehicle(Normal_Cars[NRandom],1791.4736,-1888.7665,13.1774,178.7570,0,1); // normalcar1 AddStaticVehicle(Normal_Cars[NRandom],1778.0460,-1913.4692,13.1675,275.8655,0,1); // normalcar2 AddStaticVehicle(Normal_Cars[NRandom],1802.2800,-1915.4110,13.1742,273.1066,0,1); // normalcar3 AddStaticVehicle(418,1922.2260,-1860.6227,13.3405,168.1871,0,1); // somevan AddStaticVehicle(Bicycles[BRandom],1881.0487,-1887.8309,13.2597,89.8009,0,1); // bikecycle1 AddStaticVehicle(Normal_Cars[NRandom],1826.8505,-1797.0966,13.2413,0.7763,0,1); // norcar4 AddStaticVehicle(Normal_Cars[NRandom],1816.2935,-1796.4451,13.2409,181.2451,0,1); // norcar6 AddStaticVehicle(587,1717.8387,-1737.7451,13.2408,270.3658,0,1); // sportcar AddStaticVehicle(459,1782.3186,-1701.4119,13.2818,6.8769,0,1); // workcar AddStaticVehicle(498,1765.7163,-1692.0504,13.2076,92.0528,0,1); // vanwork AddStaticVehicle(Normal_Cars[NRandom],1742.8043,-1693.8945,13.3243,178.1735,0,1); // normalcar return 1; } public OnFilterScriptExit() { return 1; }