Szerző Téma: GetVehicleModelIDFromName  (Megtekintve 2836 alkalommal)

GetVehicleModelIDFromName
« Dátum: 2013. szeptember 27. - 13:36:10 »
+1 Show voters
Sziasztok, ma egy egyszerû funkciót hoztam.
Lényege, a kocsi modell nevérõl tudod lekérni a Kocsi ModelIDt.
Használat: GetVehicleModelIDFromName(ModellNeve) pl:GetVehicleModelIDFromName(\"Alpha\")
return: A kocsi ModelID-jét adja vissza, illetve -1 ha nem található.
 

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

 
Ötletet adta: Az SSCANF-ban lévõ hasonló funkció.
« Utoljára szerkesztve: 2013. szeptember 27. - 13:46:15 írta vortexY »

Nem elérhető jana4

  • 5929
  • Ex Staff
    • Profil megtekintése
GetVehicleModelIDFromName
« Válasz #1 Dátum: 2013. szeptember 27. - 14:19:32 »
0 Show voters
Kicsit terjedelmes kód, lásd egy hatékonyabb megoldás: http://pastebin.com/4WY6Cw5S

GetVehicleModelIDFromName
« Válasz #2 Dátum: 2013. szeptember 27. - 15:18:55 »
0 Show voters
Good :)

GetVehicleModelIDFromName
« Válasz #3 Dátum: 2013. szeptember 28. - 11:09:13 »
0 Show voters
Idézetet írta: Lester date=1380287935\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"43143\" data-ipsquote-contentclass=\"forums_Topic
Good :)
 
Kösz :)

GetVehicleModelIDFromName
« Válasz #4 Dátum: 2013. szeptember 28. - 12:09:56 »
0 Show voters
szép

Nem elérhető scripter01

  • 1035
  • Ex Moderálisan Globális
    • Profil megtekintése
GetVehicleModelIDFromName
« Válasz #5 Dátum: 2013. szeptember 30. - 09:51:07 »
0 Show voters
Jó lett...

GetVehicleModelIDFromName
« Válasz #6 Dátum: 2015. november 12. - 11:45:25 »
0 Show voters
Ezt egy kocsi lehívó parancsba hogy lehet belerakni?

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal