[Ajuda] Funзхes para concessionбria.
#8

pawn Код:
printf("Nome do Carro: %s | Preзo do Carro: %s", GetVehicleNome(playerid), GetVehiclePreco(playerid));
Primeiro erro, й string, use %s para o preзo tambйm;


Mas vocк pode fazer assim no preзo;
pawn Код:
stock GetVehiclePreco(playerid)
{
    new preco;
    switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
     {
         case 400: preco = 40000;
         case 401: preco = 15000;
         case 402: preco = 50000;
         case 403: preco = 25000;
         case 404: preco = 12000;
         case 405: preco = 45000;
         case 409: preco = 110000;
         case 410: preco = 10000;
         case 411: preco = 16000;
         case 412: preco = 23000;
         case 413: preco = 30000;
         case 415: preco = 135000;
         case 418: preco = 11000;
         case 419: preco = 13500;
         case 420: preco = 11000;
         case 421: preco = 36000;
         case 422: preco = 18000;
         case 424: preco = 14000;
         case 426: preco = 30000;
         case 428: preco = 90000;
         case 429: preco = 75000;
         case 436: preco = 12000;
         case 439: preco = 14500;
         case 440: preco = 35000;
         case 442: preco = 25000;
         case 445: preco = 28000;
         case 451: preco = 150000;
         case 458: preco = 13500;
         case 459: preco = 23000;
         case 461: preco = 28000;
         case 462: preco = 7000;
         case 463: preco = 12000;
         case 466: preco = 22500;
         case 467: preco = 22500;
         case 468: preco = 17000;
         case 474: preco = 14500;
         case 475: preco = 24000;
         case 477: preco = 78000;
         case 478: preco = 23000;
         case 479: preco = 23000;
         case 480: preco = 105000;
         case 481: preco = 5000;
         case 482: preco = 30000;
         case 483: preco = 15000;
         case 489: preco = 43000;
         case 491: preco = 29000;
         case 492: preco = 26000;
         case 495: preco = 45000;
         case 496: preco = 19000;
         case 498: preco = 45000;
         case 500: preco = 27000;
         case 506: preco = 125000;
         case 507: preco = 30000;
         case 509: preco = 1500;
         case 510: preco = 8000;
         case 514: preco = 35000;
         case 515: preco = 45000;
         case 516: preco = 18000;
         case 517: preco = 20000;
         case 518: preco = 23000;
         case 521: preco = 45000;
         case 522: preco = 105000;
         case 525: preco = 11000;
         case 526: preco = 12000;
         case 527: preco = 11000;
         case 529: preco = 14000;
         case 533: preco = 35000;
         case 534: preco = 20000;
         case 535: preco = 35000;
         case 536: preco = 24000;
         case 540: preco = 28000;
         case 541: preco = 150000;
         case 542: preco = 18000;
         case 543: preco = 18000;
         case 545: preco = 35000;
         case 546: preco = 17000;
         case 547: preco = 16000;
         case 549: preco = 16000;
         case 550: preco = 30000;
         case 551: preco = 36000;
         case 554: preco = 20000;
         case 555: preco = 60000;
         case 558: preco = 65000;
         case 559: preco = 70000;
         case 560: preco = 105000;
         case 561: preco = 50000;
         case 562: preco = 86000;
         case 565: preco = 47000;
         case 566: preco = 27000;
         case 567: preco = 32000;
         case 575: preco = 22000;
         case 576: preco = 18500;
         case 579: preco = 38000;
         case 580: preco = 45000;
         case 581: preco = 22500;
         case 585: preco = 15500;
         case 586: preco = 23000;
         case 587: preco = 22000;
         case 589: preco = 16500;
         case 600: preco = 13500;
         case 602: preco = 28500;
         case 603: preco = 50000;
         case 604: preco = 22500;
         case 255: preco = 000;
     }
    return preco;
}
Ficando

pawn Код:
printf("Nome do Carro: %s | Preзo do Carro: %d", GetVehicleNome(playerid), GetVehiclePreco(playerid));

E tб faltando uma funзгo para checar se ele estб em um veнculo, adicione isso.

E sugiro usar esse getVehicleName:

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


Messages In This Thread
[Ajuda] Funзхes para concessionбria. - by DreeH - 11.10.2011, 01:42
Re: [Ajuda] Funзхes para concessionбria. - by Macintosh - 11.10.2011, 01:44
Re: [Ajuda] Funзхes para concessionбria. - by DreeH - 11.10.2011, 01:47
Re: [Ajuda] Funзхes para concessionбria. - by Macintosh - 11.10.2011, 01:49
Re: [Ajuda] Funзхes para concessionбria. - by WLSF - 11.10.2011, 01:51
Re: [Ajuda] Funзхes para concessionбria. - by DreeH - 11.10.2011, 01:52
Re: [Ajuda] Funзхes para concessionбria. - by Macintosh - 11.10.2011, 01:52
Re: [Ajuda] Funзхes para concessionбria. - by Ricop522 - 11.10.2011, 01:55
Re: [Ajuda] Funзхes para concessionбria. - by DreeH - 11.10.2011, 02:04

Forum Jump:


Users browsing this thread: 4 Guest(s)