Advertisement
Guest User

Yossef_Jones_Fedex

a guest
Nov 15th, 2013
539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.73 KB | None | 0 0
  1. #include <a_samp>
  2. #include <streamer>
  3. #include <zcmd>
  4. #include <sscanf2>
  5.  
  6.  
  7.  
  8. #define FILTERSCRIPT
  9. #define COLOR_GREEN 0x33AA33FF
  10. #define COLOR_YELLOW 0xFFFF00FF
  11. #define COLOR_RED 0xFF0606FF
  12.  
  13.  
  14. public OnFilterScriptInit()
  15. {
  16.     print("\n--------------------------------------");
  17.     print(" Fedex Job By Yossef Jones Loaded succefully) ");
  18.     print("--------------------------------------\n");
  19.  
  20.     CreateVehicle(498,2003.6852,-2062.4607,13.6162,272.4785,175, 1, 3000); //
  21.     CreateVehicle(498,2003.5945,-2072.5898,13.6143,271.0529,175, 1, 3000); //
  22.     CreateVehicle(498,2002.6908,-2083.2813,13.6147,274.0793,175, 1, 3000); //
  23.     CreateVehicle(498,2002.6356,-2094.5154,13.6129,270.5332,175, 1, 3000); //
  24.     CreateVehicle(498,2056.2456,-2062.3354,13.6143,88.4719,175, 1, 3000); //
  25.     CreateVehicle(498,2057.6702,-2073.3960,13.6138,91.3654,175, 1, 3000); //
  26.     CreateVehicle(498,2057.0466,-2083.6025,13.6147,92.1287,175, 1, 3000); //
  27.     CreateVehicle(498,2056.8689,-2094.3564,13.6162,92.3437,175, 1, 3000); //
  28.     CreatePickup(1239, 1, 2043.6608,-2059.1238,13.5469, 0); // Boxer Job
  29.     Create3DTextLabel("Fedex Depot\n{FFFF00}/loadfedex to get load the truck", COLOR_RED, 2043.6608,-2059.1238,13.5469, 15, 0, 1);
  30.     CreatePickup(1239, 1, 2017.8900,-2059.8333,13.5469, 0); // Boxer Job
  31.     Create3DTextLabel("Fedex Depot\n{FFFF00}/loadfedex to get load the truck", COLOR_RED, 2017.8900,-2059.8333,13.5469, 15, 0, 1);
  32.     CreatePickup(1239, 1, 2031.0453,-2054.4619,13.5469, 0); // Boxer Job
  33.     Create3DTextLabel("Fedex Depot\n{FFFF00}/loadfedex to get load the truck", COLOR_RED, 2031.0453,-2054.4619,13.5469, 15, 0, 1);
  34.     return 1;
  35. }
  36.  
  37. CMD:loadfedex(playerid, params[])
  38. {
  39.     if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "You are not driving a Fedex truck from the depot.");
  40.     if(!IsPlayerInRangeOfPoint(playerid, 7.5, 2043.6608,-2059.1238,13.5469) && !IsPlayerInRangeOfPoint(playerid, 7.5, 2017.8900,-2059.8333,13.5469)
  41.     && !IsPlayerInRangeOfPoint(playerid, 7.5, 2031.0453,-2054.4619,13.5469))
  42.     {
  43.         SendClientMessage(playerid, COLOR_RED, "You are not near the loading place.");
  44.         return 1;
  45.     }
  46.     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");
  47.     return 1;
  48. }
  49.  
  50. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  51. {
  52. if(response)// They pressed the first button.
  53.     {
  54.     switch(dialogid)
  55.         {
  56.         case 1:// Our dialog!
  57.             {
  58.             switch(listitem)// Checking which listitem was selected
  59.             {
  60.                 case 0:// The first item listed
  61.                 {
  62.                     if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash to buy this products.");
  63.                     GivePlayerCash(playerid, -500);
  64.                     SetPlayerCheckpoint(playerid, 2121.4949,-1781.8108,13.5618, 5.0);
  65.                     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)");
  66.                 }
  67.                 case 1: // The second item listed
  68.                 {
  69.                     if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash to buy this products.");
  70.                     GivePlayerCash(playerid, -1000);
  71.                     SetPlayerCheckpoint(playerid, 2247.8418,-1661.3953,15.5455, 5.0);
  72.                     SendClientMessage(playerid, COLOR_YELLOW, "You have loaded some Clothes Boxes, deliver them to Binco to get your pay. (Checkpoint)");
  73.                 }
  74.                 case 2: // The third item listed
  75.                 {
  76.                     if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash to buy this products.");
  77.                     GivePlayerCash(playerid, -1500);
  78.                     SetPlayerCheckpoint(playerid, 2517.2693,-1274.5581,34.9548, 5.0);
  79.                     SendClientMessage(playerid, COLOR_YELLOW, "You have loaded some drug packages, deliver them to the Drug factory to get your pay. (Checkpoint)");
  80.                 }
  81.                 case 3: // The fourth item listed
  82.                 {
  83.                     if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash to buy this products.");
  84.                     GivePlayerCash(playerid, -2000);
  85.                     SetPlayerCheckpoint(playerid, 1362.9902,-1279.9124,13.6332, 5.0);
  86.                     SendClientMessage(playerid, COLOR_YELLOW, "You have loaded some weapon crates, deliver them to the Ammu-Nation to get your pay. (Checkpoint)");
  87.                 }
  88.             }
  89.             }
  90.     }
  91.     }
  92. return 1;
  93. }
  94.  
  95. public OnPlayerEnterCheckpoint(playerid)
  96. {
  97.     if(!IsPlayerInVehicle(playerid, 2) && !IsPlayerInVehicle(playerid, 3) && !IsPlayerInVehicle(playerid, 4) && !IsPlayerInVehicle(playerid, 1)
  98.      && !IsPlayerInVehicle(playerid, 5) && !IsPlayerInVehicle(playerid, 6) && !IsPlayerInVehicle(playerid, 7) && !IsPlayerInVehicle(playerid, 8))
  99.     {
  100.             SendClientMessage(playerid,COLOR_RED,"You are not in the delivery truck.");
  101.             return 1;
  102.     }
  103.     if(IsPlayerInRangeOfPoint(playerid,5,2121.4949,-1781.8108,13.5618)) // Food and Drinks ...(legal)
  104.         {
  105.              SendClientMessage(playerid, COLOR_GREEN, "You have delivered the products and got payed $1000, good job.");
  106.              SendClientMessage(playerid, COLOR_GREEN, "Get Back The Truck To  Fedex Warehouse as Fast as you can !");
  107.              GivePlayerCash(playerid, 1000);
  108.              DisablePlayerCheckpoint(playerid);
  109.         }
  110.     if(IsPlayerInRangeOfPoint(playerid,5,2247.8418,-1661.3953,15.5455)) // Clothing ...(legal)
  111.         {
  112.              SendClientMessage(playerid, COLOR_GREEN, "You have delivered the products and got payed $2000, good job.");
  113.              SendClientMessage(playerid, COLOR_GREEN, "Get Back The Truck To Fedex Warehouse as Fast as you can !");
  114.              GivePlayerCash(playerid, 2000);
  115.              DisablePlayerCheckpoint(playerid);
  116.         }
  117.     if(IsPlayerInRangeOfPoint(playerid,5,2517.2693,-1274.5581,34.9548)) // Drugs ...(illegal)
  118.         {
  119.              SendClientMessage(playerid, COLOR_GREEN, "You have delivered the products and got payed $3000, good job.");
  120.              SendClientMessage(playerid, COLOR_GREEN, "Get Back The Truck To  Fedex Warehouse as Fast as you can !");
  121.              GivePlayerCash(playerid, 3000);
  122.              DisablePlayerCheckpoint(playerid);
  123.         }
  124.     if(IsPlayerInRangeOfPoint(playerid,5,1362.9902,-1279.9124,13.6332)) // Illegal Fire Arms ... (illegal)
  125.         {
  126.              
  127.              SendClientMessage(playerid, COLOR_GREEN, "You have delivered the products and got payed $4000 and a special weapon with some bullets, good job.");
  128.              SendClientMessage(playerid, COLOR_GREEN, "Get Back The Truck To  Fedex Warehouse as Fast as you can !");
  129.              GivePlayerCash(playerid, 4000);
  130.              GivePlayerWeaponEx(playerid, 22, 50);
  131.              DisablePlayerCheckpoint(playerid);
  132.         }
  133.     return 1;
  134. }
  135.  
  136.  
  137. //============[Stock]==========
  138. stock GivePlayerCash(playerid, money)
  139. {
  140.     SetPVarInt(playerid, "Cash", GetPVarInt(playerid, "Cash")+money);
  141.     GivePlayerMoney(playerid, money);
  142.     return 1;
  143. }
  144.  
  145. stock ResetPlayerCash(playerid)
  146. {
  147.  SetPVarInt(playerid, "Cash", 0);
  148.     return 1;
  149. }
  150.  
  151. stock GivePlayerWeaponEx(playerid, gun, ammo)
  152. {
  153.     new weapons[13], ammovar[13];
  154.  
  155.     for(new i = 0; i < 13; i++)
  156.     {
  157.         GetPlayerWeaponData(playerid, i, weapons[i], ammovar[i]);
  158.     }
  159.  
  160.     ResetPlayerWeapons(playerid);
  161.  
  162.     for(new i = 0; i < 13; i++)
  163.     {
  164.         if(i != 4) GivePlayerWeapon(playerid, weapons[i], ammovar[i]);//
  165.     }
  166.  
  167.     GivePlayerWeapon(playerid, gun, ammo);
  168. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement