11.09.2009, 01:50
Hi, i have this code:
Why it fails to compile? (Pawn compiles it but an error appears like if the program has to close).
If I put everything inside OnFilterScriptInit(), it compiles well, but in game I can't see the cars.
Код:
#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}; new NRandom = random(sizeof(Normal_Cars)); // Random Normal Cars new BRandom = random(sizeof(Bicycles)); // Random bicycles public OnFilterScriptInit() { AddStaticVehicle(NRandom,1836.7377,-1854.2983,13.1691,358.8890,0,1); // cheapcar1 AddStaticVehicle(NRandom,1841.1429,-1870.9862,13.1690,180.3903,0,1); // cheapcar2 AddStaticVehicle(NRandom,1791.4736,-1888.7665,13.1774,178.7570,0,1); // normalcar1 AddStaticVehicle(NRandom,1778.0460,-1913.4692,13.1675,275.8655,0,1); // normalcar2 AddStaticVehicle(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(BRandom,1881.0487,-1887.8309,13.2597,89.8009,0,1); // bikecycle1 AddStaticVehicle(NRandom,1826.8505,-1797.0966,13.2413,0.7763,0,1); // norcar4 AddStaticVehicle(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(NRandom,1742.8043,-1693.8945,13.3243,178.1735,0,1); // normalcar return 1; } public OnFilterScriptExit() { return 1; }
If I put everything inside OnFilterScriptInit(), it compiles well, but in game I can't see the cars.