Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.17 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. /*
  4. //          Configuration
  5. */
  6.  
  7. #define PosX -1584.3655 // Delivery Pos X
  8. #define PosY 94.5996   // Delivery Pos Y
  9. #define PosZ 3.2397   // Delivery Pos Z
  10. #define C_Size 7.0   // Checkpoint size
  11.  
  12. #define MTime 60000 // 10 min
  13.  
  14. #define VAmount 2 // How many models to select
  15.  
  16. #define S_C_Command "/export" // The command to Set the checkpoint again
  17. #define A_C_Command "/abort" // The command to hide the checkpoint (Aborting the mission)
  18.  
  19. #define COLOR_STR 0xFFEEEEFF
  20.  
  21. new Vmodel[] = {
  22. 400, 500, 530, 531
  23. };
  24.  
  25. /*
  26. //          Script begins here!
  27. */
  28. new VehInUse[VAmount];
  29.  
  30. forward Delivery();
  31.  
  32. new VehicleNames[][] = {
  33.     "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",
  34.     "Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",
  35.     "Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",
  36.     "Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",
  37.     "Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",
  38.     "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",
  39.     "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood",
  40.     "Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B",
  41.     "Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain",
  42.     "Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
  43.     "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover",
  44.     "Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",
  45.     "Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer",
  46.     "Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer A","Emperor",
  47.     "Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)",
  48.     "Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
  49.     "Stair Trailer","Boxville","Farm Plow","Utility Trailer"
  50. };
  51.  
  52. public OnFilterScriptInit()
  53. {
  54.     print("\nSF Delivery loaded!");
  55.     SetTimer("Delivery", MTime, true);
  56.     return 1;
  57. }
  58.  
  59. public OnPlayerEnterVehicle(playerid, vehicleid)
  60. {
  61.     new vc = GetVehicleModel(vehicleid);
  62.     for(new i=0; i <= VAmount; i++)
  63.     {
  64.         if(VehInUse[i]==vc)
  65.         {
  66.             SendClientMessageToAll(COLOR_STR, "The San Fierro Export Company is looking for a:");
  67.             SendClientMessageToAll(COLOR_STR, VehicleNames[i - 400]);
  68.             SendClientMessageToAll(COLOR_STR, "So take this or another vehicle of the same model to The San Fierro Export Company");
  69.             SendClientMessageToAll(COLOR_STR, " ");
  70.             new str[128];
  71.             format(str, sizeof(str), "Hint: If the checkpoint disapears, use %s to activate it again.", S_C_Command);
  72.             SendClientMessageToAll(COLOR_STR, str);
  73.             SendClientMessageToAll(COLOR_STR, " ");
  74.             DisablePlayerCheckpoint(playerid);
  75.             SetPlayerCheckpoint(playerid, PosX, PosY, PosZ, C_Size);
  76.         }
  77.     }
  78.     return 1;
  79. }
  80.  
  81. public OnPlayerCommandText(playerid, cmdtext[])
  82. {
  83.     if(strcmp(A_C_Command, cmdtext, true)==0)
  84.     {
  85.         DisablePlayerCheckpoint(playerid);
  86.         return 1;
  87.     }
  88.     if(strcmp(S_C_Command, cmdtext, true)==0)
  89.     {
  90.         DisablePlayerCheckpoint(playerid);
  91.         SetPlayerCheckpoint(playerid, PosX, PosY, PosZ, C_Size);
  92.         return 1;
  93.     }
  94.     return 0;
  95. }
  96.  
  97. public Delivery()
  98. {
  99.     for(new b=0; b <= VAmount; b++) VehInUse[b]=0;
  100.     new mkay=0;
  101.     for(new i=0; i <= VAmount; i++)
  102.     {
  103.         if(VehInUse[i]==0)
  104.         {
  105.             VehInUse[i]=Vmodel[random(sizeof(Vmodel))];
  106.             mkay++;
  107.         }
  108.     }
  109.     if(mkay > 0) SendClientMessageToAll(COLOR_STR, "The San Fierro Export Company is currently looking for:");
  110.     for(mkay=0; mkay < VAmount; mkay++)
  111.     {
  112.         SendClientMessageToAll(COLOR_STR, VehicleNames[VehInUse[mkay] - 400]);
  113.     }
  114.     return 1;
  115. }
  116.  
  117. public OnPlayerEnterCheckpoint(playerid)
  118. {
  119.     if(IsPlayerInAnyVehicle(playerid))
  120.     {
  121.         new vc = GetVehicleModel(GetPlayerVehicleID(playerid));
  122.         for(new i=0; i <= VAmount; i++)
  123.         {
  124.             if(VehInUse[i]==vc)
  125.             {
  126.                 VehInUse[i]=0;
  127.                 SendClientMessageToAll(COLOR_STR, "You have successfully deliverd a:");
  128.                 SendClientMessageToAll(COLOR_STR, VehicleNames[i - 400]);
  129.                 SendClientMessageToAll(COLOR_STR, "To The San Fierro Export Company!.");
  130.             }
  131.         }
  132.     }
  133.     return 1;
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement