Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.06 KB | None | 0 0
  1. if(GetPVarType(playerid, "shipperDestinationId1") && mainJobsLocked[MAINJOB_SHIPPER] == false)
  2. {
  3. new houseId = GetPVarInt(playerid, "shipperHouseId1");
  4. if(IsPlayerInRangeOfPoint(playerid, 3.0, characterHouse[houseId][exteriorX], characterHouse[houseId][exteriorY],
  5. characterHouse[houseId][exteriorZ]))
  6. {
  7. new itemId = GetPVarInt(playerid, "shipperItemId1"),
  8. itemAmountLeft = GetPVarInt(playerid, "shipperItemAmountLeft1");
  9. if(characterInventory[playerid][MAX_INVENTORY_ITEMS][cItemModel] == businessAvailableItem[itemId][cItemModel])
  10. {
  11. if(characterInventory[playerid][MAX_INVENTORY_ITEMS][cNumberOfUses] <= 0)
  12. {
  13. switch(characterInventory[playerid][MAX_INVENTORY_ITEMS][cItemModel])
  14. {
  15. case ITEM_TYPE_PHONE, ITEM_TYPE_PORTABLE_RADIO:
  16. {}
  17. default: return msg(playerid, COLOR_RED, "Vat pham khong con de co the giao.");
  18. }
  19. }
  20. inventoryRemoveCharacterItem(playerid, MAX_INVENTORY_ITEMS);
  21. updateInventoryAttachments(playerid);
  22. if((itemAmountLeft - 1) == 0)
  23. {
  24. new itemAmount = GetPVarInt(playerid, "shipperItemAmount1"),
  25. thistime = gettime(),
  26. orderTimestamp = GetPVarInt(playerid, "shipperOrderTimestamp1"),
  27. Packed:string[128];
  28. new original = businessDefaultItemPrice[itemId] * itemAmount,
  29. work = randomEx(24, 32) + floatround(itemAmount*4),
  30. _tips = floatround((60/(thistime-orderTimestamp))*4.5);
  31. format(string, sizeof(string), "Shipping Order #1: Ban da giao hang cho ngoi nha so '%d', nhan duoc tien goc '%d$'.",
  32. houseId, original);
  33. msg(playerid, COLOR_GREEN, string);
  34. format(string, sizeof(string), "Shipping Order #1: Tien cong '%d$', tien tips '%d$' se duoc cong vao tai khoan ngan hang cua ban.", work, _tips);
  35. msg(playerid, COLOR_GREEN, string);
  36. _givePlayerMoney(playerid, original);
  37. givePlayerJobDeposits(playerid, work+_tips, 1);
  38.  
  39. removePlayerDestination(playerid, GetPVarInt(playerid, "shipperDestinationId1"));
  40. DeletePVar(playerid, "shipperItemId1");
  41. DeletePVar(playerid, "shipperItemAmount1");
  42. DeletePVar(playerid, "shipperDestinationId1");
  43. DeletePVar(playerid, "shipperHouseId1");
  44. DeletePVar(playerid, "shipperItemAmountLeft1");
  45. DeletePVar(playerid, "shipperOrderTimestamp1");
  46. }
  47. SetPVarInt(playerid, "shipperItemAmountLeft1", itemAmountLeft-1);
  48. return 1;
  49. }
  50. else if(characterInventory[playerid][MAX_INVENTORY_ITEMS+1][cItemModel] == businessAvailableItem[itemId][cItemModel])
  51. {
  52. inventoryRemoveCharacterItem(playerid, MAX_INVENTORY_ITEMS+1);
  53. updateInventoryAttachments(playerid);
  54. if((itemAmountLeft - 1) == 0)
  55. {
  56. new itemAmount = GetPVarInt(playerid, "shipperItemAmount1"),
  57. thistime = gettime(),
  58. orderTimestamp = GetPVarInt(playerid, "shipperOrderTimestamp1"),
  59. Packed:string[128];
  60. new original = businessDefaultItemPrice[itemId] * itemAmount,
  61. work = randomEx(24, 32) + floatround(itemAmount*4),
  62. _tips = floatround((60/(thistime-orderTimestamp))*4.5);
  63. format(string, sizeof(string), "Shipping Order #1: Ban da giao hang cho ngoi nha so '%d', nhan duoc tien goc '%d$'.",
  64. houseId, original);
  65. msg(playerid, COLOR_GREEN, string);
  66. format(string, sizeof(string), "Shipping Order #1: Tien cong '%d$', tien tips '%d$' se duoc cong vao tai khoan ngan hang cua ban.", work, _tips);
  67. msg(playerid, COLOR_GREEN, string);
  68. _givePlayerMoney(playerid, original);
  69. givePlayerJobDeposits(playerid, work+_tips, 1);
  70.  
  71. removePlayerDestination(playerid, GetPVarInt(playerid, "shipperDestinationId1"));
  72. DeletePVar(playerid, "shipperItemId1");
  73. DeletePVar(playerid, "shipperItemAmount1");
  74. DeletePVar(playerid, "shipperDestinationId1");
  75. DeletePVar(playerid, "shipperHouseId1");
  76. DeletePVar(playerid, "shipperItemAmountLeft1");
  77. DeletePVar(playerid, "shipperOrderTimestamp1");
  78. }
  79. SetPVarInt(playerid, "shipperItemAmountLeft1", itemAmountLeft-1);
  80. return 1;
  81. }
  82. }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement