11.04.2014, 02:56
Esse e funcional
ou mais simples
pawn Код:
#define DIALOG_CARS 231
pawn Код:
if(!strcmp(cmdtext, "/carro", true))
{
SendClientMessage(playerid, 0xFFFFFFFF, "[INFO] Digite seu Carro");
ShowPlayerDialog(playerid,DIALOG_CARS,DIALOG_STYLE_INPUT,"Carros","Digite id do seu carro abaixo:","Carro","Sair");
return 1;
}
pawn Код:
if(dialogid == DIALOG_CARS)
{
if(!response)
return SendClientMessage(playerid, 0xFFFFFFFF, "[INFO] Vocк cancelou a seleзгo de carros");
if(!strval(inputtext))
return SendClientMessage(playerid, 0xFFFFFFFF, "[INFO] Vocк cancelou a seleзгo de carros");
if(!IsValidVehicle(strval(inputtext)))
return SendClientMessage(playerid, 0xFFFFFFFF, "[ERRO] Carro Invбlido");
format(message, sizeof(message), "Vocк colocou o carro %s(%i)", NomeCarros[strval(inputtext)-400],strval(inputtext));
SendClientMessage(playerid, 0xFFFFFFFF, message);
GetPlayerPos(playerid, x, y, z);
PutPlayerInVehicle(playerid,CreateVehicle(strval(inputtext),x, y, z, 82,0,1,60), 0);
PlayerPlaySound(playerid,1133,0.0,0.0,0.0); //sound
return 1;
}
pawn Код:
new
NomeCarros[][] =
{
"Landstalker",
"Bravura",
"Buffalo",
"Linerunner",
"Pereniel",
"Sentinel",
"Dumper",
"Firetruck",
"Trashmaster",
"Stretch",
"Manana",
"Infernus",
"Voodoo",
"Pony",
"Mule",
"Cheetah",
"Ambulance",
"Leviathan",
"Moonbeam",
"Esperanto",
"Taxi",
"Washington",
"Bobcat",
"Mr Whoopee",
"BF Injection",
"Hunter",
"Premier",
"Enforcer",
"Securicar",
"Banshee",
"Predator",
"Bus",
"Rhino",
"Barracks",
"Hotknife",
"Trailer",
"Previon",
"Coach",
"Cabbie",
"Stallion",
"Rumpo",
"RC Bandit",
"Romero",
"Packer",
"Monster Truck",
"Admiral",
"Squalo",
"Seasparrow",
"Pizzaboy",
"Tram",
"Trailer",
"Turismo",
"Speeder",
"Reefer",
"Tropic",
"Flatbed",
"Yankee",
"Caddy",
"Solair",
"Berkley's RC Van",
"Skimmer",
"PCJ-600",
"Faggio",
"Freeway",
"RC Baron",
"RC Raider",
"Glendale",
"Oceanic",
"Sanchez",
"Sparrow",
"Patriot",
"Quad",
"Coastguard",
"Dinghy",
"Hermes",
"Sabre",
"Rustler",
"ZR-350",
"Walton",
"Regina",
"Comet",
"BMX",
"Burrito",
"Camper",
"Marquis",
"Baggage",
"Dozer",
"Maverick",
"News Chopper",
"Rancher",
"FBI Rancher",
"Virgo",
"Greenwood",
"Jetmax",
"Hotring",
"Sandking",
"Blista Compact",
"Police Maverick",
"Boxville",
"Benson",
"Mesa",
"RC Goblin",
"Hotring Racer",
"Hotring Racer",
"Bloodring Banger",
"Rancher",
"Super GT",
"Elegant",
"Journey",
"Bike",
"Mountain Bike",
"Beagle",
"Cropdust",
"Stunt",
"Tanker",
"RoadTrain",
"Nebula",
"Majestic",
"Buccaneer",
"Shamal",
"Hydra",
"FCR-900",
"NRG-500",
"HPV1000",
"Cement Truck",
"Tow Truck",
"Fortune",
"Cadrona",
"FBI Truck",
"Willard",
"Forklift",
"Tractor",
"Combine",
"Feltzer",
"Remington",
"Slamvan",
"Blade",
"Freight",
"Streak",
"Vortex",
"Vincent",
"Bullet",
"Clover",
"Sadler",
"Firetruck",
"Hustler",
"Intruder",
"Primo",
"Cargobob",
"Tampa",
"Sunrise",
"Merit",
"Utility",
"Nevada",
"Yosemite",
"Windsor",
"Monster Truck",
"Monster Truck",
"Uranus",
"Jester",
"Sultan",
"Stratum",
"Elegy",
"Raindance",
"RC Tiger",
"Flash",
"Tahoma",
"Savanna",
"Bandito",
"Freight",
"Trailer",
"Kart",
"Mower",
"Duneride",
"Sweeper",
"Broadway",
"Tornado",
"AT-400",
"DFT-30",
"Huntley",
"Stafford",
"BF-400",
"Newsvan",
"Tug",
"Trailer",
"Emperor",
"Wayfarer",
"Euros",
"Hotdog",
"Club",
"Trailer",
"Trailer",
"Andromada",
"Dodo",
"RC Cam",
"Launch",
"Police Car (LS)",
"Police Car (SF)",
"Police Car (LV)",
"Police Ranger",
"Picador",
"S.W.A.T. Van",
"Alpha",
"Phoenix",
"Glendale",
"Sadler",
"Luggage Trailer",
"Luggage Trailer",
"Stair Trailer",
"Boxville",
"Farm Plow",
"Utility Trailer"
};
pawn Код:
stock IsValidVehicle(modelid)
{
switch(modelid)
{
case 581, 523, 462, 521, 463, 522, 461, 448, 468, 586, 509,
481, 510, 472, 473, 493, 595, 484, 430, 453,
452, 446, 454, 445, 602, 416, 485, 568, 429, 433, 499, 424, 536, 496,
504, 422, 609, 498, 401, 575, 518,
402, 541, 482, 431, 438, 457, 527, 483, 524, 415, 542, 589, 437, 532,
480, 596, 599, 597, 598, 578, 486,
507, 562, 585, 427, 419, 587, 490, 528, 533, 544, 407, 565, 455, 530,
526, 466, 604, 492, 474, 588, 434,
502, 503, 494, 579, 545, 411, 546, 559, 508, 571, 400, 403, 517, 410,
551, 500, 418, 572, 423, 414, 516,
582, 467, 443, 470, 404, 514, 603, 600, 413, 426, 436, 547, 489, 441,
594, 564, 515, 479, 534, 432, 505,
442, 440, 475, 543, 605, 495, 567, 428, 405, 535, 458, 580, 439, 561,
409, 560, 506, 601, 574, 566, 549,
420, 459, 576, 525, 531, 408, 583, 451, 558, 552, 540, 491, 412, 478,
421, 529, 456, 554, 477, 548, 425,
417, 487, 497, 563, 501, 465, 447, 469, 488, 406, 573, 444, 556, 557,
592, 577, 511, 512, 593, 520, 553,
464, 476, 519, 460, 513, 539, 471, 435, 450, 591, 606, 607, 610, 584,
608, 611, 590, 449:
return modelid;
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/veh", true) == 0 || strcmp(cmd, "/criarveiculo", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new nome[24];
GetPlayerName(playerid, nome, sizeof nome);
if (PlayerInfo[playerid][pAdmin] > 5000)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /veiculo [carid] [color1] [color2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, " Vehicle Number can't be below 400 ou above 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /veiculo [carid] [color1] [color2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, " Color Number can't be below 0 ou above 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USO: /veiculo [carid] [color1] [color2]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, " Color Number can't be below 0 ou above 126 !"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2,60000);
CreatedCars[CreatedCar] = carid;
CreatedCar ++;
format(string, sizeof(string), " Veнculo spawnado de nъmero %d;", carid);
SendClientMessage(playerid, COLOR_GREY, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Autorizaзгo insuficiente !");
return 1;
}
}
return 1;
}