PDA

View Full Version : Car Command


Alex_Obando
02/09/2011, 08:25 PM
Hello I have this command:


CMD:vhe(playerid, params[])
{
new stringo[124]
if(sscanf(params, "s", stringo))
{

if(IsPlayerInEvent[playerid] == 1)
{

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


}


So basically I want to add that when he spawns the specific car say " You spawned % car" (With the carname)
Although I want to add the car spawner, so when the player spawns the car put the player in the car.

Thanks

Kyle_Olsen
02/09/2011, 08:32 PM
Use a stock like this to get the vehicle names from the model.
new VehicleNamesS[][] = {
"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","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","ZR3 50","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","Laddertruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster","Monster","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 (LSPD)","Police Car (SFPD)","Police Car (LVPD)","Police Ranger",
"Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer","Luggage Trailer","Stair Trailer","Boxville","Farm Plow","Utility Trailer"
};
GetVehicleName(modelid,name[],namesize)
{
if(modelid < 400 || modelid > 611) return 0;
modelid -= 400;
for(new i = 0, len = strlen(VehicleNamesS[modelid]); i < len && i < namesize; i++)
name[i] = VehicleNamesS[modelid][i];
return 1;
}

And you can use the PutPlayerInVehicle(); function to put a player in the vehicle.

Alex_Obando
02/09/2011, 08:34 PM
How to make the car spawner o,o?