PDA

View Full Version : get car name by id ?


Cleyson
06/03/2018, 05:59 PM
How to get the name of the car using his id?

Example get the car name of the 522 id?

Eoussama
06/03/2018, 06:13 PM
Literally the first result on ******.

http://forum.sa-mp.com/showpost.php?p=1584106&postcount=4

rolex
06/03/2018, 06:22 PM
try it:

// command with ZCMD
CMD:carname(playerid)
{
new string[128];
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You need to be inside of the vehicle to use that command!");
format(string, sizeof(string), "You are inside of a %s." GetCarName(playerid));
SendClientMessage(playerid, -1, string);
return 1;
}

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