VehicleNames array
#1

Hey, is there a way to make the VehicleNames array more efficient or more "cleaner"?

pawn Код:
new VehicleNames[212][] = {
    {"Landstalker"     }, {"Bravura"        }, {"Buffalo"          }, {"Linerunner"       }, // 400, 401, 402, 403
    {"Perrenial"       }, {"Sentinel"       }, {"Dumper"           }, {"Firetruck"        }, // 404, 405, 406, 407
    {"Trashmaster"     }, {"Stretch"        }, {"Manana"           }, {"Infernus"         }, // 408, 409, 410, 411
    {"Voodoo"          }, {"Pony"           }, {"Mule"             }, {"Cheetah"          }, // 412, 413, 414, 415
    {"Ambulance"       }, {"Leviathan"      }, {"Moonbeam"         }, {"Esperanto"        }, // 416, 417, 418, 419
    {"Taxi"            }, {"Washington"     }, {"Bobcat"           }, {"Mr Whoopee"       }, // 420, 421, 422, 423
    {"BF Injection"    }, {"Hunter"         }, {"Premier"          }, {"Enforcer"         }, // 424, 425, 426, 427
    {"Securicar"       }, {"Banshee"        }, {"Predator"         }, {"Bus"              }, // 428, 429, 430, 431
    {"Rhino"           }, {"Barracks"       }, {"Hotknife"         }, {"Trailer 1"        }, // 432, 433, 434, 435
    {"Previon"         }, {"Coach"          }, {"Cabbie"           }, {"Stallion"         }, // 436, 437, 438, 439
    {"Rumpo"           }, {"RC Bandit"      }, {"Romero"           }, {"Packer"           }, // 440, 441, 442, 443
    {"Monster"         }, {"Admiral"        }, {"Squalo"           }, {"Seasparrow"       }, // 444, 445, 446, 447
    {"Pizzaboy"        }, {"Tram"           }, {"Trailer 2"        }, {"Turismo"          }, // 448, 449, 450, 451
    {"Speeder"         }, {"Reefer"         }, {"Tropic"           }, {"Flatbed"          }, // 452, 453, 454, 455
    {"Yankee"          }, {"Caddy"          }, {"Solair"           }, {"RC Van"           }, // 456, 457, 458, 459
    {"Skimmer"         }, {"PCJ-600"        }, {"Faggio"           }, {"Freeway"          }, // 460, 461, 462, 463
    {"RC Baron"        }, {"RC Raider"      }, {"Glendale"         }, {"Oceanic"          }, // 464, 465, 466, 467
    {"Sanchez"         }, {"Sparrow"        }, {"Patriot"          }, {"Quad"             }, // 468, 469, 470, 471
    {"Coastguard"      }, {"Dinghy"         }, {"Hermes"           }, {"Sabre"            }, // 472, 473, 474, 475
    {"Rustler"         }, {"ZR-350"         }, {"Walton"           }, {"Regina"           }, // 476, 477, 478, 479
    {"Comet"           }, {"BMX"            }, {"Burrito"          }, {"Camper"           }, // 480, 481, 482, 483
    {"Marquis"         }, {"Baggage"        }, {"Dozer"            }, {"Maverick"         }, // 484, 485, 486, 487
    {"News Chopper"    }, {"Rancher"        }, {"FBI Rancher"      }, {"Virgo"            }, // 488, 489, 490, 491
    {"Greenwood"       }, {"Jetmax"         }, {"Hotring"          }, {"Sandking"         }, // 492, 493, 494, 495
    {"Blista"          }, {"Police Maverick"}, {"Boxville"         }, {"Benson"           }, // 496, 497, 498, 499
    {"Mesa"            }, {"RC Goblin"      }, {"Hotring A"        }, {"Hotring B"        }, // 500, 501, 502, 503
    {"Bloodring Banger"}, {"Rancher"        }, {"Super GT"         }, {"Elegant"          }, // 504, 505, 506, 507
    {"Journey"         }, {"Bike"           }, {"Mountain Bike"    }, {"Beagle"           }, // 508, 509, 510, 511
    {"Cropdust"        }, {"Stuntplane"     }, {"Tanker"           }, {"Roadtrain"        }, // 512, 513, 514, 515
    {"Nebula"          }, {"Majestic"       }, {"Buccaneer"        }, {"Shamal"           }, // 516, 517, 518, 519
    {"Hydra"           }, {"FCR-900"        }, {"NRG-500"          }, {"HPV1000"          }, // 520, 521, 522, 523
    {"Cement Truck"    }, {"Tow Truck"      }, {"Fortune"          }, {"Cadrona"          }, // 524, 525, 526, 527
    {"FBI Truck"       }, {"Willard"        }, {"Forklift"         }, {"Tractor"          }, // 528, 529, 530, 531
    {"Combine"         }, {"Feltzer"        }, {"Remington"        }, {"Slamvan"          }, // 532, 533, 534, 535
    {"Blade"           }, {"Freight"        }, {"Streak"           }, {"Vortex"           }, // 536, 537, 538, 539
    {"Vincent"         }, {"Bullet"         }, {"Clover"           }, {"Sadler"           }, // 540, 541, 542, 543
    {"Firetruck LA"    }, {"Hustler"        }, {"Intruder"         }, {"Primo"            }, // 544, 545, 546, 547
    {"Cargobob"        }, {"Tampa"          }, {"Sunrise"          }, {"Merit"            }, // 548, 549, 550, 551
    {"Utility"         }, {"Nevada"         }, {"Yosemite"         }, {"Windsor"          }, // 552, 553, 554, 555
    {"Monster"         }, {"Monster"        }, {"Uranus"           }, {"Jester"           }, // 556, 557, 558, 559
    {"Sultan"          }, {"Stratum"        }, {"Elegy"            }, {"Raindance"        }, // 560, 561, 562, 563
    {"RC Tiger"        }, {"Flash"          }, {"Tahoma"           }, {"Savanna"          }, // 564, 565, 566, 567
    {"Bandito"         }, {"Freight Flat"   }, {"Streak Carriage"  }, {"Kart"             }, // 568, 569, 570, 571
    {"Mower"           }, {"Duneride"       }, {"Sweeper"          }, {"Broadway"         }, // 572, 573, 574, 575
    {"Tornado"         }, {"AT-400"         }, {"DFT-30"           }, {"Huntley"          }, // 576, 577, 578, 579
    {"Stafford"        }, {"BF-400"         }, {"Newsvan"          }, {"Tug"              }, // 580, 581, 582, 583
    {"Trailer 3"       }, {"Emperor"        }, {"Wayfarer"         }, {"Euros"            }, // 584, 585, 586, 587
    {"Hotdog"          }, {"Club"           }, {"Freight Carriage" }, {"Trailer 3"        }, // 588, 589, 590, 591
    {"Andromada"       }, {"Dodo"           }, {"RC Cam"           }, {"Launch"           }, // 592, 593, 594, 595
    {"Police LS"       }, {"Police SF"      }, {"Police LV"        }, {"Police Ranger"    }, // 596, 597, 598, 599
    {"Picador"         }, {"S.W.A.T. Van"   }, {"Alpha"            }, {"Phoenix"          }, // 600, 601, 602, 603
    {"Glendale"        }, {"Sadler"         }, {"Luggage Trailer A"}, {"Luggage Trailer B"}, // 604, 605, 606, 607
    {"Stair Trailer"   }, {"Boxville"       }, {"Farm Plow"        }, {"Utility Trailer"  }  // 608, 609, 610, 611
};
Reply
#2

Nothing wrong with how they are listed there.
Reply
#3

Ah right, just seems a little untidy for me, but if they're fine as they are, then I may as well as leave them.
Reply
#4

You don't need to use brackets {} around the strings.

Packed strings might be a good idea though I'm not sure if using strunpack in a loop to find a specific name is very efficient way.
Reply
#5

Never given packed strings a thought really, so it'd be like this:
pawn Код:
!"Landstalker"     , !"Bravura"        , !"Buffalo"          , !"Linerunner"       , // 400, 401, 402, 403
Reply
#6

It uses "!" before but it needs the brackets. An example by Slice: http://forum.sa-mp.com/showpost.php?...2&postcount=11

In FindVehicleID function, he doesn't use strunpack so I guess strfind works for packed strings.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)