Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.06 KB | None | 0 0
  1. ----------------------------------------------------
  2. --===================Aurelien=====================--
  3. ----------------------------------------------------
  4. ------------------------Lua-------------------------
  5. -- SORRY FOR BAD ENGLISH, Baguette :')
  6.  
  7. local DrawMarkerShow = true
  8. local DrawBlipTradeShow = true
  9.  
  10. -- -900.0, -3002.0, 13.0
  11. -- -800.0, -3002.0, 13.0
  12. -- -1078.0, -3002.0, 13.0
  13.  
  14. local Price = 85 -- PRICE FOR EACH CANNABIS TREATY
  15.  
  16. local Position = {
  17. Recolet={x=2221.34,y=5577.2,z=53.82, distance=5, bli}, -- POSITION OF RECOLT
  18. traitement={x=-173.189,y=6394.62,z=31.4904, distance=5}, -- POSITION OF TREATMENT
  19. vente0={x=2487.16,y=3761.59,z=42.2516, distance=5} -- POSITION OF SELL
  20. vente1={x=-85.9758,y=-1956.24,z=20.749, distance=5} -- POSITION OF SELL
  21. vente2={x=-1081.75,y=-248.142,z=37.7633, distance=5} -- POSITION OF SELL
  22. }
  23.  
  24. function drawTxt(text,font,centre,x,y,scale,r,g,b,a)
  25. SetTextFont(font)
  26. SetTextProportional(0)
  27. SetTextScale(scale, scale)
  28. SetTextColour(r, g, b, a)
  29. SetTextDropShadow(0, 0, 0, 0,255)
  30. SetTextEdge(1, 0, 0, 0, 255)
  31. SetTextDropShadow()
  32. SetTextOutline()
  33. SetTextCentre(centre)
  34. SetTextEntry("STRING")
  35. AddTextComponentString(text)
  36. DrawText(x , y)
  37. end
  38.  
  39. function ShowInfo(text, state)
  40. SetTextComponentFormat("STRING")
  41. AddTextComponentString(text)DisplayHelpTextFromStringLabel(0, state, 0, -1)
  42. end
  43.  
  44. local ShowMsgtime = {msg="",time=0}
  45.  
  46. Citizen.CreateThread(function()
  47. while true do
  48. Citizen.Wait(0)
  49. if ShowMsgtime.time ~= 0 then
  50. drawTxt(ShowMsgtime.msg, 0,1,0.5,0.8,0.6,255,255,255,255)
  51. ShowMsgtime.time = ShowMsgtime.time - 1
  52. end
  53. end
  54. end)
  55.  
  56. Citizen.CreateThread(function()
  57.  
  58. if DrawBlipTradeShow then
  59. SetBlipTrade(140, "~g~ Recuperation de ~b~Cannabis", 2, Position.Recolet.x, Position.Recolet.y, Position.Recolet.z) -- POSITION OF MARKERS ON MAP
  60. SetBlipTrade(50, "~g~ Traitement de ~b~Cannabis", 1, Position.traitement.x, Position.traitement.y, Position.traitement.z) -- POSITION OF MARKERS ON MAP
  61. SetBlipTrade(277, "~g~ Vente de ~b~Cannabis", 1, Position.vente0.x, Position.vente0.y, Position.vente0.z) -- POSITION OF MARKERS ON MAP
  62. SetBlipTrade(277, "~g~ Vente de ~b~Cannabis", 1, Position.vente1.x, Position.vente1.y, Position.vente1.z) -- POSITION OF MARKERS ON MAP
  63. SetBlipTrade(277, "~g~ Vente de ~b~Cannabis", 1, Position.vente2.x, Position.vente2.y, Position.vente2.z) -- POSITION OF MARKERS ON MAP
  64. end
  65.  
  66. while true do
  67. Citizen.Wait(0)
  68. if DrawMarkerShow then
  69. DrawMarker(1, Position.Recolet.x, Position.Recolet.y, Position.Recolet.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 4.0, 1.0, 0, 0, 255, 75, 0, 0, 2, 0, 0, 0, 0)
  70. DrawMarker(1, Position.traitement.x, Position.traitement.y, Position.traitement.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 4.0, 1.0, 0, 0, 255, 75, 0, 0, 2, 0, 0, 0, 0)
  71. DrawMarker(1, Position.vente0.x, Position.vente0.y, Position.vente0.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 4.0, 1.0, 0, 0, 255, 75, 0, 0, 2, 0, 0, 0, 0)
  72. DrawMarker(1, Position.vente1.x, Position.vente1.y, Position.vente1.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 4.0, 1.0, 0, 0, 255, 75, 0, 0, 2, 0, 0, 0, 0)
  73. DrawMarker(1, Position.vente2.x, Position.vente2.y, Position.vente2.z, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 4.0, 1.0, 0, 0, 255, 75, 0, 0, 2, 0, 0, 0, 0)
  74. end
  75. end
  76. end)
  77.  
  78. Citizen.CreateThread(function()
  79. while true do
  80. Citizen.Wait(0)
  81. local playerPos = GetEntityCoords(GetPlayerPed(-1))
  82.  
  83. local distanceWeedFarm = GetDistanceBetweenCoords(playerPos.x, playerPos.y, playerPos.z, Position.Recolet.x, Position.Recolet.y, Position.Recolet.z, true)
  84. if distanceWeedFarm < Position.Recolet.distance then
  85. ShowInfo('~b~Appuyez sur ~g~E~b~ pour recolter', 0) -- MESSAGE TO RECOLT WHEN YOU PRESS [E]
  86. if IsControlJustPressed(1,38) then -- SEE IF [E] IS PRESSED
  87. local weedcount = 0
  88. TriggerEvent("player:getQuantity", 1, function(data) -- GET QUANTITY ON INVENTORY
  89. weedcount = data.count
  90. end)
  91. Citizen.Wait(1)
  92. if weedcount < 30 then -- IF IN INVENTORY [<30 CANNABIS]
  93. ShowMsgtime.msg = '~g~ Recolte en cours.' -- YOU CAN RECOLT
  94. ShowMsgtime.time = 150
  95. Wait(2500)
  96. ShowMsgtime.msg = '~g~ + 1 ~b~Cannabis' -- RECOLT MESSAGE
  97. ShowMsgtime.time = 150
  98. -- ("player:receiveItem", 1, 1) = ADD ITEM , ID1 ( CANNABIS ), AND "+1"
  99. TriggerEvent("player:receiveItem", 1, 1) -- [+ CANNABIS] ( ALSO ADD NEW LINE [CANNABIS] IN INVENTORY )
  100. else
  101. ShowMsgtime.msg = '~r~ Inventaire complet !' -- IF [30 CANNABIS] SAY INVENTORY FULL
  102. ShowMsgtime.time = 150
  103. end
  104. end
  105. end
  106.  
  107. local distanceWeedFarm = GetDistanceBetweenCoords(playerPos.x, playerPos.y, playerPos.z, Position.traitement.x, Position.traitement.y, Position.traitement.z, true)
  108. if distanceWeedFarm < Position.traitement.distance then
  109. ShowInfo('~b~Appuyez sur ~g~E~b~ pour traiter votre ~b~Cannabis', 0) -- MESSAGE TO TREATY WHEN YOU PRESS [E]
  110. if IsControlJustPressed(1,38) then -- SEE IF [E] IS PRESSED
  111. local weedcount = 0
  112. TriggerEvent("player:getQuantity", 1, function(data) -- GET QUANTITY ON INVENTORY
  113. weedcount = data.count
  114. end)
  115. if weedcount ~= 0 then -- IF IN INVENTORY [0> CANNABIS]
  116. ShowMsgtime.msg = '~g~ Traitement en cours.' -- YOU CAN TREATY
  117. ShowMsgtime.time = 150
  118. Wait(2500)
  119. ShowMsgtime.msg = '~g~ + 1 ~b~Cannabis Traite' -- TREATMENT MESSAGE
  120. ShowMsgtime.time = 150
  121. -- ("player:looseItem", 1, 1) = REMOVE ITEM , ID1 ( CANNABIS ), AND "-1"
  122. TriggerEvent("player:looseItem", 1, 1) -- [-1 CANNNABIS]
  123. -- ("player:receiveItem", 3, 1) = ADD ITEM , ID3 ( CANNABIS ROLLING ), AND "+1"
  124. TriggerEvent("player:receiveItem", 3, 1) -- [+1 CANNABIS ROLLING]
  125. else
  126. ShowMsgtime.msg = '~r~ Vous n avez pas de Cannabis !' -- MESSAGE FOR 0 CANNABIS IN INVENTORY
  127. ShowMsgtime.time = 150
  128. end
  129. end
  130. end
  131.  
  132. local distanceWeedFarm = GetDistanceBetweenCoords(playerPos.x, playerPos.y, playerPos.z, Position.vente0.x, Position.vente0.y, Position.vente0.z, true)
  133. if distanceWeedFarm < Position.vente0.distance then
  134. ShowInfo('~b~ Appuyez sur ~g~E~b~ pour vendre votre Cannabis', 0) -- MESSAGE TO SELL WHEN YOU PRESS [E]
  135. if IsControlJustPressed(1,38) then -- SEE IF [E] PESSED
  136. local weedcount = 0
  137. TriggerEvent("player:getQuantity", 3, function(data)
  138. weedcount = data.count
  139. end)
  140. if weedcount ~= 0 then -- IF IN INVENTORY [0> CANNABIS ROLLING]
  141. ShowMsgtime.msg = '~g~ Vente en cours.' -- YOU CAN SELL
  142. ShowMsgtime.time = 150
  143. Wait(2500)
  144. ShowMsgtime.msg = '~g~ +'.. Price ..'$' -- GIVE MONEY TO PLAYER [ SET ON LINE : 13 ]
  145. ShowMsgtime.time = 150
  146. -- ("player:sellItem", 3, 1) = SELL ITEM , ID3 ( CANNABIS ROLLING ), AND "-1" + GIVE THE MONEY
  147. TriggerEvent("player:sellItem", 3, Price) -- REMOVE 1 CANNABIS ROLLING AND GIVE MONEY
  148. else
  149. ShowMsgtime.msg = '~r~ Vous n avez pas de Cannabis Traite !' -- MESSAGE FOR 0 CANNABIS ROLLING IN INVENTORY
  150. ShowMsgtime.time = 150
  151. end
  152. end
  153. end
  154.  
  155. end
  156. end)
  157.  
  158. local distanceWeedFarm = GetDistanceBetweenCoords(playerPos.x, playerPos.y, playerPos.z, Position.vente1.x, Position.vente1.y, Position.vente1.z, true)
  159. if distanceWeedFarm < Position.vente1.distance then
  160. ShowInfo('~b~ Appuyez sur ~g~E~b~ pour vendre votre Cannabis', 0) -- MESSAGE TO SELL WHEN YOU PRESS [E]
  161. if IsControlJustPressed(1,38) then -- SEE IF [E] PESSED
  162. local weedcount = 0
  163. TriggerEvent("player:getQuantity", 3, function(data)
  164. weedcount = data.count
  165. end)
  166. if weedcount ~= 0 then -- IF IN INVENTORY [0> CANNABIS ROLLING]
  167. ShowMsgtime.msg = '~g~ Vente en cours.' -- TOU CAN SELL
  168. ShowMsgtime.time = 150
  169. Wait(2500)
  170. ShowMsgtime.msg = '~g~ +'.. Price ..'$' -- GIVE MONEY TO PLAYER [ SET ON LINE : 13 ]
  171. ShowMsgtime.time = 150
  172. -- ("player:sellItem", 3, 1) = SELL ITEM , ID3 ( CANNABIS ROLLING ), AND "-1" + GIVE THE MONEY
  173. TriggerEvent("player:sellItem", 3, Price) -- REMOVE 1 CANNABIS ROLLING AND GIVE MONEY
  174. else
  175. ShowMsgtime.msg = '~r~ Vous n avez pas de Cannabis Traite !' -- MESSAGE FOR 0 CANNABIS ROLLING IN INVENTORY
  176. ShowMsgtime.time = 150
  177. end
  178. end
  179. end
  180.  
  181. end
  182. end)
  183. local distanceWeedFarm = GetDistanceBetweenCoords(playerPos.x, playerPos.y, playerPos.z, Position.vente2.x, Position.vente2.y, Position.vente2.z, true)
  184. if distanceWeedFarm < Position.vente2.distance then
  185. ShowInfo('~b~ Appuyez sur ~g~E~b~ pour vendre votre Cannabis', 0) -- MESSAGE TO SELL WHEN YOU PRESS [E]
  186. if IsControlJustPressed(1,38) then -- SEE IF [E] PESSED
  187. local weedcount = 0
  188. TriggerEvent("player:getQuantity", 3, function(data)
  189. weedcount = data.count
  190. end)
  191. if weedcount ~= 0 then -- IF IN INVENTORY [0> CANNABIS ROLLING]
  192. ShowMsgtime.msg = '~g~ Vente en cours.' -- TOU CAN SELL
  193. ShowMsgtime.time = 150
  194. Wait(2500)
  195. ShowMsgtime.msg = '~g~ +'.. Price ..'$' -- GIVE MONEY TO PLAYER [ SET ON LINE : 13 ]
  196. ShowMsgtime.time = 150
  197. -- ("player:sellItem", 3, 1) = SELL ITEM , ID3 ( CANNABIS ROLLING ), AND "-1" + GIVE THE MONEY
  198. TriggerEvent("player:sellItem", 3, Price) -- REMOVE 1 CANNABIS ROLLING AND GIVE MONEY
  199. else
  200. ShowMsgtime.msg = '~r~ Vous n avez pas de Cannabis Traite !' -- MESSAGE FOR 0 CANNABIS ROLLING IN INVENTORY
  201. ShowMsgtime.time = 150
  202. end
  203. end
  204. end
  205.  
  206. end
  207. end)
  208.  
  209. function SetBlipTrade(id, text, color, x, y, z)
  210. local Blip = AddBlipForCoord(x, y, z)
  211.  
  212. SetBlipSprite(Blip, id)
  213. SetBlipColour(Blip, color)
  214.  
  215. BeginTextCommandSetBlipName("STRING")
  216. AddTextComponentString(text)
  217. EndTextCommandSetBlipName(Blip)
  218. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement