11.10.2011, 01:42
Oi gente '-'.
Entгo, estou criando um sistema de concessionбria, mas estou com uma dъvida e preciso da ajuda de vocкs.
Criei 2 Callbacks, para pegar o Nome e o Preзo do veнculo que defini nela, mas, nгo tб pegando, digo, 'printando' o nome do veнculo, e o preco, sempre 'printa': 1.
Aн vai o CODE.
Estou usando dessa maneira para teste:
Mas, isto me 'printa'
Se souberem onde estб o 'erro' e como solucionar, fico grato, desde jб, obrigado.
Entгo, estou criando um sistema de concessionбria, mas estou com uma dъvida e preciso da ajuda de vocкs.
Criei 2 Callbacks, para pegar o Nome e o Preзo do veнculo que defini nela, mas, nгo tб pegando, digo, 'printando' o nome do veнculo, e o preco, sempre 'printa': 1.
Aн vai o CODE.
PHP код:
stock GetVehicleNome(playerid)
{
new
vid = GetPlayerVehicleID(playerid),
dreehStr[35]
;
switch(GetVehicleModel(vid))
{
case 400: format(dreehStr, sizeof(dreehStr), "Landstalker");
case 401: format(dreehStr, sizeof(dreehStr), "Bravura");
case 402: format(dreehStr, sizeof(dreehStr), "Buffalo");
case 403: format(dreehStr, sizeof(dreehStr), "Linerunner");
case 404: format(dreehStr, sizeof(dreehStr), "Pereniel");
case 405: format(dreehStr, sizeof(dreehStr), "Sentinel");
case 409: format(dreehStr, sizeof(dreehStr), "Stretch");
case 410: format(dreehStr, sizeof(dreehStr), "Manana");
case 411: format(dreehStr, sizeof(dreehStr), "Infernus");
case 412: format(dreehStr, sizeof(dreehStr), "Voodoo");
case 413: format(dreehStr, sizeof(dreehStr), "Pony");
case 415: format(dreehStr, sizeof(dreehStr), "Cheetah");
case 418: format(dreehStr, sizeof(dreehStr), "Moonbeam");
case 419: format(dreehStr, sizeof(dreehStr), "Esperanto");
case 420: format(dreehStr, sizeof(dreehStr), "Taxi");
case 421: format(dreehStr, sizeof(dreehStr), "Washington");
case 422: format(dreehStr, sizeof(dreehStr), "Bobcat");
case 424: format(dreehStr, sizeof(dreehStr), "BF Injection");
case 426: format(dreehStr, sizeof(dreehStr), "Premier");
case 428: format(dreehStr, sizeof(dreehStr), "Securicar");
case 429: format(dreehStr, sizeof(dreehStr), "Banshee");
case 436: format(dreehStr, sizeof(dreehStr), "Previon");
case 439: format(dreehStr, sizeof(dreehStr), "Stallion");
case 440: format(dreehStr, sizeof(dreehStr), "Rumpo");
case 442: format(dreehStr, sizeof(dreehStr), "Romero");
case 445: format(dreehStr, sizeof(dreehStr), "Admiral");
case 451: format(dreehStr, sizeof(dreehStr), "Turismo");
case 458: format(dreehStr, sizeof(dreehStr), "Solair");
case 459: format(dreehStr, sizeof(dreehStr), "Berkley's RC Van");
case 461: format(dreehStr, sizeof(dreehStr), "PCJ-600");
case 462: format(dreehStr, sizeof(dreehStr), "Faggio");
case 463: format(dreehStr, sizeof(dreehStr), "Freeway");
case 466: format(dreehStr, sizeof(dreehStr), "Glendale");
case 467: format(dreehStr, sizeof(dreehStr), "Oceanic");
case 468: format(dreehStr, sizeof(dreehStr), "Sanchez");
case 474: format(dreehStr, sizeof(dreehStr), "Hermes");
case 475: format(dreehStr, sizeof(dreehStr), "Sabre");
case 477: format(dreehStr, sizeof(dreehStr), "ZR-350");
case 478: format(dreehStr, sizeof(dreehStr), "Walton");
case 479: format(dreehStr, sizeof(dreehStr), "Regina");
case 480: format(dreehStr, sizeof(dreehStr), "Comet");
case 481: format(dreehStr, sizeof(dreehStr), "BMX");
case 482: format(dreehStr, sizeof(dreehStr), "Burrito");
case 483: format(dreehStr, sizeof(dreehStr), "Camper");
case 489: format(dreehStr, sizeof(dreehStr), "Rancher");
case 491: format(dreehStr, sizeof(dreehStr), "Virgo");
case 492: format(dreehStr, sizeof(dreehStr), "Greenwood");
case 495: format(dreehStr, sizeof(dreehStr), "Sandking");
case 496: format(dreehStr, sizeof(dreehStr), "Blista Compact");
case 498: format(dreehStr, sizeof(dreehStr), "Boxville");
case 500: format(dreehStr, sizeof(dreehStr), "Mesa");
case 506: format(dreehStr, sizeof(dreehStr), "Super GT");
case 507: format(dreehStr, sizeof(dreehStr), "Elegant");
case 509: format(dreehStr, sizeof(dreehStr), "Bike");
case 510: format(dreehStr, sizeof(dreehStr), "Mountain Bike");
case 514: format(dreehStr, sizeof(dreehStr), "Tanker");
case 515: format(dreehStr, sizeof(dreehStr), "RoadTrain");
case 516: format(dreehStr, sizeof(dreehStr), "Nebula");
case 517: format(dreehStr, sizeof(dreehStr), "Majestic");
case 518: format(dreehStr, sizeof(dreehStr), "Buccaneer");
case 521: format(dreehStr, sizeof(dreehStr), "FCR-900");
case 522: format(dreehStr, sizeof(dreehStr), "NRG-500");
case 525: format(dreehStr, sizeof(dreehStr), "Tow Truck");
case 526: format(dreehStr, sizeof(dreehStr), "Fortune");
case 527: format(dreehStr, sizeof(dreehStr), "Cadrona");
case 529: format(dreehStr, sizeof(dreehStr), "Willard");
case 533: format(dreehStr, sizeof(dreehStr), "Feltzer");
case 534: format(dreehStr, sizeof(dreehStr), "Remington");
case 535: format(dreehStr, sizeof(dreehStr), "Slamvan");
case 536: format(dreehStr, sizeof(dreehStr), "Blade");
case 540: format(dreehStr, sizeof(dreehStr), "Vincent");
case 541: format(dreehStr, sizeof(dreehStr), "Bullet");
case 542: format(dreehStr, sizeof(dreehStr), "Clover");
case 543: format(dreehStr, sizeof(dreehStr), "Sadler");
case 545: format(dreehStr, sizeof(dreehStr), "Hustler");
case 546: format(dreehStr, sizeof(dreehStr), "Intruder");
case 547: format(dreehStr, sizeof(dreehStr), "Primo");
case 549: format(dreehStr, sizeof(dreehStr), "Tampa");
case 550: format(dreehStr, sizeof(dreehStr), "Sunrise");
case 551: format(dreehStr, sizeof(dreehStr), "Merit");
case 554: format(dreehStr, sizeof(dreehStr), "Yosemite");
case 555: format(dreehStr, sizeof(dreehStr), "Windsor");
case 558: format(dreehStr, sizeof(dreehStr), "Uranus");
case 559: format(dreehStr, sizeof(dreehStr), "Jester");
case 560: format(dreehStr, sizeof(dreehStr), "Jester");
case 561: format(dreehStr, sizeof(dreehStr), "Stratum");
case 562: format(dreehStr, sizeof(dreehStr), "Elegy");
case 565: format(dreehStr, sizeof(dreehStr), "Flash");
case 566: format(dreehStr, sizeof(dreehStr), "Tahoma");
case 567: format(dreehStr, sizeof(dreehStr), "Savanna");
case 575: format(dreehStr, sizeof(dreehStr), "Broadway");
case 576: format(dreehStr, sizeof(dreehStr), "Tornado");
case 579: format(dreehStr, sizeof(dreehStr), "Huntley");
case 580: format(dreehStr, sizeof(dreehStr), "Stafford");
case 581: format(dreehStr, sizeof(dreehStr), "BF-400");
case 585: format(dreehStr, sizeof(dreehStr), "Emperor");
case 586: format(dreehStr, sizeof(dreehStr), "Wayfarer");
case 587: format(dreehStr, sizeof(dreehStr), "Euros");
case 589: format(dreehStr, sizeof(dreehStr), "Club");
case 600: format(dreehStr, sizeof(dreehStr), "Picador");
case 602: format(dreehStr, sizeof(dreehStr), "Alpha");
case 603: format(dreehStr, sizeof(dreehStr), "Phoenix");
case 604: format(dreehStr, sizeof(dreehStr), "Glendale");
case 255: format(dreehStr, sizeof(dreehStr), "Nenhum");
}
return 1;
}
PHP код:
stock GetVehiclePreco(playerid)
{
new
vid = GetPlayerVehicleID(playerid),
dreehStr[7]
;
switch(GetVehicleModel(vid))
{
case 400: format(dreehStr, sizeof(dreehStr), "40000");
case 401: format(dreehStr, sizeof(dreehStr), "15000");
case 402: format(dreehStr, sizeof(dreehStr), "50000");
case 403: format(dreehStr, sizeof(dreehStr), "25000");
case 404: format(dreehStr, sizeof(dreehStr), "12000");
case 405: format(dreehStr, sizeof(dreehStr), "45000");
case 409: format(dreehStr, sizeof(dreehStr), "110000");
case 410: format(dreehStr, sizeof(dreehStr), "10000");
case 411: format(dreehStr, sizeof(dreehStr), "16000");
case 412: format(dreehStr, sizeof(dreehStr), "23000");
case 413: format(dreehStr, sizeof(dreehStr), "30000");
case 415: format(dreehStr, sizeof(dreehStr), "135000");
case 418: format(dreehStr, sizeof(dreehStr), "11000");
case 419: format(dreehStr, sizeof(dreehStr), "13500");
case 420: format(dreehStr, sizeof(dreehStr), "11000");
case 421: format(dreehStr, sizeof(dreehStr), "36000");
case 422: format(dreehStr, sizeof(dreehStr), "18000");
case 424: format(dreehStr, sizeof(dreehStr), "14000");
case 426: format(dreehStr, sizeof(dreehStr), "30000");
case 428: format(dreehStr, sizeof(dreehStr), "90000");
case 429: format(dreehStr, sizeof(dreehStr), "75000");
case 436: format(dreehStr, sizeof(dreehStr), "12000");
case 439: format(dreehStr, sizeof(dreehStr), "14500");
case 440: format(dreehStr, sizeof(dreehStr), "35000");
case 442: format(dreehStr, sizeof(dreehStr), "25000");
case 445: format(dreehStr, sizeof(dreehStr), "28000");
case 451: format(dreehStr, sizeof(dreehStr), "150000");
case 458: format(dreehStr, sizeof(dreehStr), "13500");
case 459: format(dreehStr, sizeof(dreehStr), "23000");
case 461: format(dreehStr, sizeof(dreehStr), "28000");
case 462: format(dreehStr, sizeof(dreehStr), "7000");
case 463: format(dreehStr, sizeof(dreehStr), "12000");
case 466: format(dreehStr, sizeof(dreehStr), "22500");
case 467: format(dreehStr, sizeof(dreehStr), "22500");
case 468: format(dreehStr, sizeof(dreehStr), "17000");
case 474: format(dreehStr, sizeof(dreehStr), "14500");
case 475: format(dreehStr, sizeof(dreehStr), "24000");
case 477: format(dreehStr, sizeof(dreehStr), "78000");
case 478: format(dreehStr, sizeof(dreehStr), "23000");
case 479: format(dreehStr, sizeof(dreehStr), "23000");
case 480: format(dreehStr, sizeof(dreehStr), "105000");
case 481: format(dreehStr, sizeof(dreehStr), "5000");
case 482: format(dreehStr, sizeof(dreehStr), "30000");
case 483: format(dreehStr, sizeof(dreehStr), "15000");
case 489: format(dreehStr, sizeof(dreehStr), "43000");
case 491: format(dreehStr, sizeof(dreehStr), "29000");
case 492: format(dreehStr, sizeof(dreehStr), "26000");
case 495: format(dreehStr, sizeof(dreehStr), "45000");
case 496: format(dreehStr, sizeof(dreehStr), "19000");
case 498: format(dreehStr, sizeof(dreehStr), "45000");
case 500: format(dreehStr, sizeof(dreehStr), "27000");
case 506: format(dreehStr, sizeof(dreehStr), "125000");
case 507: format(dreehStr, sizeof(dreehStr), "30000");
case 509: format(dreehStr, sizeof(dreehStr), "1500");
case 510: format(dreehStr, sizeof(dreehStr), "8000");
case 514: format(dreehStr, sizeof(dreehStr), "35000");
case 515: format(dreehStr, sizeof(dreehStr), "45000");
case 516: format(dreehStr, sizeof(dreehStr), "18000");
case 517: format(dreehStr, sizeof(dreehStr), "20000");
case 518: format(dreehStr, sizeof(dreehStr), "23000");
case 521: format(dreehStr, sizeof(dreehStr), "45000");
case 522: format(dreehStr, sizeof(dreehStr), "105000");
case 525: format(dreehStr, sizeof(dreehStr), "11000");
case 526: format(dreehStr, sizeof(dreehStr), "12000");
case 527: format(dreehStr, sizeof(dreehStr), "11000");
case 529: format(dreehStr, sizeof(dreehStr), "14000");
case 533: format(dreehStr, sizeof(dreehStr), "35000");
case 534: format(dreehStr, sizeof(dreehStr), "20000");
case 535: format(dreehStr, sizeof(dreehStr), "35000");
case 536: format(dreehStr, sizeof(dreehStr), "24000");
case 540: format(dreehStr, sizeof(dreehStr), "28000");
case 541: format(dreehStr, sizeof(dreehStr), "150000");
case 542: format(dreehStr, sizeof(dreehStr), "18000");
case 543: format(dreehStr, sizeof(dreehStr), "18000");
case 545: format(dreehStr, sizeof(dreehStr), "35000");
case 546: format(dreehStr, sizeof(dreehStr), "17000");
case 547: format(dreehStr, sizeof(dreehStr), "16000");
case 549: format(dreehStr, sizeof(dreehStr), "16000");
case 550: format(dreehStr, sizeof(dreehStr), "30000");
case 551: format(dreehStr, sizeof(dreehStr), "36000");
case 554: format(dreehStr, sizeof(dreehStr), "20000");
case 555: format(dreehStr, sizeof(dreehStr), "60000");
case 558: format(dreehStr, sizeof(dreehStr), "65000");
case 559: format(dreehStr, sizeof(dreehStr), "70000");
case 560: format(dreehStr, sizeof(dreehStr), "105000");
case 561: format(dreehStr, sizeof(dreehStr), "50000");
case 562: format(dreehStr, sizeof(dreehStr), "86000");
case 565: format(dreehStr, sizeof(dreehStr), "47000");
case 566: format(dreehStr, sizeof(dreehStr), "27000");
case 567: format(dreehStr, sizeof(dreehStr), "32000");
case 575: format(dreehStr, sizeof(dreehStr), "22000");
case 576: format(dreehStr, sizeof(dreehStr), "18500");
case 579: format(dreehStr, sizeof(dreehStr), "38000");
case 580: format(dreehStr, sizeof(dreehStr), "45000");
case 581: format(dreehStr, sizeof(dreehStr), "22500");
case 585: format(dreehStr, sizeof(dreehStr), "15500");
case 586: format(dreehStr, sizeof(dreehStr), "23000");
case 587: format(dreehStr, sizeof(dreehStr), "22000");
case 589: format(dreehStr, sizeof(dreehStr), "16500");
case 600: format(dreehStr, sizeof(dreehStr), "13500");
case 602: format(dreehStr, sizeof(dreehStr), "28500");
case 603: format(dreehStr, sizeof(dreehStr), "50000");
case 604: format(dreehStr, sizeof(dreehStr), "22500");
case 255: format(dreehStr, sizeof(dreehStr), "000");
}
return 1;
}
PHP код:
printf("Nome do Carro: %s | Preзo do Carro: %d", GetVehicleNome(playerid), GetVehiclePreco(playerid));
PHP код:
Nome do Carro: | Preзo do Carro: 1