Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.10 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. default: msg(playerid, COLOR_RED, "Vat pham khong con de co the giao.");
  17. }
  18. }
  19. inventoryRemoveCharacterItem(playerid, MAX_INVENTORY_ITEMS);
  20. updateInventoryAttachments(playerid);
  21. if((itemAmountLeft - 1) == 0)
  22. {
  23. new itemAmount = GetPVarInt(playerid, "shipperItemAmount1"),
  24. thistime = gettime(),
  25. orderTimestamp = GetPVarInt(playerid, "shipperOrderTimestamp1"),
  26. Packed:string[128];
  27. new original = businessDefaultItemPrice[itemId] * itemAmount,
  28. work = randomEx(24, 32) + floatround(itemAmount*4),
  29. _tips = floatround((60/(thistime-orderTimestamp))*4.5);
  30. format(string, sizeof(string), "Shipping Order #1: Ban da giao hang cho ngoi nha so '%d', nhan duoc tien goc '%d$'.",
  31. houseId, original);
  32. msg(playerid, COLOR_GREEN, string);
  33. 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);
  34. msg(playerid, COLOR_GREEN, string);
  35. _givePlayerMoney(playerid, original);
  36. givePlayerJobDeposits(playerid, work+_tips, 1);
  37.  
  38. removePlayerDestination(playerid, GetPVarInt(playerid, "shipperDestinationId1"));
  39. DeletePVar(playerid, "shipperItemId1");
  40. DeletePVar(playerid, "shipperItemAmount1");
  41. DeletePVar(playerid, "shipperDestinationId1");
  42. DeletePVar(playerid, "shipperHouseId1");
  43. DeletePVar(playerid, "shipperItemAmountLeft1");
  44. DeletePVar(playerid, "shipperOrderTimestamp1");
  45. }
  46. SetPVarInt(playerid, "shipperItemAmountLeft1", itemAmountLeft-1);
  47. return 1;
  48. }
  49. else if(characterInventory[playerid][MAX_INVENTORY_ITEMS+1][cItemModel] == businessAvailableItem[itemId][cItemModel])
  50. {
  51. if(characterInventory[playerid][MAX_INVENTORY_ITEMS+1][cNumberOfUses] <= 0)
  52. {
  53. switch(characterInventory[playerid][MAX_INVENTORY_ITEMS+1][cItemModel])
  54. {
  55. case ITEM_TYPE_PHONE, ITEM_TYPE_PORTABLE_RADIO:
  56. default: msg(playerid, COLOR_RED, "Vat pham khong con de co the giao.");
  57. }
  58. }
  59. inventoryRemoveCharacterItem(playerid, MAX_INVENTORY_ITEMS+1);
  60. updateInventoryAttachments(playerid);
  61. if((itemAmountLeft - 1) == 0)
  62. {
  63. new itemAmount = GetPVarInt(playerid, "shipperItemAmount1"),
  64. thistime = gettime(),
  65. orderTimestamp = GetPVarInt(playerid, "shipperOrderTimestamp1"),
  66. Packed:string[128];
  67. new original = businessDefaultItemPrice[itemId] * itemAmount,
  68. work = randomEx(24, 32) + floatround(itemAmount*4),
  69. _tips = floatround((60/(thistime-orderTimestamp))*4.5);
  70. format(string, sizeof(string), "Shipping Order #1: Ban da giao hang cho ngoi nha so '%d', nhan duoc tien goc '%d$'.",
  71. houseId, original);
  72. msg(playerid, COLOR_GREEN, string);
  73. 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);
  74. msg(playerid, COLOR_GREEN, string);
  75. _givePlayerMoney(playerid, original);
  76. givePlayerJobDeposits(playerid, work+_tips, 1);
  77.  
  78. removePlayerDestination(playerid, GetPVarInt(playerid, "shipperDestinationId1"));
  79. DeletePVar(playerid, "shipperItemId1");
  80. DeletePVar(playerid, "shipperItemAmount1");
  81. DeletePVar(playerid, "shipperDestinationId1");
  82. DeletePVar(playerid, "shipperHouseId1");
  83. DeletePVar(playerid, "shipperItemAmountLeft1");
  84. DeletePVar(playerid, "shipperOrderTimestamp1");
  85. }
  86. SetPVarInt(playerid, "shipperItemAmountLeft1", itemAmountLeft-1);
  87. return 1;
  88. }
  89. }
  90. }
  91. if(GetPVarType(playerid, "shipperDestinationId2") && mainJobsLocked[MAINJOB_SHIPPER] == false)
  92. {
  93. if(characterInventory[playerid][MAX_INVENTORY_ITEMS][cNumberOfUses] <= 0)
  94. {
  95. switch(characterInventory[playerid][MAX_INVENTORY_ITEMS][cItemModel])
  96. {
  97. case ITEM_TYPE_PHONE, ITEM_TYPE_PORTABLE_RADIO:
  98. default: msg(playerid, COLOR_RED, "Vat pham khong con de co the giao.");
  99. }
  100. }
  101. new houseId = GetPVarInt(playerid, "shipperHouseId2");
  102. if(IsPlayerInRangeOfPoint(playerid, 3.0, characterHouse[houseId][exteriorX], characterHouse[houseId][exteriorY],
  103. characterHouse[houseId][exteriorZ]))
  104. {
  105. new itemId = GetPVarInt(playerid, "shipperItemId2"),
  106. itemAmountLeft = GetPVarInt(playerid, "shipperItemAmountLeft2");
  107. if(characterInventory[playerid][MAX_INVENTORY_ITEMS][cItemModel] == businessAvailableItem[itemId][cItemModel])
  108. {
  109. inventoryRemoveCharacterItem(playerid, MAX_INVENTORY_ITEMS);
  110. updateInventoryAttachments(playerid);
  111. if((itemAmountLeft - 1) == 0)
  112. {
  113. new itemAmount = GetPVarInt(playerid, "shipperItemAmount2"),
  114. thistime = gettime(),
  115. orderTimestamp = GetPVarInt(playerid, "shipperOrderTimestamp2"),
  116. Packed:string[128];
  117. new original = businessDefaultItemPrice[itemId] * itemAmount,
  118. work = randomEx(24, 32) + floatround(itemAmount*4),
  119. _tips = floatround((60/(thistime-orderTimestamp))*4.5);
  120. format(string, sizeof(string), "Shipping Order #2: Ban da giao hang cho ngoi nha so '%d', nhan duoc tien goc '%d$'.",
  121. houseId, original);
  122. msg(playerid, COLOR_GREEN, string);
  123. format(string, sizeof(string), "Shipping Order #2: Tien cong '%d$', tien tips '%d$' se duoc cong vao tai khoan ngan hang cua ban.", work, _tips);
  124. msg(playerid, COLOR_GREEN, string);
  125. _givePlayerMoney(playerid, original);
  126. givePlayerJobDeposits(playerid, work+_tips, 1);
  127.  
  128. removePlayerDestination(playerid, GetPVarInt(playerid, "shipperDestinationId2"));
  129. DeletePVar(playerid, "shipperItemId2");
  130. DeletePVar(playerid, "shipperItemAmount2");
  131. DeletePVar(playerid, "shipperDestinationId2");
  132. DeletePVar(playerid, "shipperHouseId2");
  133. DeletePVar(playerid, "shipperItemAmountLeft2");
  134. DeletePVar(playerid, "shipperOrderTimestamp2");
  135. }
  136. SetPVarInt(playerid, "shipperItemAmountLeft2", itemAmountLeft-1);
  137. return 1;
  138. }
  139. else if(characterInventory[playerid][MAX_INVENTORY_ITEMS+1][cItemModel] == businessAvailableItem[itemId][cItemModel])
  140. {
  141. if(characterInventory[playerid][MAX_INVENTORY_ITEMS+1][cNumberOfUses] <= 0)
  142. {
  143. switch(characterInventory[playerid][MAX_INVENTORY_ITEMS+1][cItemModel])
  144. {
  145. case ITEM_TYPE_PHONE, ITEM_TYPE_PORTABLE_RADIO:
  146. default: msg(playerid, COLOR_RED, "Vat pham khong con de co the giao.");
  147. }
  148. }
  149. inventoryRemoveCharacterItem(playerid, MAX_INVENTORY_ITEMS+1);
  150. updateInventoryAttachments(playerid);
  151. if((itemAmountLeft - 1) == 0)
  152. {
  153. new itemAmount = GetPVarInt(playerid, "shipperItemAmount2"),
  154. thistime = gettime(),
  155. orderTimestamp = GetPVarInt(playerid, "shipperOrderTimestamp2"),
  156. Packed:string[128];
  157. new original = businessDefaultItemPrice[itemId] * itemAmount,
  158. work = randomEx(24, 32) + floatround(itemAmount*4),
  159. _tips = floatround((60/(thistime-orderTimestamp))*4.5);
  160. format(string, sizeof(string), "Shipping Order #2: Ban da giao hang cho ngoi nha so '%d', nhan duoc tien goc '%d$'.",
  161. houseId, original);
  162. msg(playerid, COLOR_GREEN, string);
  163. format(string, sizeof(string), "Shipping Order #2: Tien cong '%d$', tien tips '%d$' se duoc cong vao tai khoan ngan hang cua ban.", work, _tips);
  164. msg(playerid, COLOR_GREEN, string);
  165. _givePlayerMoney(playerid, original);
  166. givePlayerJobDeposits(playerid, work+_tips, 1);
  167.  
  168. removePlayerDestination(playerid, GetPVarInt(playerid, "shipperDestinationId2"));
  169. DeletePVar(playerid, "shipperItemId2");
  170. DeletePVar(playerid, "shipperItemAmount2");
  171. DeletePVar(playerid, "shipperDestinationId2");
  172. DeletePVar(playerid, "shipperHouseId2");
  173. DeletePVar(playerid, "shipperItemAmountLeft2");
  174. DeletePVar(playerid, "shipperOrderTimestamp2");
  175. }
  176. SetPVarInt(playerid, "shipperItemAmountLeft2", itemAmountLeft-1);
  177. return 1;
  178. }
  179. }
  180. }
  181. if(GetPVarType(playerid, "shipperDestinationId3") && mainJobsLocked[MAINJOB_SHIPPER] == false)
  182. {
  183. new houseId = GetPVarInt(playerid, "shipperHouseId3");
  184. if(IsPlayerInRangeOfPoint(playerid, 3.0, characterHouse[houseId][exteriorX], characterHouse[houseId][exteriorY],
  185. characterHouse[houseId][exteriorZ]))
  186. {
  187. new itemId = GetPVarInt(playerid, "shipperItemId3"),
  188. itemAmountLeft = GetPVarInt(playerid, "shipperItemAmountLeft3");
  189. if(characterInventory[playerid][MAX_INVENTORY_ITEMS][cItemModel] == businessAvailableItem[itemId][cItemModel])
  190. {
  191. if(characterInventory[playerid][MAX_INVENTORY_ITEMS][cNumberOfUses] <= 0)
  192. {
  193. switch(characterInventory[playerid][MAX_INVENTORY_ITEMS][cItemModel])
  194. {
  195. case ITEM_TYPE_PHONE, ITEM_TYPE_PORTABLE_RADIO:
  196. default: msg(playerid, COLOR_RED, "Vat pham khong con de co the giao.");
  197. }
  198. }
  199. inventoryRemoveCharacterItem(playerid, MAX_INVENTORY_ITEMS);
  200. updateInventoryAttachments(playerid);
  201. if((itemAmountLeft - 1) == 0)
  202. {
  203. new itemAmount = GetPVarInt(playerid, "shipperItemAmount3"),
  204. thistime = gettime(),
  205. orderTimestamp = GetPVarInt(playerid, "shipperOrderTimestamp3"),
  206. Packed:string[128];
  207. new original = businessDefaultItemPrice[itemId] * itemAmount,
  208. work = randomEx(24, 32) + floatround(itemAmount*4),
  209. _tips = floatround((60/(thistime-orderTimestamp))*4.5);
  210. format(string, sizeof(string), "Shipping Order #3: Ban da giao hang cho ngoi nha so '%d', nhan duoc tien goc '%d$'.",
  211. houseId, original);
  212. msg(playerid, COLOR_GREEN, string);
  213. format(string, sizeof(string), "Shipping Order #3: Tien cong '%d$', tien tips '%d$' se duoc cong vao tai khoan ngan hang cua ban.", work, _tips);
  214. msg(playerid, COLOR_GREEN, string);
  215. _givePlayerMoney(playerid, original);
  216. givePlayerJobDeposits(playerid, work+_tips, 1);
  217.  
  218. removePlayerDestination(playerid, GetPVarInt(playerid, "shipperDestinationId3"));
  219. DeletePVar(playerid, "shipperItemId3");
  220. DeletePVar(playerid, "shipperItemAmount3");
  221. DeletePVar(playerid, "shipperDestinationId3");
  222. DeletePVar(playerid, "shipperHouseId3");
  223. DeletePVar(playerid, "shipperItemAmountLeft3");
  224. DeletePVar(playerid, "shipperOrderTimestamp3");
  225. }
  226. SetPVarInt(playerid, "shipperItemAmountLeft3", itemAmountLeft-1);
  227. return 1;
  228. }
  229. else if(characterInventory[playerid][MAX_INVENTORY_ITEMS+1][cItemModel] == businessAvailableItem[itemId][cItemModel])
  230. {
  231. if(characterInventory[playerid][MAX_INVENTORY_ITEMS+1][cNumberOfUses] <= 0)
  232. {
  233. switch(characterInventory[playerid][MAX_INVENTORY_ITEMS+1][cItemModel])
  234. {
  235. case ITEM_TYPE_PHONE, ITEM_TYPE_PORTABLE_RADIO:
  236. default: msg(playerid, COLOR_RED, "Vat pham khong con de co the giao.");
  237. }
  238. }
  239. inventoryRemoveCharacterItem(playerid, MAX_INVENTORY_ITEMS+1);
  240. updateInventoryAttachments(playerid);
  241. if((itemAmountLeft - 1) == 0)
  242. {
  243. new itemAmount = GetPVarInt(playerid, "shipperItemAmount3"),
  244. thistime = gettime(),
  245. orderTimestamp = GetPVarInt(playerid, "shipperOrderTimestamp3"),
  246. Packed:string[128];
  247. new original = businessDefaultItemPrice[itemId] * itemAmount,
  248. work = randomEx(24, 32) + floatround(itemAmount*4),
  249. _tips = floatround((60/(thistime-orderTimestamp))*4.5);
  250. format(string, sizeof(string), "Shipping Order #3: Ban da giao hang cho ngoi nha so '%d', nhan duoc tien goc '%d$'.",
  251. houseId, original);
  252. msg(playerid, COLOR_GREEN, string);
  253. format(string, sizeof(string), "Shipping Order #3: Tien cong '%d$', tien tips '%d$' se duoc cong vao tai khoan ngan hang cua ban.", work, _tips);
  254. msg(playerid, COLOR_GREEN, string);
  255. _givePlayerMoney(playerid, original);
  256. givePlayerJobDeposits(playerid, work+_tips, 1);
  257.  
  258. removePlayerDestination(playerid, GetPVarInt(playerid, "shipperDestinationId3"));
  259. DeletePVar(playerid, "shipperItemId3");
  260. DeletePVar(playerid, "shipperItemAmount3");
  261. DeletePVar(playerid, "shipperDestinationId3");
  262. DeletePVar(playerid, "shipperHouseId3");
  263. DeletePVar(playerid, "shipperItemAmountLeft3");
  264. DeletePVar(playerid, "shipperOrderTimestamp3");
  265. }
  266. SetPVarInt(playerid, "shipperItemAmountLeft3", itemAmountLeft-1);
  267. return 1;
  268. }
  269. }
  270. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement