Advertisement
Guest User

Untitled

a guest
Oct 24th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 57.79 KB | None | 0 0
  1. local Tunnel = module("vrp","lib/Tunnel")
  2. local Proxy = module("vrp","lib/Proxy")
  3. local Tools = module("vrp","lib/Tools")
  4. vRP = Proxy.getInterface("vRP")
  5. vRPclient = Tunnel.getInterface("vRP")
  6. local idgens = Tools.newIDGenerator()
  7. -----------------------------------------------------------------------------------------------------------------------------------------
  8. -- ITEMLIST
  9. -----------------------------------------------------------------------------------------------------------------------------------------
  10. local itemlist = {
  11. ["ferramenta"] = { index = "ferramenta", nome = "Ferramenta" },
  12. ["encomenda"] = { index = "encomenda", nome = "Encomenda" },
  13. ["sacodelixo"] = { index = "sacodelixo", nome = "Saco de Lixo" },
  14. ["garrafavazia"] = { index = "garrafavazia", nome = "Garrafa Vazia" },
  15. ["garrafadeleite"] = { index = "garrafadeleite", nome = "Garrafa de Leite" },
  16. ["tora"] = { index = "tora", nome = "Tora de Madeira" },
  17. ["folhacoca"] = { index = "folhacoca", nome = "Folha de cocaina" },
  18. ["podecocaina"] = { index = "podecocaina", nome = "Pó de cocaina" },
  19. ["vidroheroina"] = { index = "vidroheroina", nome = "Vidro de Heroina" },
  20. ["alianca"] = { index = "alianca", nome = "Aliança" },
  21. ["bandagem"] = { index = "bandagem", nome = "Bandagem" },
  22. ["cerveja"] = { index = "cerveja", nome = "Cerveja" },
  23. ["leite"] = { index = "leite", nome = "Leite" },
  24. ["tequila"] = { index = "tequila", nome = "Tequila" },
  25. ["vodka"] = { index = "vodka", nome = "Vodka" },
  26. ["whisky"] = { index = "whisky", nome = "Whisky" },
  27. ["conhaque"] = { index = "conhaque", nome = "Conhaque" },
  28. ["absinto"] = { index = "absinto", nome = "Absinto" },
  29. ["dinheirosujo"] = { index = "dinheirosujo", nome = "Dinheiro Sujo" },
  30. ["repairkit"] = { index = "repairkit", nome = "Kit de Reparos" },
  31. ["algemas"] = { index = "algemas", nome = "Algemas" },
  32. ["capuz"] = { index = "capuz", nome = "Capuz" },
  33. ["colete"] = { index = "colete", nome = "Colete" },
  34. ["lockpick"] = { index = "lockpick", nome = "Lockpick" },
  35. ["masterpick"] = { index = "masterpick", nome = "Masterpick" },
  36. ["militec"] = { index = "militec", nome = "Militec-1" },
  37. ["carnesilvestre"] = { index = "carnesilvestre", nome = "Carne de Silvestre" },
  38. ["carnelegal"] = { index = "carnelegal", nome = "Carne Legal" },
  39. ["isca"] = { index = "isca", nome = "Isca" },
  40. ["dourado"] = { index = "dourado", nome = "Dourado" },
  41. ["corvina"] = { index = "corvina", nome = "Corvina" },
  42. ["salmao"] = { index = "salmao", nome = "Salmão" },
  43. ["pacu"] = { index = "pacu", nome = "Pacu" },
  44. ["pintado"] = { index = "pintado", nome = "Pintado" },
  45. ["pirarucu"] = { index = "pirarucu", nome = "Pirarucu" },
  46. ["tilapia"] = { index = "tilapia", nome = "Tilápia" },
  47. ["tucunare"] = { index = "tucunare", nome = "Tucunaré" },
  48. ["lambari"] = { index = "lambari", nome = "Lambari" },
  49. ["energetico"] = { index = "energetico", nome = "Energético" },
  50. ["mochila"] = { index = "mochila", nome = "Mochila" },
  51. ["weedseed"] = { index = "weedseed", nome = "Semente de Cannabis" },
  52. ["maconha"] = { index = "maconha", nome = "Maconha" },
  53. ["cocaina"] = { index = "cocaina", nome = "Cocaina" },
  54. ["heroina"] = { index = "heroina", nome = "Heroina" },
  55. ['mineriobronze'] = { index = "mineriobronze", name= "Minério de Bronze" },
  56. ['minerioferro'] = { index = "minerioferro", name= "Minério de Ferro" },
  57. ['minerioaco'] = { index = "minerioaco", name= "Minério de Aço" },
  58. ['minerioprata'] = { index = "minerioprata", name= "Minério de Prata" },
  59. ['minerioouro'] = { index = "minerioouro", name= "Minério de Ouro" },
  60. ['mineriorubi'] = { index = "mineriorubi", name= "Minério de Rubi" },
  61. ['minerioesmeralda'] = { index = "minerioesmeralda", name= "Minério de Esmeralda" },
  62. ['mineriosafira'] = { index = "mineriosafira", name= "Minério de Safira" },
  63. ['mineriodiamante'] = { index = "mineriodiamante", name= "Minério de Diamante" },
  64. ['mineriotopazio'] = { index = "mineriotopazio", name= "Minério de Topázio" },
  65. ['minerioametista'] = { index = "minerioametista", name= "Minério de Ametista" },
  66. ['bronze'] = { index = "bronze", name= "Bronze" },
  67. ['prata'] = { index = "prata", name= "Prata" },
  68. ['ouro'] = { index = "ouro", name= "Ouro" },
  69. ['rubi'] = { index = "rubi", name= "Rubi" },
  70. ['esmeralda'] = { index = "esmeralda", name= "Esmeralda" },
  71. ['safira'] = { index = "safira", name= "Safira" },
  72. ['croquettes'] = { index = "croquettes", name= "Croquettes" },
  73. ['diamante'] = { index = "diamante", name= "Diamante" },
  74. ['topazio'] = { index = "topazio", name= "Topázio" },
  75. ['ametista'] = { index = "ametista", name= "Ametista" },
  76. ["placa"] = { index = "placa", nome = "Placa" },
  77. ["rebite"] = { index = "rebite", nome = "Rebite" },
  78. ["carbono"] = { index = "carbono", nome = "Carbono" },
  79. ["ferro"] = { index = "ferro", nome = "Ferro" },
  80. ["aco"] = { index = "aco", nome = "Aço" },
  81. ["adubo"] = { index = "adubo", nome = "Adubo" },
  82. ["fertilizante"] = { index = "fertilizante", nome = "Fertilizante" },
  83. ["capsula"] = { index = "capsula", nome = "Cápsula" },
  84. ["polvora"] = { index = "polvora", nome = "Pólvora" },
  85. ["orgao"] = { index = "orgao", nome = "Órgão" },
  86. ["celular"] = { index = "celular", nome = "Celular" },
  87. ["etiqueta"] = { index = "etiqueta", nome = "Etiqueta" },
  88. ["pendrive"] = { index = "pendrive", nome = "Pendrive" },
  89. ["relogioroubado"] = { index = "relogioroubado", nome = "Relógio Roubado" },
  90. ["pulseiraroubada"] = { index = "pulseiraroubada", nome = "Pulseira Roubada" },
  91. ["anelroubado"] = { index = "anelroubado", nome = "Anel Roubado" },
  92. ["colarroubado"] = { index = "colarroubado", nome = "Colar Roubado" },
  93. ["brincoroubado"] = { index = "brincoroubado", nome = "Brinco Roubado" },
  94. ["carteiraroubada"] = { index = "carteiraroubada", nome = "Carteira Roubada" },
  95. ["carregadorroubado"] = { index = "carregadorroubado", nome = "Carregador Roubado" },
  96. ["tabletroubado"] = { index = "tabletroubado", nome = "Tablet Roubado" },
  97. ["sapatosroubado"] = { index = "sapatosroubado", nome = "Sapatos Roubado" },
  98. ["vibradorroubado"] = { index = "vibradorroubado", nome = "Vibrador Roubado" },
  99. ["perfumeroubado"] = { index = "perfumeroubado", nome = "Perfume Roubado" },
  100. ["maquiagemroubada"] = { index = "maquiagemroubada", nome = "Maquiagem Roubada" },
  101. ["wbody|WEAPON_DAGGER"] = { index = "adaga", nome = "Adaga" },
  102. ["wbody|WEAPON_BAT"] = { index = "beisebol", nome = "Taco de Beisebol" },
  103. ["wbody|WEAPON_BOTTLE"] = { index = "garrafa", nome = "Garrafa" },
  104. ["wbody|WEAPON_CROWBAR"] = { index = "cabra", nome = "Pé de Cabra" },
  105. ["wbody|WEAPON_FLASHLIGHT"] = { index = "lanterna", nome = "Lanterna" },
  106. ["wbody|WEAPON_GOLFCLUB"] = { index = "golf", nome = "Taco de Golf" },
  107. ["wbody|WEAPON_HAMMER"] = { index = "martelo", nome = "Martelo" },
  108. ["wbody|WEAPON_HATCHET"] = { index = "machado", nome = "Machado" },
  109. ["wbody|WEAPON_KNUCKLE"] = { index = "ingles", nome = "Soco-Inglês" },
  110. ["wbody|WEAPON_KNIFE"] = { index = "faca", nome = "Faca" },
  111. ["wbody|WEAPON_MACHETE"] = { index = "machete", nome = "Machete" },
  112. ["wbody|WEAPON_SWITCHBLADE"] = { index = "canivete", nome = "Canivete" },
  113. ["wbody|WEAPON_NIGHTSTICK"] = { index = "cassetete", nome = "Cassetete" },
  114. ["wbody|WEAPON_WRENCH"] = { index = "grifo", nome = "Chave de Grifo" },
  115. ["wbody|WEAPON_BATTLEAXE"] = { index = "batalha", nome = "Machado de Batalha" },
  116. ["wbody|WEAPON_POOLCUE"] = { index = "sinuca", nome = "Taco de Sinuca" },
  117. ["wbody|WEAPON_STONE_HATCHET"] = { index = "pedra", nome = "Machado de Pedra" },
  118. ["wbody|WEAPON_PISTOL"] = { index = "m1911", nome = "M1911" },
  119. ["wbody|WEAPON_PISTOL_MK2"] = { index = "fiveseven", nome = "FN Five Seven" },
  120. ["wbody|WEAPON_COMBATPISTOL"] = { index = "glock", nome = "Glock 19" },
  121. ["wbody|WEAPON_APPISTOL"] = { index = "vp9", nome = "Koch VP9" },
  122. ["wbody|WEAPON_STUNGUN"] = { index = "tazer", nome = "Tazer" },
  123. ["wbody|WEAPON_SNSPISTOL"] = { index = "hkp7m10", nome = "HK P7M10" },
  124. ["wbody|WEAPON_VINTAGEPISTOL"] = { index = "m1922", nome = "M1922" },
  125. ["wbody|WEAPON_REVOLVER"] = { index = "magnum44", nome = "Magnum 44" },
  126. ["wbody|WEAPON_MUSKET"] = { index = "winchester22", nome = "Winchester 22" },
  127. ["wbody|WEAPON_FLARE"] = { index = "sinalizador", nome = "Sinalizador" },
  128. ["wbody|WEAPON_BALL"] = { index = "bolinha", nome = "Bola de Baseball" },
  129. ["wbody|GADGET_PARACHUTE"] = { index = "paraquedas", nome = "Paraquedas" },
  130. ["wbody|WEAPON_FIREEXTINGUISHER"] = { index = "extintor", nome = "Extintor" },
  131. ["wbody|WEAPON_MICROSMG"] = { index = "uzi", nome = "Uzi" },
  132. ["wbody|WEAPON_SMG"] = { index = "mp5", nome = "MP5" },
  133. ["wbody|WEAPON_ASSAULTSMG"] = { index = "mtar21", nome = "MTAR-21" },
  134. ["wbody|WEAPON_COMBATPDW"] = { index = "sigsauer", nome = "Sig Sauer MPX" },
  135. ["wbody|WEAPON_PUMPSHOTGUN_MK2"] = { index = "remington", nome = "Remington 870" },
  136. ["wbody|WEAPON_CARBINERIFLE"] = { index = "m4a1", nome = "M4A1" },
  137. ["wbody|WEAPON_ASSAULTRIFLE"] = { index = "ak103", nome = "AK-103" },
  138. ["wbody|WEAPON_GUSENBERG"] = { index = "thompson", nome = "Thompson" },
  139. ["wbody|WEAPON_SMG_MK2"] = { index = "SMGMK2", nome = "SMG-MK2" },
  140. ["wbody|WEAPON_CARBINERIFLE_MK2"] = { index = "ADV", nome = "ADV" },
  141. ["wammo|WEAPON_BALL"] = { index = "m-bolinha", nome = "M-Bola de Baseball" },
  142. ["wammo|WEAPON_SMG_MK2"] = { index = "m-SMGMK2", nome = "Munição de SMG-MK2" },
  143. ["wammo|WEAPON_PISTOL"] = { index = "m-m1911", nome = "Munição de M1911" },
  144. ["wammo|WEAPON_PISTOL_MK2"] = { index = "m-fiveseven", nome = "Munição de FN Five Seven" },
  145. ["wammo|WEAPON_COMBATPISTOL"] = { index = "m-glock", nome = "Munição de Glock 19" },
  146. ["wammo|WEAPON_APPISTOL"] = { index = "m-vp9", nome = "Munição de Koch VP9" },
  147. ["wammo|WEAPON_STUNGUN"] = { index = "m-tazer", nome = "Munição de Tazer" },
  148. ["wammo|WEAPON_SNSPISTOL"] = { index = "m-hkp7m10", nome = "Munição de HK P7M10" },
  149. ["wammo|WEAPON_VINTAGEPISTOL"] = { index = "m-m1922", nome = "Munição de M1922" },
  150. ["wammo|WEAPON_REVOLVER"] = { index = "m-magnum44", nome = "Munição de Magnum 44" },
  151. ["wammo|WEAPON_MUSKET"] = { index = "m-winchester22", nome = "Munição de Winchester 22" },
  152. ["wammo|WEAPON_FLARE"] = { index = "m-sinalizador", nome = "Munição de Sinalizador" },
  153. ["wammo|GADGET_PARACHUTE"] = { index = "m-paraquedas", nome = "Munição de Paraquedas" },
  154. ["wammo|WEAPON_FIREEXTINGUISHER"] = { index = "m-extintor", nome = "Munição de Extintor" },
  155. ["wammo|WEAPON_MICROSMG"] = { index = "m-uzi", nome = "Munição de Uzi" },
  156. ["wammo|WEAPON_SMG"] = { index = "m-mp5", nome = "Munição de MP5" },
  157. ["wammo|WEAPON_ASSAULTSMG"] = { index = "m-mtar21", nome = "Munição de MTAR-21" },
  158. ["wammo|WEAPON_COMBATPDW"] = { index = "m-sigsauer", nome = "Munição de Sig Sauer MPX" },
  159. ["wammo|WEAPON_PUMPSHOTGUN_MK2"] = { index = "m-remington", nome = "Munição de Remington 870" },
  160. ["wammo|WEAPON_CARBINERIFLE"] = { index = "m-m4a1", nome = "Munição de M4A1" },
  161. ["wammo|WEAPON_ASSAULTRIFLE"] = { index = "m-ak103", nome = "Munição de AK-103" },
  162. ["wammo|WEAPON_GUSENBERG"] = { index = "m-thompson", nome = "Munição de Thompson" },
  163. ["wammo|WEAPON_PETROLCAN"] = { index = "combustivel", nome = "Combustível" },
  164. ["wbody|WEAPON_PETROLCAN"] = { index = "gasolina", nome = "Galão de Gasolina" },
  165. ["wammo|WEAPON_CARBINERIFLE_MK2"] = { index = "m-ADV", nome = "m-ADV" },
  166. }
  167. -----------------------------------------------------------------------------------------------------------------------------------------
  168. -- ITEM
  169. -----------------------------------------------------------------------------------------------------------------------------------------
  170. RegisterCommand('item',function(source,args,rawCommand)
  171. local user_id = vRP.getUserId(source)
  172. if vRP.hasPermission(user_id,"admin.permissao") then
  173. if args[1] and args[2] and itemlist[args[1]] ~= nil then
  174. vRP.giveInventoryItem(user_id,args[1],parseInt(args[2]))
  175. end
  176. end
  177. end)
  178. -----------------------------------------------------------------------------------------------------------------------------------------
  179. -- GUARDA COLETE
  180. -----------------------------------------------------------------------------------------------------------------------------------------
  181. RegisterCommand('gcolete',function(source,args,rawCommand)
  182. local source = source
  183. local user_id = vRP.getUserId(source)
  184. local colete = 0
  185. local datacolete = vRP.getUData(user_id,"vRP:datatable")
  186. local coletedata = json.decode(datacolete)
  187. local mycolete = coletedata.colete
  188. if mycolete == 100 then
  189. vRP.giveInventoryItem(user_id,"colete",1)
  190. vRPclient.setArmour(source,0)
  191. elseif mycolete > 0 and mycolete < 100 then
  192. TriggerClientEvent("Notify",source,"negado","Seu <b>Colete</b> precisa estar inteiro.")
  193. elseif mycolete == 0 then
  194. TriggerClientEvent("Notify",source,"negado","Você não tem nenhum <b>Colete</b>.")
  195. end
  196. end)
  197. -----------------------------------------------------------------------------------------------------------------------------------------
  198. -- PLAYERS ONLINE
  199. -----------------------------------------------------------------------------------------------------------------------------------------
  200. RegisterCommand('players',function(source,args,rawCommand)
  201. local onlinePlayers = GetNumPlayerIndices()
  202. TriggerClientEvent("Notify",source,"importante","<b>Jogadores Online: "..onlinePlayers.."</b>")
  203. end)
  204. -----------------------------------------------------------------------------------------------------------------------------------------
  205. -- /EQUIPAR
  206. -----------------------------------------------------------------------------------------------------------------------------------------
  207. -- RegisterCommand('equipar',function(source,args,rawCommand)
  208. -- for k,v in pairs(itemlist) do
  209. -- if args[1] == v.index and args[1] ~= "mochila" then
  210. -- local user_id = vRP.getUserId(source)
  211. -- if vRP.tryGetInventoryItem(user_id,k,1) then
  212. -- local weapons = {}
  213. -- weapons[string.gsub(k,"wbody|","")] = { ammo = 0 }
  214. -- vRPclient._giveWeapons(source,weapons)
  215. -- vRP.logs("savedata/armamento.txt","[ID]: "..user_id.." / [FUNÇÃO]: Equipar / [ARMA]: "..v.index)
  216. -- else
  217. -- TriggerClientEvent("Notify",source,"negado","Armamento não encontrado.")
  218. -- end
  219. -- end
  220. -- end
  221. -- end)
  222. -----------------------------------------------------------------------------------------------------------------------------------------
  223. -- /RECARREGAR
  224. -----------------------------------------------------------------------------------------------------------------------------------------
  225. -- RegisterCommand('recarregar',function(source,args,rawCommand)
  226. -- for k,v in pairs(itemlist) do
  227. -- if args[1] == v.index and args[1] ~= "mochila" then
  228. -- local uweapons = vRPclient.getWeapons(source)
  229. -- local weaponuse = string.gsub(k,"wbody|","")
  230. -- if uweapons[weaponuse] then
  231. -- local user_id = vRP.getUserId(source)
  232. -- if vRP.tryGetInventoryItem(user_id,"wammo|"..weaponuse,parseInt(args[2])) then
  233. -- local weapons = {}
  234. -- weapons[weaponuse] = { ammo = parseInt(args[2]) }
  235. -- vRPclient._giveWeapons(source,weapons,false)
  236. -- vRP.logs("savedata/armamento.txt","[ID]: "..user_id.." / [FUNÇÃO]: Recarregar / [ARMA]: "..v.index)
  237. -- else
  238. -- TriggerClientEvent("Notify",source,"negado","Munição não encontrada.")
  239. -- end
  240. -- else
  241. -- TriggerClientEvent("Notify",source,"importante","Equipe o armamento antes.")
  242. -- end
  243. -- end
  244. -- end
  245. -- end)
  246. -----------------------------------------------------------------------------------------------------------------------------------------
  247. -- /MOC
  248. -----------------------------------------------------------------------------------------------------------------------------------------
  249. -- RegisterCommand('moc',function(source,args,rawCommand)
  250. -- local user_id = vRP.getUserId(source)
  251. -- if user_id then
  252. -- local data = vRP.getUserDataTable(user_id)
  253. -- if data then
  254. -- TriggerClientEvent('chatMessage',source,"",{},"^4- -  ^5M O C H I L A^4  - - - - - - - - - - - - - - - - - - - - - - - - - - -  [  ^3"..string.format("%.2f",vRP.getInventoryWeight(user_id)).."kg^4  /  ^3"..string.format("%.2f",vRP.getInventoryMaxWeight(user_id)).."kg^4  ]  - -")
  255. -- for k,v in pairs(data.inventory) do
  256. -- if k and v then
  257. -- TriggerClientEvent('chatMessage',source,"",{},"     "..vRP.format(parseInt(v.amount)).."x "..itemlist[k].nome.."^2    |    "..itemlist[k].index)
  258. -- end
  259. -- end
  260. -- end
  261. -- end
  262. -- end)
  263. -----------------------------------------------------------------------------------------------------------------------------------------
  264. -- /DROPAR
  265. -----------------------------------------------------------------------------------------------------------------------------------------
  266. RegisterCommand('dropar',function(source,args,rawCommand)
  267. local user_id = vRP.getUserId(source)
  268. if user_id and args[1] then
  269. local px,py,pz = vRPclient.getPosition(source)
  270. for k,v in pairs(itemlist) do
  271. if args[1] == v.index then
  272. if args[2] and parseInt(args[2]) > 0 then
  273. if vRP.tryGetInventoryItem(user_id,k,parseInt(args[2])) then
  274. TriggerEvent("DropSystem:create",k,parseInt(args[2]),px,py,pz)
  275. vRPclient._playAnim(source,true,{{"pickup_object","pickup_low"}},false)
  276. vRP.logs("savedata/dropar.txt","[ID]: "..user_id.." / [ITEM]: "..k.." / [QTD]: "..parseInt(args[2]))
  277. end
  278. else
  279. local data = vRP.getUserDataTable(user_id)
  280. for i,o in pairs(data.inventory) do
  281. if itemlist[i].index == args[1] then
  282. if vRP.tryGetInventoryItem(user_id,k,parseInt(o.amount)) then
  283. TriggerEvent("DropSystem:create",k,parseInt(o.amount),px,py,pz)
  284. vRPclient._playAnim(source,true,{{"pickup_object","pickup_low"}},false)
  285. vRP.logs("savedata/dropar.txt","[ID]: "..user_id.." / [ITEM]: "..k.." / [QTD]: "..parseInt(o.amount))
  286. end
  287. end
  288. end
  289. end
  290. end
  291. end
  292. end
  293. end)
  294. -----------------------------------------------------------------------------------------------------------------------------------------
  295. -- /REVISTAR
  296. -----------------------------------------------------------------------------------------------------------------------------------------
  297. RegisterCommand('revistar',function(source,args,rawCommand)
  298. local user_id = vRP.getUserId(source)
  299. local nplayer = vRPclient.getNearestPlayer(source,2)
  300. local nuser_id = vRP.getUserId(nplayer)
  301. if nuser_id then
  302. local identity = vRP.getUserIdentity(user_id)
  303. local weapons = vRPclient.getWeapons(nplayer)
  304. local money = vRP.getMoney(nuser_id)
  305. local data = vRP.getUserDataTable(nuser_id)
  306. TriggerClientEvent('chatMessage',source,"",{},"^4- -  ^5M O C H I L A^4  - - - - - - - - - - - - - - - - - - - - - - - - - - -  [  ^3"..string.format("%.2f",vRP.getInventoryWeight(nuser_id)).."kg^4  /  ^3"..string.format("%.2f",vRP.getInventoryMaxWeight(nuser_id)).."kg^4  ]  - -")
  307. if data and data.inventory then
  308. for k,v in pairs(data.inventory) do
  309. TriggerClientEvent('chatMessage',source,"",{},"     "..vRP.format(parseInt(v.amount)).."x "..itemlist[k].nome)
  310. end
  311. end
  312. TriggerClientEvent('chatMessage',source,"",{},"^4- -  ^5E Q U I P A D O^4  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -")
  313. for k,v in pairs(weapons) do
  314. if v.ammo < 1 then
  315. TriggerClientEvent('chatMessage',source,"",{},"     1x "..itemlist["wbody|"..k].nome)
  316. else
  317. TriggerClientEvent('chatMessage',source,"",{},"     1x "..itemlist["wbody|"..k].nome.." | "..vRP.format(parseInt(v.ammo)).."x Munições")
  318. end
  319. end
  320. TriggerClientEvent('chatMessage',source,"",{},"     $"..vRP.format(parseInt(money)).." Dólares")
  321. TriggerClientEvent("Notify",nplayer,"aviso","Revistado por <b>"..identity.name.." "..identity.firstname.."</b>.")
  322. end
  323. end)
  324. -----------------------------------------------------------------------------------------------------------------------------------------
  325. -- SALÁRIO
  326. -----------------------------------------------------------------------------------------------------------------------------------------
  327. local salarios = {
  328. { ['permissao'] = "bronze.permissao", ['nome'] = "BRONZE", ['payment'] = 1500 },
  329. { ['permissao'] = "prata.permissao", ['nome'] = "PRATA", ['payment'] = 2500 },
  330. { ['permissao'] = "ouro.permissao", ['nome'] = "OURO", ['payment'] = 3500 },
  331. { ['permissao'] = "platina.permissao", ['nome'] = "PLATINA", ['payment'] = 5000 },
  332. { ['permissao'] = "policia.permissao", ['nome'] = "POLICIA", ['payment'] = 3000 },
  333. { ['permissao'] = "paramedico.permissao", ['nome'] = "PARAMEDICO", ['payment'] = 5500 },
  334. { ['permissao'] = "taxista.permissao", ['nome'] = "TAXISTA", ['payment'] = 500 }
  335. }
  336.  
  337. RegisterServerEvent('salario:pagamento')
  338. AddEventHandler('salario:pagamento',function()
  339. local source = source
  340. local user_id = vRP.getUserId(source)
  341. if user_id then
  342. for k,v in pairs(salarios) do
  343. if vRP.hasPermission(user_id,v.permissao) then
  344. TriggerClientEvent("Notify",source,"importante","Obrigado por colaborar com a cidade, sua recompensa foi depositada.")
  345. vRP.giveBankMoney(user_id,parseInt(v.payment))
  346. vRP.logs("savedata/salario.txt","[ID]: "..user_id)
  347. end
  348. end
  349. end
  350. end)
  351. -----------------------------------------------------------------------------------------------------------------------------------------
  352. -- NOCARJACK
  353. -----------------------------------------------------------------------------------------------------------------------------------------
  354. local veiculos = {}
  355. veiculos["CLONADOS"] = true
  356. RegisterServerEvent("TryDoorsEveryone")
  357. AddEventHandler("TryDoorsEveryone",function(veh,doors,placa)
  358. if not veiculos[placa] then
  359. TriggerClientEvent("SyncDoorsEveryone",-1,veh,doors)
  360. veiculos[placa] = true
  361. end
  362. end)
  363. -----------------------------------------------------------------------------------------------------------------------------------------
  364. -- AFKSYSTEM
  365. -----------------------------------------------------------------------------------------------------------------------------------------
  366. -- [[RegisterServerEvent("kickAFK")
  367. -- AddEventHandler("kickAFK",function()
  368. -- local source = source
  369. -- local user_id = vRP.getUserId(source)
  370. -- if not vRP.hasPermission(user_id,"admin.permissao") then
  371. -- DropPlayer(source,"Voce foi desconectado por ficar ausente.")
  372. -- end
  373. -- end)]]
  374. -----------------------------------------------------------------------------------------------------------------------------------------
  375. -- /SEQUESTRO
  376. -----------------------------------------------------------------------------------------------------------------------------------------
  377. RegisterCommand('sequestro',function(source,args,rawCommand)
  378. local nplayer = vRPclient.getNearestPlayer(source,5)
  379. if nplayer then
  380. if vRPclient.isHandcuffed(nplayer) then
  381. if not vRPclient.getNoCarro(source) then
  382. local vehicle = vRPclient.getNearestVehicle(source,7)
  383. if vehicle then
  384. if vRPclient.getCarroClass(source,vehicle) then
  385. vRPclient.setMalas(nplayer)
  386. end
  387. end
  388. elseif vRPclient.isMalas(nplayer) then
  389. vRPclient.setMalas(nplayer)
  390. end
  391. else
  392. TriggerClientEvent("Notify",source,"aviso","A pessoa precisa estar algemada para colocar ou retirar do Porta-Malas.")
  393. end
  394. end
  395. end)
  396. -----------------------------------------------------------------------------------------------------------------------------------------
  397. -- ALERTAS
  398. -----------------------------------------------------------------------------------------------------------------------------------------
  399. RegisterCommand('alertas',function(source,args,rawCommand)
  400. local user_id = vRP.getUserId(source)
  401. if vRP.hasPermission(user_id,"alertas.permissao") then
  402. vRP.removeUserGroup(user_id,"Alertas")
  403. TriggerClientEvent("Notify",source,"importante","Você removeu as notificações.")
  404. else
  405. vRP.addUserGroup(user_id,"Alertas")
  406. TriggerClientEvent("Notify",source,"sucesso","Você ativou as notificações.")
  407. end
  408. end)
  409. -----------------------------------------------------------------------------------------------------------------------------------------
  410. -- TRATAMENTO
  411. -----------------------------------------------------------------------------------------------------------------------------------------
  412. RegisterCommand('tratamento',function(source,args,rawCommand)
  413. local user_id = vRP.getUserId(source)
  414. if vRP.hasPermission(user_id,"paramedico.permissao") then
  415. local nplayer = vRPclient.getNearestPlayer(source,3)
  416. if nplayer then
  417. TriggerClientEvent('tratamento',nplayer)
  418. TriggerClientEvent("Notify",nplayer,"sucesso","Tratamento iniciado, aguarde a liberação do paramédico.")
  419. TriggerClientEvent("Notify",source,"sucesso","Tratamento no paciente iniciado com sucesso.")
  420. end
  421. end
  422. end)
  423. -----------------------------------------------------------------------------------------------------------------------------------------
  424. -- CASAS
  425. -----------------------------------------------------------------------------------------------------------------------------------------
  426. RegisterCommand('casas',function(source,args,rawCommand)
  427. local user_id = vRP.getUserId(source)
  428. if args[1] and vRP.hasPermission(user_id,"policia.permissao") then
  429. local nplayer = vRP.getUserSource(parseInt(args[1]))
  430. if nplayer == nil then
  431. return
  432. end
  433. user_id = vRP.getUserId(nplayer)
  434. end
  435. if user_id then
  436. local address = vRP.getUserAddress(user_id)
  437. local casas = ""
  438. if args[1] then
  439. if #address > 0 then
  440. for k,v in pairs(address) do
  441. casas = casas..v.home.." - Nº"..v.number
  442. if k ~= #address then
  443. casas = casas..", "
  444. end
  445. end
  446. TriggerClientEvent("Notify",source,"importante","Residências possuidas pelo passaporte <b>"..vRP.format(parseInt(args[1])).."</b>: "..casas)
  447. else
  448. TriggerClientEvent("Notify",source,"negado","Passaporte <b>"..vRP.format(parseInt(args[1])).."</b> não possui residências.")
  449. end
  450. else
  451. if #address > 0 then
  452. for k,v in pairs(address) do
  453. casas = casas..v.home.." - Nº"..v.number
  454. if k ~= #address then
  455. casas = casas..", "
  456. end
  457. end
  458. TriggerClientEvent("Notify",source,"importante","Residências possuidas: "..casas)
  459. else
  460. TriggerClientEvent("Notify",source,"importante","Não possui residências em seu nome.")
  461. end
  462. end
  463. end
  464. end)
  465. -----------------------------------------------------------------------------------------------------------------------------------------
  466. -- MOTOR
  467. -----------------------------------------------------------------------------------------------------------------------------------------
  468. -- RegisterCommand('motor',function(source,args,rawCommand)
  469. -- local user_id = vRP.getUserId(source)
  470. -- if not vRPclient.isInVehicle(source) then
  471. -- local vehicle = vRPclient.getNearestVehicle(source,7)
  472. -- if vRP.hasPermission(user_id,"mecanico.permissao") then
  473. -- TriggerClientEvent('cancelando',source,true)
  474. -- vRPclient._playAnim(source,false,{{"mini@repair","fixing_a_player"}},true)
  475. -- TriggerClientEvent("progress",source,30000,"reparando")
  476. -- SetTimeout(30000,function()
  477. -- TriggerClientEvent('cancelando',source,false)
  478. -- TriggerClientEvent('repararmotor',source,vehicle)
  479. -- vRPclient._stopAnim(source,false)
  480. -- end)
  481. -- else
  482. -- if vRP.tryGetInventoryItem(user_id,"militec",1) then
  483. -- TriggerClientEvent('cancelando',source,true)
  484. -- vRPclient._playAnim(source,false,{{"mini@repair","fixing_a_player"}},true)
  485. -- TriggerClientEvent("progress",source,30000,"reparando")
  486. -- SetTimeout(30000,function()
  487. -- TriggerClientEvent('cancelando',source,false)
  488. -- TriggerClientEvent('repararmotor',source,vehicle)
  489. -- vRPclient._stopAnim(source,false)
  490. -- end)
  491. -- else
  492. -- TriggerClientEvent("Notify",source,"negado","Precisa de um <b>Militec-1</b> para reparar o motor.")
  493. -- end
  494. -- end
  495. -- else
  496. -- TriggerClientEvent("Notify",source,"negado","Precisa estar próximo ou fora do veículo para efetuar os reparos.")
  497. -- end
  498. -- end)
  499.  
  500. -- RegisterServerEvent("trymotor")
  501. -- AddEventHandler("trymotor",function(nveh)
  502. -- TriggerClientEvent("syncmotor",-1,nveh)
  503. -- end)
  504. -----------------------------------------------------------------------------------------------------------------------------------------
  505. -- REPARAR
  506. -----------------------------------------------------------------------------------------------------------------------------------------
  507. RegisterCommand('reparar',function(source,args,rawCommand)
  508. local user_id = vRP.getUserId(source)
  509. if not vRPclient.isInVehicle(source) then
  510. local vehicle = vRPclient.getNearestVehicle(source,7)
  511. if vRP.hasPermission(user_id,"mecanico.permissao") then
  512. TriggerClientEvent('cancelando',source,true)
  513. vRPclient._playAnim(source,false,{{"mini@repair","fixing_a_player"}},true)
  514. TriggerClientEvent("progress",source,30000,"reparando")
  515. SetTimeout(30000,function()
  516. TriggerClientEvent('cancelando',source,false)
  517. TriggerClientEvent('reparar',source,vehicle)
  518. vRPclient._stopAnim(source,false)
  519. end)
  520. else
  521. if vRP.tryGetInventoryItem(user_id,"repairkit",1) then
  522. TriggerClientEvent('cancelando',source,true)
  523. vRPclient._playAnim(source,false,{{"mini@repair","fixing_a_player"}},true)
  524. TriggerClientEvent("progress",source,30000,"reparando")
  525. SetTimeout(30000,function()
  526. TriggerClientEvent('cancelando',source,false)
  527. TriggerClientEvent('reparar',source,vehicle)
  528. vRPclient._stopAnim(source,false)
  529. end)
  530. else
  531. TriggerClientEvent("Notify",source,"negado","Precisa de um <b>Kit de Reparos</b> para reparar o veículo.")
  532. end
  533. end
  534. else
  535. TriggerClientEvent("Notify",source,"negado","Precisa estar próximo ou fora do veículo para efetuar os reparos.")
  536. end
  537. end)
  538.  
  539. RegisterServerEvent("tryreparar")
  540. AddEventHandler("tryreparar",function(nveh)
  541. TriggerClientEvent("syncreparar",-1,nveh)
  542. end)
  543. -----------------------------------------------------------------------------------------------------------------------------------------
  544. -- ENVIAR
  545. -----------------------------------------------------------------------------------------------------------------------------------------
  546. RegisterCommand('enviar',function(source,args,rawCommand)
  547. local user_id = vRP.getUserId(source)
  548. local nplayer = vRPclient.getNearestPlayer(source,2)
  549. local nuser_id = vRP.getUserId(nplayer)
  550. if nuser_id and args[1] and parseInt(args[2]) > 0 then
  551. for k,v in pairs(itemlist) do
  552. if args[1] == v.index then
  553. if vRP.getInventoryWeight(nuser_id)+vRP.getItemWeight(k)*parseInt(args[2]) <= vRP.getInventoryMaxWeight(nuser_id) then
  554. if vRP.tryGetInventoryItem(user_id,k,parseInt(args[2])) then
  555. vRP.giveInventoryItem(nuser_id,k,parseInt(args[2]))
  556. vRPclient._playAnim(source,true,{{"mp_common","givetake1_a"}},false)
  557. TriggerClientEvent("Notify",source,"sucesso","Enviou <b>"..parseInt(args[2]).."x "..v.nome.."</b>.")
  558. TriggerClientEvent("Notify",nplayer,"sucesso","Recebeu <b>"..parseInt(args[2]).."x "..v.nome.."</b>.")
  559. vRP.logs("savedata/enviar.txt","[ID]: "..user_id.." / [NID]: "..nuser_id.." / [ITEM]: "..k)
  560. end
  561. end
  562. end
  563. end
  564. elseif nuser_id and parseInt(args[1]) > 0 then
  565. if vRP.tryPayment(user_id,parseInt(args[1])) then
  566. vRP.giveMoney(nuser_id,parseInt(args[1]))
  567. vRPclient._playAnim(source,true,{{"mp_common","givetake1_a"}},false)
  568. TriggerClientEvent("Notify",source,"sucesso","Enviou <b>$"..vRP.format(parseInt(args[1])).." dólares</b>.")
  569. TriggerClientEvent("Notify",nplayer,"sucesso","Recebeu <b>$"..vRP.format(parseInt(args[1])).." dólares</b>.")
  570. vRP.logs("savedata/enviar.txt","[ID]: "..user_id.." / [NID]: "..nuser_id.." / [VALOR]: "..parseInt(args[1]))
  571. else
  572. TriggerClientEvent("Notify",source,"negado","Não tem a quantia que deseja enviar.")
  573. end
  574. end
  575. end)
  576. -----------------------------------------------------------------------------------------------------------------------------------------
  577. -- GARMAS
  578. -----------------------------------------------------------------------------------------------------------------------------------------
  579. RegisterCommand('garmas',function(source,args,rawCommand)
  580. local user_id = vRP.getUserId(source)
  581. if user_id then
  582. local weapons = vRPclient.replaceWeapons(source,{})
  583. for k,v in pairs(weapons) do
  584. vRP.giveInventoryItem(user_id,"wbody|"..k,1)
  585. if v.ammo > 0 then
  586. vRP.giveInventoryItem(user_id,"wammo|"..k,v.ammo)
  587. end
  588. end
  589. TriggerClientEvent("Notify",source,"sucesso","Guardou seu armamento na mochila.")
  590. end
  591. end)
  592. -----------------------------------------------------------------------------------------------------------------------------------------
  593. -- CLONEPLATE
  594. -----------------------------------------------------------------------------------------------------------------------------------------
  595. RegisterCommand('cloneplate',function(source,args,rawCommand)
  596. local user_id = vRP.getUserId(source)
  597. if user_id then
  598. if vRPclient.isInVehicle(source) and vRP.tryGetInventoryItem(user_id,"placa",1) then
  599. TriggerClientEvent("cloneplates",source)
  600. end
  601. end
  602. end)
  603. -----------------------------------------------------------------------------------------------------------------------------------------
  604. -- RG
  605. -----------------------------------------------------------------------------------------------------------------------------------------
  606. RegisterCommand('rg', function(source, args, rawCommand) -- ready
  607. local user_id = vRP.getUserId(source)
  608. local identity = vRP.getUserIdentity(user_id)
  609. local firstname = identity.firstname
  610. local name = identity.name
  611. local registration = identity.registration
  612. local age = identity.age
  613. local money = vRP.getMoney(user_id)
  614. local phone = identity.phone
  615. local multas = vRP.getUData(user_id, "vRP:Multas") or "0"
  616. local groupv = vRP.getUserGroupByType(user_id,"job") or "Desempregado"
  617. local groupname = vRP.getGroupTitle(groupv)
  618.  
  619. vRPclient.setDiv(source, "rg", "@import url(\"https://fonts.googleapis.com/css?family=Muli:300,400,700\");.clear{clear: both;}#DocumentSection {background-color:#e3e3e3; width: 300px;min-height: 100px;border-radius: 35px;box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.08);text-align: center;position: absolute;right: 5%;bottom: 8%;font-family: 'Muli';color: #3c3c3c;padding-bottom: 15px;z-index: 1;overflow: hidden;}#DocumentSection:before, #DocumentSection:after {content: ' ';position: absolute;width: 200%;height: 200%;}#DocumentSection:before {background-color: #1A237E;top: -193%;left: -100%;transform: rotate(-5deg);z-index: 1;}#DocumentSection:after {background-color: #1565C0;top: -191%;left: -100%;transform: rotate(-6deg);z-index: 0;}#DocumentSection .avatar-img {width: 20%;margin: 50px auto 0 auto;}#DocumentSection .avatar-img img {width: 100%;}#DocumentSection .each-info {display: block;margin: 0;width: 70%;margin: 0 auto;}#DocumentSection .each-info.person-name {font-size: 20px;}#DocumentSection .each-info.person-age {font-size: 15px;}#DocumentSection .each-info.person-job {border-top: 1px solid rgba(0, 0, 0, 0.1);border-bottom: 1px solid rgba(0, 0, 0, 0.1);margin: 25px auto;padding: 10px 0;color: #1565C0;font-size: 18px;}#DocumentSection .secondary-info {margin-top: 15px;}#DocumentSection .secondary-info .clear {margin-bottom: 3px;display: block;}#DocumentSection .secondary-info .each-info strong {float: left;font-weight: 300;}#DocumentSection .secondary-info .each-info span {float: right;font-weight: bold;color: #1565C0;}","<div id=\"DocumentSection\"><div class=\"avatar-img\"><img src=\"https://www.moxtra.com/service/themes/images/default/avatar-single-360.png\"></div><div class=\"infos\"><div class=\"main-info\"><h1 class=\"each-info person-name\">"..firstname.." "..name.."</h1><h2 class=\"each-info person-age\">"..age.." anos</h2><h2 class=\"each-info person-job\">"..groupname.."</h2></div><div class=\"secondary-info\"><div class=\"each-info\"><strong>Passaporte:</strong><span class=\"person-id\">"..user_id.."</span></div><div class=\"clear\"></div><div class=\"each-info\"><strong>Registro: </strong><span class=\"person-passport\">"..registration.."</span></div><div class=\"clear\"></div><div class=\"each-info\"><strong>Telefone:</strong><span class=\"person-phone\">"..phone.."</span></div><div class=\"clear\"></div><div class=\"each-info\"><strong>Multas:</strong><span class=\"person-phone\">$"..multas.."</span></div><div class=\"clear\"></div><div class=\"each-info\"><strong>Carteira:</strong><span class=\"person-phone\">$"..money.."</span></div><div class=\"clear\"></div></div></div></div>", "")
  620. if vRP.request(source,"Deseja fechar o seu RG?",900) then
  621. vRPclient.removeDiv(source, "rg")
  622. else
  623. vRPclient.removeDiv(source, "rg")
  624. end
  625. end)
  626. -----------------------------------------------------------------------------------------------------------------------------------------
  627. -- MULTAS
  628. -----------------------------------------------------------------------------------------------------------------------------------------
  629. RegisterCommand('multas',function(source,args,rawCommand)
  630. local user_id = vRP.getUserId(source)
  631. local value = vRP.getUData(parseInt(user_id),"vRP:multas")
  632. local multas = json.decode(value) or 0
  633. if args[1] then
  634. if parseInt(multas) > 0 and parseInt(args[1]) > 0 and parseInt(args[1]) <= parseInt(multas) then
  635. if vRP.tryFullPayment(user_id,parseInt(args[1])) then
  636. vRP.setUData(user_id,"vRP:multas",json.encode(parseInt(multas)-parseInt(args[1])))
  637. TriggerClientEvent("Notify",source,"sucesso","Você pagou <b>$"..parseInt(args[1]).."</b> em multas")
  638. else
  639. TriggerClientEvent("Notify",source,"aviso","<b>Dinheiro Insuficiente</b>")
  640. end
  641. else
  642. TriggerClientEvent("Notify",source,"aviso","Valor inválido, verifique suas <b>multas pendentes</b>")
  643. end
  644. else
  645. if parseInt(multas) == 0 then
  646. TriggerClientEvent("Notify",source,"aviso","Você não tem <b>multas</b> para pagar")
  647. else
  648. TriggerClientEvent("Notify",source,"sucesso","Você tem <b>$"..parseInt(multas).."</b> em multas para pagar")
  649. end
  650. end
  651. end)
  652. -----------------------------------------------------------------------------------------------------------------------------------------
  653. -- ROUBAR
  654. -----------------------------------------------------------------------------------------------------------------------------------------
  655. RegisterCommand('roubar',function(source,args,rawCommand)
  656. local user_id = vRP.getUserId(source)
  657. local nplayer = vRPclient.getNearestPlayer(source,2)
  658. if nplayer then
  659. local nuser_id = vRP.getUserId(nplayer)
  660. local policia = vRP.getUsersByPermission("policia.permissao")
  661. if #policia >= 1 then
  662. if vRP.request(nplayer,"Você está sendo roubado, deseja passar tudo?",30) then
  663. local vida = vRPclient.getHealth(nplayer)
  664. if vida <= 100 then
  665. TriggerClientEvent('cancelando',source,true)
  666. vRPclient._playAnim(source,false,{{"amb@medic@standing@kneel@idle_a","idle_a"}},true)
  667. TriggerClientEvent("progress",source,30000,"roubando")
  668. SetTimeout(30000,function()
  669. local ndata = vRP.getUserDataTable(nuser_id)
  670. if ndata ~= nil then
  671. if ndata.inventory ~= nil then
  672. for k,v in pairs(ndata.inventory) do
  673. if vRP.getInventoryWeight(user_id)+vRP.getItemWeight(k)*v.amount <= vRP.getInventoryMaxWeight(user_id) then
  674. if vRP.tryGetInventoryItem(nuser_id,k,v.amount) then
  675. vRP.giveInventoryItem(user_id,k,v.amount)
  676. end
  677. else
  678. TriggerClientEvent("Notify",source,"negado","Mochila não suporta <b>"..vRP.format(parseInt(v.amount)).."x "..itemlist[k].nome.."</b> por causa do peso.")
  679. end
  680. end
  681. end
  682. end
  683. local weapons = vRPclient.replaceWeapons(nplayer,{})
  684. for k,v in pairs(weapons) do
  685. vRP.giveInventoryItem(nuser_id,"wbody|"..k,1)
  686. if vRP.getInventoryWeight(user_id)+vRP.getItemWeight("wbody|"..k) <= vRP.getInventoryMaxWeight(user_id) then
  687. if vRP.tryGetInventoryItem(nuser_id,"wbody|"..k,1) then
  688. vRP.giveInventoryItem(user_id,"wbody|"..k,1)
  689. end
  690. else
  691. TriggerClientEvent("Notify",source,"negado","Mochila não suporta <b>1x "..itemlist["wbody"..k].nome.."</b> por causa do peso.")
  692. end
  693. if v.ammo > 0 then
  694. vRP.giveInventoryItem(nuser_id,"wammo|"..k,v.ammo)
  695. if vRP.getInventoryWeight(user_id)+vRP.getItemWeight("wammo|"..k)*v.ammo <= vRP.getInventoryMaxWeight(user_id) then
  696. if vRP.tryGetInventoryItem(nuser_id,"wammo|"..k,v.ammo) then
  697. vRP.giveInventoryItem(user_id,"wammo|"..k,v.ammo)
  698. end
  699. else
  700. TriggerClientEvent("Notify",source,"negado","Mochila não suporta <b>"..vRP.format(parseInt(v.ammo)).."x "..itemlist["wammo|"..k].nome.."</b> por causa do peso.")
  701. end
  702. end
  703. end
  704. local nmoney = vRP.getMoney(nuser_id)
  705. if vRP.tryPayment(nuser_id,nmoney) then
  706. vRP.giveMoney(user_id,nmoney)
  707. end
  708. vRPclient.setStandBY(source,parseInt(600))
  709. vRPclient._stopAnim(source,false)
  710. TriggerClientEvent('cancelando',source,false)
  711. TriggerClientEvent("Notify",source,"importante","Roubo concluido com sucesso.")
  712. end)
  713. else
  714. local ndata = vRP.getUserDataTable(nuser_id)
  715. if ndata ~= nil then
  716. if ndata.inventory ~= nil then
  717. for k,v in pairs(ndata.inventory) do
  718. if vRP.getInventoryWeight(user_id)+vRP.getItemWeight(k)*v.amount <= vRP.getInventoryMaxWeight(user_id) then
  719. if vRP.tryGetInventoryItem(nuser_id,k,v.amount) then
  720. vRP.giveInventoryItem(user_id,k,v.amount)
  721. end
  722. else
  723. TriggerClientEvent("Notify",source,"negado","Mochila não suporta <b>"..vRP.format(parseInt(v.amount)).."x "..itemlist[k].nome.."</b> por causa do peso.")
  724. end
  725. end
  726. end
  727. end
  728. local weapons = vRPclient.replaceWeapons(nplayer,{})
  729. for k,v in pairs(weapons) do
  730. vRP.giveInventoryItem(nuser_id,"wbody|"..k,1)
  731. if vRP.getInventoryWeight(user_id)+vRP.getItemWeight("wbody|"..k) <= vRP.getInventoryMaxWeight(user_id) then
  732. if vRP.tryGetInventoryItem(nuser_id,"wbody|"..k,1) then
  733. vRP.giveInventoryItem(user_id,"wbody|"..k,1)
  734. end
  735. else
  736. TriggerClientEvent("Notify",source,"negado","Mochila não suporta <b>1x "..itemlist["wbody|"..k].nome.."</b> por causa do peso.")
  737. end
  738. if v.ammo > 0 then
  739. vRP.giveInventoryItem(nuser_id,"wammo|"..k,v.ammo)
  740. if vRP.getInventoryWeight(user_id)+vRP.getItemWeight("wammo|"..k)*v.ammo <= vRP.getInventoryMaxWeight(user_id) then
  741. if vRP.tryGetInventoryItem(nuser_id,"wammo|"..k,v.ammo) then
  742. vRP.giveInventoryItem(user_id,"wammo|"..k,v.ammo)
  743. end
  744. else
  745. TriggerClientEvent("Notify",source,"negado","Mochila não suporta <b>"..vRP.format(parseInt(v.ammo)).."x "..itemlist["wammo|"..k].nome.."</b> por causa do peso.")
  746. end
  747. end
  748. end
  749. local nmoney = vRP.getMoney(nuser_id)
  750. if vRP.tryPayment(nuser_id,nmoney) then
  751. vRP.giveMoney(user_id,nmoney)
  752. end
  753. vRPclient.setStandBY(source,parseInt(600))
  754. TriggerClientEvent("Notify",source,"importante","Roubo concluido com sucesso.")
  755. end
  756. else
  757. TriggerClientEvent("Notify",source,"aviso","A pessoa está resistindo ao roubo.")
  758. end
  759. else
  760. TriggerClientEvent("Notify",source,"negado","Número insuficiente de policiais no momento.")
  761. end
  762. end
  763. end)
  764. -----------------------------------------------------------------------------------------------------------------------------------------
  765. -- TRYTOW
  766. -----------------------------------------------------------------------------------------------------------------------------------------
  767. RegisterServerEvent("trytow")
  768. AddEventHandler("trytow",function(nveh,rveh)
  769. TriggerClientEvent("synctow",-1,nveh,rveh)
  770. end)
  771. -----------------------------------------------------------------------------------------------------------------------------------------
  772. -- TRUNK
  773. -----------------------------------------------------------------------------------------------------------------------------------------
  774. RegisterServerEvent("trytrunk")
  775. AddEventHandler("trytrunk",function(nveh)
  776. TriggerClientEvent("synctrunk",-1,nveh)
  777. end)
  778. -----------------------------------------------------------------------------------------------------------------------------------------
  779. -- WINS
  780. -----------------------------------------------------------------------------------------------------------------------------------------
  781. RegisterServerEvent("trywins")
  782. AddEventHandler("trywins",function(nveh)
  783. TriggerClientEvent("syncwins",-1,nveh)
  784. end)
  785. -----------------------------------------------------------------------------------------------------------------------------------------
  786. -- HOOD
  787. -----------------------------------------------------------------------------------------------------------------------------------------
  788. RegisterServerEvent("tryhood")
  789. AddEventHandler("tryhood",function(nveh)
  790. TriggerClientEvent("synchood",-1,nveh)
  791. end)
  792. -----------------------------------------------------------------------------------------------------------------------------------------
  793. -- DOORS
  794. -----------------------------------------------------------------------------------------------------------------------------------------
  795. RegisterServerEvent("trydoors")
  796. AddEventHandler("trydoors",function(nveh,door)
  797. TriggerClientEvent("syncdoors",-1,nveh,door)
  798. end)
  799. -----------------------------------------------------------------------------------------------------------------------------------------
  800. -- CALL
  801. -----------------------------------------------------------------------------------------------------------------------------------------
  802. local blips = {}
  803. RegisterCommand('chamar',function(source,args,rawCommand)
  804. local source = source
  805. local answered = false
  806. local user_id = vRP.getUserId(source)
  807. if user_id then
  808. local players = {}
  809. if args[1] == "911" then
  810. players = vRP.getUsersByPermission("policia.permissao")
  811. elseif args[1] == "112" then
  812. players = vRP.getUsersByPermission("paramedico.permissao")
  813. elseif args[1] == "mec" then
  814. players = vRP.getUsersByPermission("mecanico.permissao")
  815. elseif args[1] == "adm" then
  816. players = vRP.getUsersByPermission("chamado.permissao")
  817. elseif args[1] == "taxi" then
  818. players = vRP.getUsersByPermission("taxista.permissao")
  819. else
  820. TriggerClientEvent("Notify",source,"negado","Serviço inexistente.")
  821. return
  822. end
  823.  
  824. local descricao = vRP.prompt(source,"Descrição:","")
  825. if descricao == "" then
  826. return
  827. end
  828.  
  829. local identitys = vRP.getUserIdentity(user_id)
  830. TriggerClientEvent("Notify",source,"sucesso","Chamado enviado com sucesso.")
  831. for l,w in pairs(players) do
  832. local player = vRP.getUserSource(parseInt(w))
  833. local nuser_id = vRP.getUserId(player)
  834. local x,y,z = vRPclient.getPosition(source)
  835. local uplayer = vRP.getUserSource(user_id)
  836. if player and player ~= uplayer then
  837. async(function()
  838. vRPclient.playSound(player,"Out_Of_Area","DLC_Lowrider_Relay_Race_Sounds")
  839. TriggerClientEvent('chatMessage',player,"CHAMADO",{19,197,43},"Enviado por ^1"..identitys.name.." "..identitys.firstname.."^0, "..descricao)
  840. local ok = vRP.request(player,"Aceitar o chamado de <b>"..identitys.name.." "..identitys.firstname.."</b>?",30)
  841. if ok then
  842. if not answered then
  843. answered = true
  844. local identity = vRP.getUserIdentity(nuser_id)
  845. TriggerClientEvent("Notify",source,"importante","Chamado atendido por <b>"..identity.name.." "..identity.firstname.."</b>, aguarde no local.")
  846. vRPclient.playSound(source,"Event_Message_Purple","GTAO_FM_Events_Soundset")
  847. vRPclient._setGPS(player,x,y)
  848. else
  849. TriggerClientEvent("Notify",player,"negado","Chamado ja foi atendido por outra pessoa.")
  850. vRPclient.playSound(player,"CHECKPOINT_MISSED","HUD_MINI_GAME_SOUNDSET")
  851. end
  852. end
  853. local id = idgens:gen()
  854. blips[id] = vRPclient.addBlip(player,x,y,z,358,71,"Chamado",0.6,false)
  855. SetTimeout(300000,function() vRPclient.removeBlip(player,blips[id]) idgens:free(id) end)
  856. end)
  857. end
  858. end
  859. end
  860. end)
  861. -----------------------------------------------------------------------------------------------------------------------------------------
  862. -- P
  863. -----------------------------------------------------------------------------------------------------------------------------------------
  864. local policia = {}
  865. RegisterCommand('p',function(source,args,rawCommand)
  866. local user_id = vRP.getUserId(source)
  867. local uplayer = vRP.getUserSource(user_id)
  868. local identity = vRP.getUserIdentity(user_id)
  869. local x,y,z = vRPclient.getPosition(source)
  870. if vRPclient.getHealth(source) > 100 then
  871. if vRP.hasPermission(user_id,"policia.permissao") then
  872. local soldado = vRP.getUsersByPermission("policia.permissao")
  873. for l,w in pairs(soldado) do
  874. local player = vRP.getUserSource(parseInt(w))
  875. if player and player ~= uplayer then
  876. async(function()
  877. local id = idgens:gen()
  878. policia[id] = vRPclient.addBlip(player,x,y,z,153,84,"Localização de "..identity.name.." "..identity.firstname,0.5,false)
  879. TriggerClientEvent("Notify",player,"importante","Localização recebida de <b>"..identity.name.." "..identity.firstname.."</b>.")
  880. vRPclient._playSound(player,"Place_Prop_Fail","DLC_Dmod_Prop_Editor_Sounds")
  881. SetTimeout(60000,function() vRPclient.removeBlip(player,policia[id]) idgens:free(id) end)
  882. end)
  883. end
  884. end
  885. end
  886. end
  887. end)
  888. -----------------------------------------------------------------------------------------------------------------------------------------
  889. -- 911
  890. -----------------------------------------------------------------------------------------------------------------------------------------
  891. RegisterCommand('911',function(source,args,rawCommand)
  892. if args[1] then
  893. local user_id = vRP.getUserId(source)
  894. local identity = vRP.getUserIdentity(user_id)
  895. if user_id then
  896. TriggerClientEvent('chatMessage',-1,identity.name.." "..identity.firstname,{65,130,255},rawCommand:sub(4))
  897. end
  898. end
  899. end)
  900. -----------------------------------------------------------------------------------------------------------------------------------------
  901. -- 112
  902. -----------------------------------------------------------------------------------------------------------------------------------------
  903. RegisterCommand('112',function(source,args,rawCommand)
  904. if args[1] then
  905. local user_id = vRP.getUserId(source)
  906. local identity = vRP.getUserIdentity(user_id)
  907. if user_id then
  908. TriggerClientEvent('chatMessage',-1,identity.name.." "..identity.firstname,{255,70,135},rawCommand:sub(4))
  909. end
  910. end
  911. end)
  912. -----------------------------------------------------------------------------------------------------------------------------------------
  913. -- Twitter
  914. -----------------------------------------------------------------------------------------------------------------------------------------
  915. RegisterCommand('twt',function(source,args,rawCommand)
  916. if args[1] then
  917. local user_id = vRP.getUserId(source)
  918. local identity = vRP.getUserIdentity(user_id)
  919. if user_id then
  920. TriggerClientEvent('chatMessage',-1,identity.name.." "..identity.firstname,{29,161,242},rawCommand:sub(4))
  921. end
  922. end
  923. end)
  924. -----------------------------------------------------------------------------------------------------------------------------------------
  925. -- Ilegal
  926. -----------------------------------------------------------------------------------------------------------------------------------------
  927. RegisterCommand('ilegal',function(source,args,rawCommand)
  928. if args[1] then
  929. local user_id = vRP.getUserId(source)
  930. local identity = vRP.getUserIdentity(user_id)
  931. if user_id then
  932. TriggerClientEvent('chatMessage',-1," ",{29,161,242},rawCommand:sub(7))
  933. end
  934. end
  935. end)
  936. -----------------------------------------------------------------------------------------------------------------------------------------
  937. -- PR
  938. -----------------------------------------------------------------------------------------------------------------------------------------
  939. RegisterCommand('pr',function(source,args,rawCommand)
  940. if args[1] then
  941. local user_id = vRP.getUserId(source)
  942. local identity = vRP.getUserIdentity(user_id)
  943. local permission = "policia.permissao"
  944. if vRP.hasPermission(user_id,permission) then
  945. local soldado = vRP.getUsersByPermission(permission)
  946. for l,w in pairs(soldado) do
  947. local player = vRP.getUserSource(parseInt(w))
  948. if player then
  949. async(function()
  950. TriggerClientEvent('chatMessage',player,identity.name.." "..identity.firstname,{255,175,175},rawCommand:sub(3))
  951. end)
  952. end
  953. end
  954. end
  955. end
  956. end)
  957. -----------------------------------------------------------------------------------------------------------------------------------------
  958. -- HR
  959. -----------------------------------------------------------------------------------------------------------------------------------------
  960. RegisterCommand('hr',function(source,args,rawCommand)
  961. if args[1] then
  962. local user_id = vRP.getUserId(source)
  963. local identity = vRP.getUserIdentity(user_id)
  964. local permission = "paramedico.permissao"
  965. if vRP.hasPermission(user_id,permission) then
  966. local soldado = vRP.getUsersByPermission(permission)
  967. for l,w in pairs(soldado) do
  968. local player = vRP.getUserSource(parseInt(w))
  969. if player then
  970. async(function()
  971. TriggerClientEvent('chatMessage',player,identity.name.." "..identity.firstname,{255,175,175},rawCommand:sub(3))
  972. end)
  973. end
  974. end
  975. end
  976. end
  977. end)
  978. -----------------------------------------------------------------------------------------------------------------------------------------
  979. -- mec
  980. -----------------------------------------------------------------------------------------------------------------------------------------
  981. RegisterCommand('mec',function(source,args,rawCommand)
  982. if args[1] then
  983. local user_id = vRP.getUserId(source)
  984. local identity = vRP.getUserIdentity(user_id)
  985. if user_id then
  986. TriggerClientEvent('chatMessage',-1,identity.name.." "..identity.firstname,{138,43,226},rawCommand:sub(4))
  987. end
  988. end
  989. end)
  990. -----------------------------------------------------------------------------------------------------------------------------------------
  991. -- ME
  992. -----------------------------------------------------------------------------------------------------------------------------------------
  993. RegisterCommand('me',function(source,args,rawCommand)
  994. if args[1] then
  995. local user_id = vRP.getUserId(source)
  996. local identity = vRP.getUserIdentity(user_id)
  997. TriggerClientEvent('chatME',-1,source,identity.name,rawCommand:sub(3))
  998. vRP.logs("savedata/me.txt","[ID]: "..user_id.." / [MENSAGEM]: "..rawCommand:sub(3))
  999. end
  1000. end)
  1001. -----------------------------------------------------------------------------------------------------------------------------------------
  1002. -- CARTAS
  1003. -----------------------------------------------------------------------------------------------------------------------------------------
  1004. RegisterCommand('card',function(source,args,rawCommand)
  1005. local user_id = vRP.getUserId(source)
  1006. local identity = vRP.getUserIdentity(user_id)
  1007. if user_id then
  1008. local cd = math.random(1,13)
  1009. local naipe = math.random(1,4)
  1010. TriggerClientEvent('CartasMe',-1,source,identity.name,cd,naipe)
  1011. end
  1012. end)
  1013. -----------------------------------------------------------------------------------------------------------------------------------------
  1014. -- /PAYPAL
  1015. -----------------------------------------------------------------------------------------------------------------------------------------
  1016. -- RegisterCommand('paypal',function(source,args,rawCommand)
  1017. -- local user_id = vRP.getUserId(source)
  1018. -- if user_id then
  1019. -- if args[1] == "sacar" and parseInt(args[2]) > 0 then
  1020. -- local consulta = vRP.getUData(user_id,"vRP:paypal")
  1021. -- local resultado = json.decode(consulta) or ""
  1022. -- if resultado >= parseInt(args[2]) then
  1023. -- vRP.giveBankMoney(user_id,parseInt(args[2]))
  1024. -- vRP.setUData(user_id,"vRP:paypal",json.encode(parseInt(resultado-args[2])))
  1025. -- TriggerClientEvent("Notify",source,"sucesso","Efetuou o saque de <b>$"..vRP.format(parseInt(args[2])).." dólares</b> da sua conta paypal.")
  1026. -- vRP.logs("savedata/paypal.txt","[ID]: "..user_id.." / [SACAR]: "..parseInt(args[2]))
  1027. -- else
  1028. -- TriggerClientEvent("Notify",source,"negado","Dinheiro insuficiente em sua conta paypal.")
  1029. -- end
  1030. -- elseif args[1] == "trans" and parseInt(args[2]) > 0 and parseInt(args[3]) > 0 then
  1031. -- local consulta = vRP.getUData(args[2],"vRP:paypal")
  1032. -- local resultado = json.decode(consulta) or 0
  1033. -- local banco = vRP.getBankMoney(user_id)
  1034. -- if banco >= parseInt(args[3]) then
  1035. -- vRP.setBankMoney(user_id,parseInt(banco-args[3]))
  1036. -- vRP.setUData(parseInt(args[2]),"vRP:paypal",json.encode(parseInt(resultado+args[3])))
  1037. -- vRP.logs("savedata/paypal.txt","[ID]: "..user_id.." / [NID]: "..parseInt(args[2]).." / [TRANSFERENCIA]: "..parseInt(args[3]))
  1038. -- TriggerClientEvent("Notify",source,"sucesso","Enviou <b>$"..vRP.format(parseInt(args[3])).." dólares</b> ao passaporte <b>"..vRP.format(parseInt(args[2])).."</b>.")
  1039. -- local player = vRP.getUserSource(parseInt(args[2]))
  1040. -- if player == nil then
  1041. -- return
  1042. -- else
  1043. -- local identity = vRP.getUserIdentity(user_id)
  1044. -- TriggerClientEvent("Notify",player,"importante","<b>"..identity.name.." "..identity.firstname.."</b> transferiu <b>$"..vRP.format(parseInt(args[3])).." dólares</b> para sua conta do paypal.")
  1045. -- end
  1046. -- else
  1047. -- TriggerClientEvent("Notify",source,"negado","Dinheiro insuficiente.")
  1048. -- end
  1049. -- end
  1050. -- end
  1051. -- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement