pawn Код:
static const VehicleName[212][] =
{
"Landstalker","Bravura","Buffalo","Linerunner","Perennial","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",
"ZR-350","Walton","Regina","Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper",
"Rancher","FBI Rancher","Virgo","Greenwood","Jetmax","Hotring Racer","Sandking","Blista Compact","Police Maverick",
"Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B","Bloodring Banger","Rancher","Super GT",
"Elegant","Journey","Bike","Mountain Bike","Beagle","Cropduster","Stuntplane","Tanker","Road Train","Nebula","Majestic",
"Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV-1000","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 A","Monster B","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","RCCam","Launch","Police Car (LSPD)","Police Car (SFPD)",
"Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A",
"Luggage Trailer B","Stair Trailer","Boxville","Farm Plow","Utility Trailer"
};
CMD:carname(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1) // Edit this out if you like.
{
SendClientMessage(playerid, COLOR_YELLOW, "--------------------------------------------------------------------------------------------------------------------------------");
SendClientMessage(playerid, COLOR_WHITE, "Vehicle Search:");
new string[128];
if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "No keyword specified.");
if(!params[2]) return SendClientMessage(playerid, COLOR_GREY, "Search keyword too short.");
for(new v; v < sizeof(VehicleName); v++)
{
if(strfind(VehicleName[v], params, true) != -1)
{
if(isnull(string)) format(string, sizeof(string), "%s (ID: %d)", VehicleName[v], v+400);
else format(string, sizeof(string), "%s | %s (ID: %d)", string, VehicleName[v], v+400); // Show's the car's ID and Name.
}
}
if(!string[0]) SendClientMessage(playerid, COLOR_GREY, "No results found.");
else if(string[127]) SendClientMessage(playerid, COLOR_GREY, "Too many results found.");
else SendClientMessage(playerid, COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_YELLOW, "--------------------------------------------------------------------------------------------------------------------------------");
}
return 1;
}
// Then Your Command:
CMD:car(playerid,params[])
{
if(DMZone[playerid] == 0)
{
new Float:x,Float:y,Float:z,Float:q,string[70];
static buffalo[12],input[12];
format(buffalo,sizeof(buffalo),"buffalo");
if(sscanf(params,"s",input)) return SendClientMessage(playerid,-1,"Usage: /car [name]");
GetPlayerPos(playerid,x,y,z);
if(strcmp(buffalo,input,true) == 0)
{
CreateVehicle(402, x,y,z,q, 0, 0, 30);
format(string,sizeof(string),"Car id = 402 - Color = 0 - color2 = 0");
SendClientMessage(playerid,-1,string);
}
}
return 1;
}