Advertisement
Shiny_

Untitled

Aug 3rd, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.31 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4. new VehicleCmdNames[212][32] =
  5. {
  6.     "/Landstalker", "/Bravura", "/Buffalo", "/Linerunner", "/Pereniel",
  7.     "/Sentinel", "/Dumper", "/Firetruck", "/Trashmaster", "/Stretch",
  8.     "/Manana", "/Infernus", "/Voodoo", "/Pony", "/Mule",
  9.     "/Cheetah", "/Ambulance", "/Leviathan", "/Moonbeam", "/Esperanto",
  10.     "/Taxi", "/Washington", "/Bobcat", "/Mr Whoopee", "/BF Injection",
  11.     "/Hunter", "/Premier", "/Enforcer", "/Securicar", "/Banshee",
  12.     "/Predator", "/Bus", "/Rhino", "/Barracks", "/Hotknife",
  13.     "/Trailer", "/Previon", "/Coach", "/Cabbie", "/Stallion",
  14.     "/Rumpo", "/RC Bandit", "/Romero", "/Packer", "/Monster",
  15.     "/Admiral", "/Squalo", "/Seasparrow", "/Pizzaboy", "/Tram",
  16.     "/Trailer", "/Turismo", "/Speeder", "/Reefer", "/Tropic",
  17.     "/Flatbed", "/Yankee", "/Caddy", "/Solair", "/Berkley's RC Van",
  18.     "/Skimmer", "/PCJ-600", "/Faggio", "/Freeway", "/RC Baron",
  19.     "/RC Raider", "/Glendale", "/Oceanic", "/Sanchez", "/Sparrow",
  20.     "/Patriot", "/Quad", "/Coastguard", "/Dinghy", "/Hermes",
  21.     "/Sabre", "/Rustler", "/ZR 350", "/Walton", "/Regina",
  22.     "/Comet", "/BMX", "/Burrito", "/Camper", "/Marquis",
  23.     "/Baggage", "/Dozer", "/Maverick", "/News Chopper", "/Rancher",
  24.     "/FBI Rancher", "/Virgo", "/Greenwood", "/Jetmax", "/Hotring",
  25.     "/Sandking", "/Blista Compact", "/Police Maverick", "/Boxville", "/Benson",
  26.     "/Mesa", "/RC Goblin", "/Hotring Racer", "/Hotring Racer", "/Bloodring Banger",
  27.     "/Rancher", "/Super GT", "/Elegant", "/Journey", "/Bike",
  28.     "/Mountain Bike", "/Beagle", "/Cropdust", "/Stunt", "/Tanker",
  29.     "/RoadTrain", "/Nebula", "/Majestic", "/Buccaneer", "/Shamal",
  30.     "/Hydra", "/FCR", "/NRG", "/HPV1000", "/Cement Truck",
  31.     "/Tow Truck", "/Fortune", "/Cadrona", "/FBI Truck", "/Willard",
  32.     "/Forklift", "/Tractor", "/Combine", "/Feltzer", "/Remington",
  33.     "/Slamvan", "/Blade", "/Freight", "/Streak", "/Vortex",
  34.     "/Vincent", "/Bullet", "/Clover", "/Sadler", "/Firetruck",
  35.     "/Hustler", "/Intruder", "/Primo", "/Cargobob", "/Tampa",
  36.     "/Sunrise", "/Merit", "/Utility", "/Nevada", "/Yosemite",
  37.     "/Windsor", "/Monstera", "/Monsterb", "/Uranus", "/Jester",
  38.     "/Sultan", "/Stratum", "/Elegy", "/Raindance", "/RC Tiger",
  39.     "/Flash", "/Tahoma", "/Savanna", "/Bandito", "/Freight",
  40.     "/Trailer", "/Kart", "/Mower", "/Duneride", "/Sweeper",
  41.     "/Broadway", "/Tornado", "/AT-400", "/DFT-30", "/Huntley",
  42.     "/Stafford", "/BF-400", "/Newsvan", "/Tug", "/Trailer2",
  43.     "/Emperor", "/Wayfarer", "/Euros", "/Hotdog", "/Club",
  44.     "/Trailer3", "/Trailer4", "/Andromeda", "/Dodo", "/RC Cam",
  45.     "/Launch", "/Police Car (LSPD)", "/Police Car (SFPD)", "/Police Car (LVPD)", "/Police Ranger",
  46.     "/Picador", "/S.W.A.T. Van", "/Alpha", "/Phoenix", "/Glendale",
  47.     "/Sadler", "/Luggage Trailer", "/Luggage Trailer2", "/Stair Trailer", "/Boxville",
  48.     "/Farm Plow", "/Utility Trailer"
  49. };
  50.  
  51. // public OnPlayerCommandReceived(playerid, cmdtext[])
  52. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  53. {
  54.     for(new i=0; i<sizeof(VehicleCmdNames); i++)
  55.     {
  56.         // if(!strcmp (VehicleCmdNames[i], cmdtext, true))
  57.         if(strfind(VehicleCmdNames[i], cmdtext) != -1)
  58.         {
  59.             // switch(i+400)
  60.             // {
  61.                 // case 425, 432, 441, 406, 449, 464, 465, 501, 520, 537, 538, 564, 569, 570, 590, 591, 594, 606 .. 608, 610, 611: return SendClientMessage(playerid, -1, "Tego pojazdu nie można zespawnować!");
  62.             // }
  63.             new vid = SpawnVehicle_InfrontOfPlayer2(playerid, i+400, -1, -1);
  64.            
  65.             LinkVehicleToInterior(vid, GetPlayerInterior(playerid));
  66.             SetVehicleVirtualWorld(vid, GetPlayerVirtualWorld(playerid));
  67.             new string2[64];
  68.             format(string2, sizeof(string2), "Tworzysz %s", VehicleCmdNames[i]);
  69.             SendClientMessage(playerid, -1, string2);
  70.             PutPlayerInVehicle(playerid, vid, 0);
  71.             return false;
  72.         }
  73.     }
  74.     return true;
  75. }
  76.  
  77. SpawnVehicle_InfrontOfPlayer2(playerid, vehiclemodel, color1, color2)
  78. {
  79.     new Float:x,Float:y,Float:z;
  80.     new Float:facing;
  81.     new Float:distance;
  82.    
  83.     GetPlayerPos(playerid, x, y, z);
  84.     GetPlayerFacingAngle(playerid, facing);
  85.    
  86.     new Float:size_x,Float:size_y,Float:size_z;
  87.     GetVehicleModelInfo(vehiclemodel, VEHICLE_MODEL_INFO_SIZE, size_x, size_y, size_z);
  88.    
  89.     distance = size_x + 0.5;
  90.    
  91.     x += (distance * floatsin(-facing, degrees));
  92.     y += (distance * floatcos(-facing, degrees));
  93.    
  94.     facing += 90.0;
  95.     if(facing > 360.0) facing -= 360.0;
  96.    
  97.     return CreateVehicle(vehiclemodel, x, y, z + (size_z * 0.25), facing, color1, color2, -1);
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement