Advertisement
Guest User

Trucker Job V2.0

a guest
Aug 26th, 2012
1,260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.30 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4.  
  5. #define FILTERSCRIPT
  6. #define COLOR_GREEN 0x33AA33FF
  7. #define COLOR_YELLOW 0xFFFF00FF
  8. #define COLOR_RED 0xFF0606FF
  9.  
  10.  
  11. public OnFilterScriptInit()
  12. {
  13.     print("\n--------------------------------------");
  14.     print(" Trucker Job - Created by Cena44(Timon) ");
  15.     print("--------------------------------------\n");
  16.     CreateVehicle(414, 2512.1653, -2117.0974, 13.4788, 0.0000, 27, 78, 3000);
  17.     CreateVehicle(414, 2506.7500, -2116.7947, 13.4788, 0.0000, 41, 42, 3000);
  18.     CreateVehicle(414, 2482.2327, -2116.6165, 13.4788, 0.0000, 48, 72, 3000);
  19.     CreateVehicle(456, 2463.3999, -2116.1843, 13.5200, 0.0000, 46, 89, 3000);
  20.     CreateVehicle(456, 2457.8191, -2115.6475, 13.5200, 0.0000, 78, 27, 3000);
  21.     CreateVehicle(456, 2488.4919, -2116.3032, 13.5200, 0.0000, 24, 78, 3000);
  22.     CreatePickup(1239, 1, 2485.4292,-2120.2351,13.5469, 0); // Boxer Job
  23.     Create3DTextLabel("Trucks Depot\n{FFFF00}/loadtruck to get load the truck", COLOR_RED, 2485.4292,-2120.2351,13.5469, 15, 0, 1);
  24.     CreatePickup(1239, 1, 2460.3623,-2119.8494,13.5530, 0); // Boxer Job
  25.     Create3DTextLabel("Trucks Depot\n{FFFF00}/loadtruck to get load the truck", COLOR_RED, 2460.3623,-2120.2351,13.5469, 15, 0, 1);
  26.     CreatePickup(1239, 1, 2509.6421,-2120.6365,13.5469, 0); // Boxer Job
  27.     Create3DTextLabel("Trucks Depot\n{FFFF00}/loadtruck to get load the truck", COLOR_RED, 2509.6421,-2120.2351,13.5469, 15, 0, 1);
  28.     return 1;
  29. }
  30.  
  31. CMD:loadtruck(playerid, params[])
  32. {
  33.   if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "You are not driving a truck from the depot.");
  34.   if(!IsPlayerInRangeOfPoint(playerid, 7.5, 2485.4292,-2120.2351,13.5469) && !IsPlayerInRangeOfPoint(playerid, 7.5, 2460.3623,-2119.8494,13.5530)
  35.     && !IsPlayerInRangeOfPoint(playerid, 7.5, 2509.6421,-2120.6365,13.5469))
  36.     {
  37.         SendClientMessage(playerid, COLOR_RED, "You are not near the loading place.");
  38.         return 1;
  39.     }
  40.   {
  41.     ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Welcome to the factory, what would you like to deliver?", "{00B000}Drinks and Food($500) \n{00B000}Clothing($1000) \n{A70000}Drugs($1500) \n{A70000}Illegal Fire Arms($2000)", "Load Truck", "Cancel");
  42.     return 1;
  43.   }
  44.   return 1;
  45. }
  46.  
  47. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  48. {
  49. if(response)// They pressed the first button.
  50.     {
  51.     switch(dialogid)
  52.         {
  53.         case 1:// Our dialog!
  54.             {
  55.             switch(listitem)// Checking which listitem was selected
  56.             {
  57.                 case 0:// The first item listed
  58.                 {
  59.                     if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash to buy this products.");
  60.                     GivePlayerMoney(playerid, -500);
  61.                     SetPlayerCheckpoint(playerid, 2121.4949,-1781.8108,13.5618, 5.0);
  62.                     SendClientMessage(playerid, COLOR_YELLOW, "You have loaded some Food and drinks crates, deliver them to the Well Stacked Pizza Co. to get your pay. (Checkpoint)");
  63.                 }
  64.                 case 1: // The second item listed
  65.                 {
  66.                     if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash to buy this products.");
  67.                     GivePlayerMoney(playerid, -1000);
  68.                     SetPlayerCheckpoint(playerid, 2247.8418,-1661.3953,15.5455, 5.0);
  69.                     SendClientMessage(playerid, COLOR_YELLOW, "You have loaded some Clothes Boxes, deliver them to Binco to get your pay. (Checkpoint)");
  70.                 }
  71.                 case 2: // The third item listed
  72.                 {
  73.                     if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash to buy this products.");
  74.                     GivePlayerMoney(playerid, -1500);
  75.                     SetPlayerCheckpoint(playerid, 2517.2693,-1274.5581,34.9548, 5.0);
  76.                     SendClientMessage(playerid, COLOR_YELLOW, "You have loaded some drug packages, deliver them to the Drug factory to get your pay. (Checkpoint)");
  77.                 }
  78.                  case 3: // The fourth item listed
  79.                 {
  80.                     if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash to buy this products.");
  81.                     GivePlayerMoney(playerid, -2000);
  82.                     SetPlayerCheckpoint(playerid, 1362.9902,-1279.9124,13.6332, 5.0);
  83.                     SendClientMessage(playerid, COLOR_YELLOW, "You have loaded some weapon crates, deliver them to the Ammu-Nation to get your pay. (Checkpoint)");
  84.                 }
  85.             }
  86.             }
  87.     }
  88.     }
  89. return 1;
  90. }
  91.  
  92. public OnPlayerEnterCheckpoint(playerid)
  93. {
  94.     if(!IsPlayerInVehicle(playerid, 2) && !IsPlayerInVehicle(playerid, 3) && !IsPlayerInVehicle(playerid, 4) && !IsPlayerInVehicle(playerid, 1)
  95.      && !IsPlayerInVehicle(playerid, 5) && !IsPlayerInVehicle(playerid, 6))
  96.     {
  97.             SendClientMessage(playerid,COLOR_RED,"You are not in the delivery truck.");
  98.             return 1;
  99.     }
  100.     if(IsPlayerInRangeOfPoint(playerid,5,2121.4949,-1781.8108,13.5618)) // Food and Drinks
  101.         {
  102.              SendClientMessage(playerid, COLOR_GREEN, "You have delivered the products and got payed $1000, good job.");
  103.              GivePlayerMoney(playerid, 1000);
  104.              DisablePlayerCheckpoint(playerid);
  105.         }
  106.     if(IsPlayerInRangeOfPoint(playerid,5,2247.8418,-1661.3953,15.5455)) // Clothing
  107.         {
  108.              SendClientMessage(playerid, COLOR_GREEN, "You have delivered the products and got payed $2000, good job.");
  109.              GivePlayerMoney(playerid, 2000);
  110.              DisablePlayerCheckpoint(playerid);
  111.         }
  112.     if(IsPlayerInRangeOfPoint(playerid,5,2517.2693,-1274.5581,34.9548)) // Drugs
  113.         {
  114.              SendClientMessage(playerid, COLOR_GREEN, "You have delivered the products and got payed $3000, good job.");
  115.              GivePlayerMoney(playerid, 3000);
  116.              DisablePlayerCheckpoint(playerid);
  117.         }
  118.     if(IsPlayerInRangeOfPoint(playerid,5,1362.9902,-1279.9124,13.6332)) // Illegal Fire Arms
  119.         {
  120.              SendClientMessage(playerid, COLOR_GREEN, "You have delivered the products and got payed $4000 and a special weapon with some bullets, good job.");
  121.              GivePlayerMoney(playerid, 4000);
  122.              GivePlayerWeapon(playerid, 24, 50);
  123.              DisablePlayerCheckpoint(playerid);
  124.         }
  125.     return 1;
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement