Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.00 KB | None | 0 0
  1. -- Credits: Sighmir and Shadow --
  2. local Tunnel = module("vrp", "lib/Tunnel")
  3. local Proxy = module("vrp", "lib/Proxy")
  4. vRPserver = Tunnel.getInterface("vRP")
  5. vRP = Proxy.getInterface("vRP")
  6. vRPclient = Tunnel.getInterface("vRP")
  7. vRPps = {}
  8. Tunnel.bindInterface("pescador",vRPps)
  9.  
  10. function vRPps.checkPermission()
  11. local user_id = vRP.getUserId(source)
  12. return vRP.hasPermission(user_id, "#police.dv")
  13. end
  14.  
  15. local peixes = {
  16. "sardinha"
  17. }
  18.  
  19. local pescadores = {}
  20.  
  21. function tickPescador()
  22. for k,v in pairs(pescadores) do
  23. if v then
  24. pescadores[k] = v+1
  25. if math.fmod(pescadores[k],10) == 0 then
  26. local user_id = vRP.getUserId(k)
  27. local player = vRP.getUserSource(user_id)
  28. local peixe = peixes[math.random(1,#peixes)]
  29. if ((vRP.getInventoryWeight(user_id)+vRP.getItemWeight(peixe)) <= vRP.getInventoryMaxWeight(user_id)) then
  30. vRPclient._notify(player,"~b~Você pescou ~g~"..peixe..".")
  31. vRP.giveInventoryItem(user_id,peixe,1,false)
  32. else
  33. vRPclient.notify(vRP.getUserSource(user_id), "~r~Seu inventory esta cheio.")
  34. end
  35. end
  36. end
  37. end
  38. SetTimeout(1000, tickPescador)
  39. end
  40. tickPescador()
  41.  
  42. RegisterServerEvent("addPescador")
  43. AddEventHandler("addPescador", function()
  44. pescadores[source] = 0;
  45. end)
  46.  
  47.  
  48. RegisterServerEvent("removePescador")
  49. AddEventHandler("removePescador", function()
  50. pescadores[source] = nil;
  51. end)
  52.  
  53. RegisterServerEvent("checar:venda")
  54. AddEventHandler("checar:venda", function()
  55. local source = source
  56. local user_id = vRP.getUserId(source)
  57.  
  58. local sardinha = vRP.getInventoryItemAmount(user_id,"sardinha")
  59. local peixegato = vRP.getInventoryItemAmount(user_id,"peixe-gato")
  60. local salmao = vRP.getInventoryItemAmount(user_id,"salmao")
  61. local corvina = vRP.getInventoryItemAmount(user_id,"corvina")
  62.  
  63. if sardinha >= 5 then
  64. local x = math.random(1,5)
  65.  
  66. local amount = 5 * x
  67. vRP.giveMoney(user_id,amount)
  68. vRP.tryGetInventoryItem(user_id,"sardinha",x)
  69. vRPclient._notify(player,"Você vendeu ~b~"..x.." ~y sardinha por R$~ "..amount.."") --NOVO
  70. --TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  71. --TriggerClientEvent("pNotify:SendNotification", source, {
  72. -- text = "Você vendeu " ..x.. " sardinha por R$" .. amount ,
  73. -- type = "success",
  74. -- progressBar = false,
  75. -- queue = "lmao",
  76. -- timeout = 2000,
  77. -- layout = "CenterLeft"
  78. -- })
  79.  
  80. elseif sardinha == 4 then
  81. local x = math.random(1,4)
  82. local amount = 5 * x
  83. vRP.giveMoney(user_id,amount)
  84. vRP.tryGetInventoryItem(user_id,"sardinha",x)
  85.  
  86. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  87. TriggerClientEvent("pNotify:SendNotification", source, {
  88. text = "Você vendeu " ..x.. " sardinha por R$"..amount,
  89. type = "success",
  90. progressBar = false,
  91. queue = "lmao",
  92. timeout = 2000,
  93. layout = "CenterLeft"
  94. })
  95.  
  96. elseif sardinha == 3 then
  97. local x = math.random(1,3)
  98. local amount = 5 * x
  99. vRP.giveMoney(user_id,amount)
  100. vRP.tryGetInventoryItem(user_id,"sardinha",x)
  101.  
  102. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  103. TriggerClientEvent("pNotify:SendNotification", source, {
  104. text = "Você vendeu " ..x.. " sardinha por R$"..amount,
  105. type = "success",
  106. progressBar = false,
  107. queue = "lmao",
  108. timeout = 2000,
  109. layout = "CenterLeft"
  110. })
  111.  
  112. elseif sardinha == 2 then
  113. local x = math.random(1,2)
  114. local amount = 5 * x
  115. vRP.giveMoney(user_id,amount)
  116. vRP.tryGetInventoryItem(user_id,"sardinha",x)
  117.  
  118. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  119. TriggerClientEvent("pNotify:SendNotification", source, {
  120. text = "Você vendeu " ..x.. " sardinha por R$"..amount,
  121. type = "success",
  122. progressBar = false,
  123. queue = "lmao",
  124. timeout = 2000,
  125. layout = "CenterLeft"
  126. })
  127.  
  128. elseif sardinha == 1 then
  129. local amount = 5
  130. vRP.giveMoney(user_id,amount)
  131. vRP.tryGetInventoryItem(user_id,"sardinha",1)
  132.  
  133. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  134. TriggerClientEvent("pNotify:SendNotification", source, {
  135. text = "Você vendeu 1 sardinha por R$"..amount,
  136. type = "success",
  137. progressBar = false,
  138. queue = "lmao",
  139. timeout = 2000,
  140. layout = "CenterLeft"
  141. })
  142.  
  143. elseif peixegato >= 5 then
  144. local x2 = math.random(1,5)
  145. local amount = 10 * x2
  146. vRP.giveMoney(user_id,amount)
  147. vRP.tryGetInventoryItem(user_id,"peixe-gato",x2)
  148.  
  149. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  150. TriggerClientEvent("pNotify:SendNotification", source, {
  151. text = "Você vendeu " ..x2.. " peixe-gato por R$" .. amount,
  152. type = "success",
  153. progressBar = false,
  154. queue = "lmao",
  155. timeout = 2000,
  156. layout = "CenterLeft"
  157. })
  158.  
  159. elseif peixegato == 4 then
  160. local x2 = math.random(1,4)
  161. local amount = 10 * x2
  162. vRP.giveMoney(user_id,amount)
  163. vRP.tryGetInventoryItem(user_id,"peixe-gato",x2)
  164.  
  165. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  166. TriggerClientEvent("pNotify:SendNotification", source, {
  167. text = "Você vendeu " ..x2.. " peixe-gato por R$" .. amount,
  168. type = "success",
  169. progressBar = false,
  170. queue = "lmao",
  171. timeout = 2000,
  172. layout = "CenterLeft"
  173. })
  174.  
  175. elseif peixegato == 3 then
  176. local x2 = math.random(1,3)
  177. local amount = 10 * x2
  178. vRP.giveMoney(user_id,amount)
  179. vRP.tryGetInventoryItem(user_id,"peixe-gato",x2)
  180.  
  181. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  182. TriggerClientEvent("pNotify:SendNotification", source, {
  183. text = "Você vendeu " ..x2.. " peixe-gato por R$" .. amount,
  184. type = "success",
  185. progressBar = false,
  186. queue = "lmao",
  187. timeout = 2000,
  188. layout = "CenterLeft"
  189. })
  190.  
  191. elseif peixegato == 2 then
  192. local x2 = math.random(1,2)
  193. local amount = 10 * x2
  194. vRP.giveMoney(user_id,amount)
  195. vRP.tryGetInventoryItem(user_id,"peixe-gato",x2)
  196.  
  197. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  198. TriggerClientEvent("pNotify:SendNotification", source, {
  199. text = "Você vendeu " ..x2.. " peixe-gato por R$"..amount,
  200. type = "success",
  201. progressBar = false,
  202. queue = "lmao",
  203. timeout = 2000,
  204. layout = "CenterLeft"
  205. })
  206.  
  207. elseif peixegato == 1 then
  208. local amount = 10
  209. vRP.giveMoney(user_id,amount)
  210. vRP.tryGetInventoryItem(user_id,"peixe-gato",1)
  211.  
  212. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  213. TriggerClientEvent("pNotify:SendNotification", source, {
  214. text = "Você vendeu 1 peixe-gato por R$" .. amount,
  215. type = "success",
  216. progressBar = false,
  217. queue = "lmao",
  218. timeout = 2000,
  219. layout = "CenterLeft"
  220. })
  221.  
  222. elseif salmao >= 5 then
  223. local x3 = math.random(1,5)
  224. local amount = 15 * x3
  225. vRP.giveMoney(user_id,amount)
  226. vRP.tryGetInventoryItem(user_id,"salmao",x3)
  227.  
  228. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  229. TriggerClientEvent("pNotify:SendNotification", source, {
  230. text = "Você vendeu " ..x3.. " salmao por R$" .. amount,
  231. type = "success",
  232. progressBar = false,
  233. queue = "lmao",
  234. timeout = 2000,
  235. layout = "CenterLeft"
  236. })
  237.  
  238. elseif salmao == 4 then
  239. local x3 = math.random(1,4)
  240.  
  241. local amount = 15 * x3
  242. vRP.giveMoney(user_id,amount)
  243. vRP.tryGetInventoryItem(user_id,"salmao",x3)
  244.  
  245. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  246. TriggerClientEvent("pNotify:SendNotification", source, {
  247. text = "Você vendeu " ..x3.. " salmao por R$" .. amount,
  248. type = "success",
  249. progressBar = false,
  250. queue = "lmao",
  251. timeout = 2000,
  252. layout = "CenterLeft"
  253. })
  254.  
  255. elseif salmao == 3 then
  256. local x3 = math.random(1,3)
  257.  
  258. local amount = 15 * x3
  259. vRP.giveMoney(user_id,amount)
  260. vRP.tryGetInventoryItem(user_id,"salmao",x3)
  261.  
  262. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  263. TriggerClientEvent("pNotify:SendNotification", source, {
  264. text = "Você vendeu " ..x3.. " salmao por R$" .. amount,
  265. type = "success",
  266. progressBar = false,
  267. queue = "lmao",
  268. timeout = 2000,
  269. layout = "CenterLeft"
  270. })
  271.  
  272. elseif salmao == 2 then
  273. local x3 = math.random(1,2)
  274.  
  275. local amount = 15 * x3
  276. vRP.giveMoney(user_id,amount)
  277. vRP.tryGetInventoryItem(user_id,"salmao",x3)
  278.  
  279. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  280. TriggerClientEvent("pNotify:SendNotification", source, {
  281. text = "Você vendeu " ..x3.. " salmao por R$"..amount,
  282. type = "success",
  283. progressBar = false,
  284. queue = "lmao",
  285. timeout = 2000,
  286. layout = "CenterLeft"
  287. })
  288.  
  289. elseif salmao == 1 then
  290.  
  291. local amount = 15
  292. vRP.giveMoney(user_id,amount)
  293. vRP.tryGetInventoryItem(user_id,"salmao",1)
  294.  
  295. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  296. TriggerClientEvent("pNotify:SendNotification", source, {
  297. text = "Você vendeu 1 salmao por R$" .. amount,
  298. type = "success",
  299. progressBar = false,
  300. queue = "lmao",
  301. timeout = 2000,
  302. layout = "CenterLeft"
  303. })
  304.  
  305. elseif corvina >= 5 then
  306. local x4 = math.random(1,5)
  307.  
  308. local amount = 20 * x4
  309. vRP.giveMoney(user_id,amount)
  310. vRP.tryGetInventoryItem(user_id,"corvina",x4)
  311.  
  312. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  313. TriggerClientEvent("pNotify:SendNotification", source, {
  314. text = "Você vendeu " ..x4.. " corvina por R$" .. amount,
  315. type = "success",
  316. progressBar = false,
  317. queue = "lmao",
  318. timeout = 2000,
  319. layout = "CenterLeft"
  320. })
  321.  
  322. elseif corvina == 4 then
  323. local x4 = math.random(1,4)
  324.  
  325. local amount = 20 * x4
  326. vRP.giveMoney(user_id,amount)
  327. vRP.tryGetInventoryItem(user_id,"corvina",x4)
  328.  
  329. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  330. TriggerClientEvent("pNotify:SendNotification", source, {
  331. text = "Você vendeu " ..x4.. " corvina por R$" .. amount,
  332. type = "success",
  333. progressBar = false,
  334. queue = "lmao",
  335. timeout = 2000,
  336. layout = "CenterLeft"
  337. })
  338.  
  339. elseif corvina == 3 then
  340. local x4 = math.random(1,3)
  341.  
  342. local amount = 20 * x4
  343. vRP.giveMoney(user_id,amount)
  344. vRP.tryGetInventoryItem(user_id,"corvina",x4)
  345.  
  346. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  347. TriggerClientEvent("pNotify:SendNotification", source, {
  348. text = "Você vendeu " ..x4.. " corvina por R$" .. amount,
  349. type = "success",
  350. progressBar = false,
  351. queue = "lmao",
  352. timeout = 2000,
  353. layout = "CenterLeft"
  354. })
  355.  
  356. elseif corvina == 2 then
  357. local x4 = math.random(1,2)
  358.  
  359. local amount = 20 * x4
  360. vRP.giveMoney(user_id,amount)
  361. vRP.tryGetInventoryItem(user_id,"corvina",x4)
  362.  
  363. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  364. TriggerClientEvent("pNotify:SendNotification", source, {
  365. text = "Você vendeu " ..x4.. " corvina por R$"..amount,
  366. type = "success",
  367. progressBar = false,
  368. queue = "lmao",
  369. timeout = 2000,
  370. layout = "CenterLeft"
  371. })
  372.  
  373. elseif corvina == 1 then
  374.  
  375. local amount = 20
  376. vRP.giveMoney(user_id,amount)
  377. vRP.tryGetInventoryItem(user_id,"corvina",1)
  378.  
  379. TriggerClientEvent("pNotify:SetQueueMax", source, "lmao", 5)
  380. TriggerClientEvent("pNotify:SendNotification", source, {
  381. text = "Você vendeu 1 corvina por R$" .. amount,
  382. type = "success",
  383. progressBar = false,
  384. queue = "lmao",
  385. timeout = 2000,
  386. layout = "CenterLeft"
  387. })
  388. end
  389. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement