Error 047?
#1

Can someone explain the nature of this issue? It's an error 047, but why?

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];
    }
}
Errors:
Код:
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
Reply
#2

IBM wake up we can't see the line numbers to help you
Reply
#3

Anybody?
Reply
#4

To be honest, I don't know why it causes it. But why don't you try this post?
It's much easier!
Reply
#5

Use format. I had the same issue some days ago.
Reply
#6

Try separating the whole vehicleNames thing from that stock. Also try removing the size of variable
Reply
#7

Quote:
Originally Posted by Dragonsaurus
Посмотреть сообщение
Use format. I had the same issue some days ago.
This fixed it all! Thanks, repping now.

And thanks to anyone else EDIT: repped anyone who commented.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)