23.09.2013, 02:37
Can someone explain the nature of this issue? It's an error 047, but why?
Errors:
pawn Код:
stock GetVehicleName(vehicleid,option=0)//if option = 0, use a vehicle with that ID; if option = 1, use a vehicle's model id (400-611?)
{
new vehicleNames[211][24] =
{"Landstalker", "Bravura", "Buffalo", "Linerunner", "Perenniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana",
"Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat",
"Mr. Whoopee","BF Injection","Hunter","Premiere","Police Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks",
"Hotknife","Article Trailer","Previon","Coach","Cabbie","Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral",
"Squallo","Seasparrow","Pizzaboy","Tram","Article Trailer 2","Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy",
"Solair","Topfun","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider","Glendale","Oceanic","Sanchez","Sparrow","Patriot",
"Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR-350","Walton","Regina","Comet","BMX","Burrito","Camper","Marquis",
"Baggage","Dozer","Maverick","SAN News Maverick","Rancher","FBI Rancher","Virgo","Greenwood","Hotring Racer","Sandking",
"Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer 2","Hotring Racer 3","Bloodring Racer",
"Rancher 2", "Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropduster","Stuntplane","Tanker","Roadtrain","Nebula",
"Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV-1000","Cement Truck","Towtruck","Fortune","Cadrona","FBI Truck",
"Willard","Forklift","Tractor","Combine Harvester","Feltzer","Remington","Slamvan","Blade","Freight","Brownstreak","Vortex",
"Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility",
"Nevada","Yosemite","Windsor","Monster","Monster","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash",
"Tahoma","Savanna","Bandito","Freight Trailer","Streak Trailer","Kart","Mower","Dune","Sweeper","Broadway","Tornado","AT-400",
"DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Petrol Trailer","Emperor","Wayfarer","Euros","Hotdog","Club","Freight Box Trailer",
"Article Trailer 3","Andromada","Dodo","RC Cam","Launch","Police Car","Police Car","Police Car","Police Ranger","Picador","S.W.A.T.",
"Alpha","Phoenix","Glendale Shit","Sadler Shit","Baggage Trailer A","Baggage Trailer B","Tug Stairs","Special Boxville","Farm Trailer",
"Utility Trailer"};//names of EVERY vehicle from models 400-611 (which is, again, ALL of them)
if(option == 0)
{
new badnum[] = "-2";
new model = GetVehicleModel(vehicleid);//model id
//new os = m == 0;//original success; helps detect an error before doing anything; and no, I don't know why I created a separate variable for this lol
if(vehicleid == INVALID_VEHICLE_ID || model == 0) return badnum;
return vehicleNames[model - 400];//line 405
} else if(option == 1)
{
new badnum[] = "-2";
if(vehicleid == INVALID_VEHICLE_ID || vehicleid < 400 || vehicleid > 611) return badnum;
return vehicleNames[vehicleid - 400];//line 410
} else {
new rte[1][3] = {"-1"};
return rte[0];
}
}
Код:
youdontneedtoknowthenameofthisscript.pwn(405) : error 047: array sizes do not match, or destination array is too small youdontneedtoknowthenameofthisscript.pwn(410) : error 047: array sizes do not match, or destination array is too small