Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Tunnel = module("vrp","lib/Tunnel")
- local Proxy = module("vrp","lib/Proxy")
- local Tools = module("vrp","lib/Tools")
- vRP = Proxy.getInterface("vRP")
- vRPclient = Tunnel.getInterface("vRP")
- local idgens = Tools.newIDGenerator()
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- ITEMLIST
- -----------------------------------------------------------------------------------------------------------------------------------------
- local itemlist = {
- ["ferramenta"] = { index = "ferramenta", nome = "Ferramenta" },
- ["encomenda"] = { index = "encomenda", nome = "Encomenda" },
- ["sacodelixo"] = { index = "sacodelixo", nome = "Saco de Lixo" },
- ["garrafavazia"] = { index = "garrafavazia", nome = "Garrafa Vazia" },
- ["garrafadeleite"] = { index = "garrafadeleite", nome = "Garrafa de Leite" },
- ["tora"] = { index = "tora", nome = "Tora de Madeira" },
- ["folhacoca"] = { index = "folhacoca", nome = "Folha de cocaina" },
- ["podecocaina"] = { index = "podecocaina", nome = "Pó de cocaina" },
- ["vidroheroina"] = { index = "vidroheroina", nome = "Vidro de Heroina" },
- ["alianca"] = { index = "alianca", nome = "Aliança" },
- ["bandagem"] = { index = "bandagem", nome = "Bandagem" },
- ["cerveja"] = { index = "cerveja", nome = "Cerveja" },
- ["leite"] = { index = "leite", nome = "Leite" },
- ["tequila"] = { index = "tequila", nome = "Tequila" },
- ["vodka"] = { index = "vodka", nome = "Vodka" },
- ["whisky"] = { index = "whisky", nome = "Whisky" },
- ["conhaque"] = { index = "conhaque", nome = "Conhaque" },
- ["absinto"] = { index = "absinto", nome = "Absinto" },
- ["dinheirosujo"] = { index = "dinheirosujo", nome = "Dinheiro Sujo" },
- ["repairkit"] = { index = "repairkit", nome = "Kit de Reparos" },
- ["algemas"] = { index = "algemas", nome = "Algemas" },
- ["capuz"] = { index = "capuz", nome = "Capuz" },
- ["colete"] = { index = "colete", nome = "Colete" },
- ["lockpick"] = { index = "lockpick", nome = "Lockpick" },
- ["masterpick"] = { index = "masterpick", nome = "Masterpick" },
- ["militec"] = { index = "militec", nome = "Militec-1" },
- ["carnesilvestre"] = { index = "carnesilvestre", nome = "Carne de Silvestre" },
- ["carnelegal"] = { index = "carnelegal", nome = "Carne Legal" },
- ["isca"] = { index = "isca", nome = "Isca" },
- ["dourado"] = { index = "dourado", nome = "Dourado" },
- ["corvina"] = { index = "corvina", nome = "Corvina" },
- ["salmao"] = { index = "salmao", nome = "Salmão" },
- ["pacu"] = { index = "pacu", nome = "Pacu" },
- ["pintado"] = { index = "pintado", nome = "Pintado" },
- ["pirarucu"] = { index = "pirarucu", nome = "Pirarucu" },
- ["tilapia"] = { index = "tilapia", nome = "Tilápia" },
- ["tucunare"] = { index = "tucunare", nome = "Tucunaré" },
- ["lambari"] = { index = "lambari", nome = "Lambari" },
- ["energetico"] = { index = "energetico", nome = "Energético" },
- ["mochila"] = { index = "mochila", nome = "Mochila" },
- ["weedseed"] = { index = "weedseed", nome = "Semente de Cannabis" },
- ["maconha"] = { index = "maconha", nome = "Maconha" },
- ["cocaina"] = { index = "cocaina", nome = "Cocaina" },
- ["heroina"] = { index = "heroina", nome = "Heroina" },
- ['mineriobronze'] = { index = "mineriobronze", name= "Minério de Bronze" },
- ['minerioferro'] = { index = "minerioferro", name= "Minério de Ferro" },
- ['minerioaco'] = { index = "minerioaco", name= "Minério de Aço" },
- ['minerioprata'] = { index = "minerioprata", name= "Minério de Prata" },
- ['minerioouro'] = { index = "minerioouro", name= "Minério de Ouro" },
- ['mineriorubi'] = { index = "mineriorubi", name= "Minério de Rubi" },
- ['minerioesmeralda'] = { index = "minerioesmeralda", name= "Minério de Esmeralda" },
- ['mineriosafira'] = { index = "mineriosafira", name= "Minério de Safira" },
- ['mineriodiamante'] = { index = "mineriodiamante", name= "Minério de Diamante" },
- ['mineriotopazio'] = { index = "mineriotopazio", name= "Minério de Topázio" },
- ['minerioametista'] = { index = "minerioametista", name= "Minério de Ametista" },
- ['bronze'] = { index = "bronze", name= "Bronze" },
- ['prata'] = { index = "prata", name= "Prata" },
- ['ouro'] = { index = "ouro", name= "Ouro" },
- ['rubi'] = { index = "rubi", name= "Rubi" },
- ['esmeralda'] = { index = "esmeralda", name= "Esmeralda" },
- ['safira'] = { index = "safira", name= "Safira" },
- ['croquettes'] = { index = "croquettes", name= "Croquettes" },
- ['diamante'] = { index = "diamante", name= "Diamante" },
- ['topazio'] = { index = "topazio", name= "Topázio" },
- ['ametista'] = { index = "ametista", name= "Ametista" },
- ["placa"] = { index = "placa", nome = "Placa" },
- ["rebite"] = { index = "rebite", nome = "Rebite" },
- ["carbono"] = { index = "carbono", nome = "Carbono" },
- ["ferro"] = { index = "ferro", nome = "Ferro" },
- ["aco"] = { index = "aco", nome = "Aço" },
- ["adubo"] = { index = "adubo", nome = "Adubo" },
- ["fertilizante"] = { index = "fertilizante", nome = "Fertilizante" },
- ["capsula"] = { index = "capsula", nome = "Cápsula" },
- ["polvora"] = { index = "polvora", nome = "Pólvora" },
- ["orgao"] = { index = "orgao", nome = "Órgão" },
- ["celular"] = { index = "celular", nome = "Celular" },
- ["etiqueta"] = { index = "etiqueta", nome = "Etiqueta" },
- ["pendrive"] = { index = "pendrive", nome = "Pendrive" },
- ["relogioroubado"] = { index = "relogioroubado", nome = "Relógio Roubado" },
- ["pulseiraroubada"] = { index = "pulseiraroubada", nome = "Pulseira Roubada" },
- ["anelroubado"] = { index = "anelroubado", nome = "Anel Roubado" },
- ["colarroubado"] = { index = "colarroubado", nome = "Colar Roubado" },
- ["brincoroubado"] = { index = "brincoroubado", nome = "Brinco Roubado" },
- ["carteiraroubada"] = { index = "carteiraroubada", nome = "Carteira Roubada" },
- ["carregadorroubado"] = { index = "carregadorroubado", nome = "Carregador Roubado" },
- ["tabletroubado"] = { index = "tabletroubado", nome = "Tablet Roubado" },
- ["sapatosroubado"] = { index = "sapatosroubado", nome = "Sapatos Roubado" },
- ["vibradorroubado"] = { index = "vibradorroubado", nome = "Vibrador Roubado" },
- ["perfumeroubado"] = { index = "perfumeroubado", nome = "Perfume Roubado" },
- ["maquiagemroubada"] = { index = "maquiagemroubada", nome = "Maquiagem Roubada" },
- ["wbody|WEAPON_DAGGER"] = { index = "adaga", nome = "Adaga" },
- ["wbody|WEAPON_BAT"] = { index = "beisebol", nome = "Taco de Beisebol" },
- ["wbody|WEAPON_BOTTLE"] = { index = "garrafa", nome = "Garrafa" },
- ["wbody|WEAPON_CROWBAR"] = { index = "cabra", nome = "Pé de Cabra" },
- ["wbody|WEAPON_FLASHLIGHT"] = { index = "lanterna", nome = "Lanterna" },
- ["wbody|WEAPON_GOLFCLUB"] = { index = "golf", nome = "Taco de Golf" },
- ["wbody|WEAPON_HAMMER"] = { index = "martelo", nome = "Martelo" },
- ["wbody|WEAPON_HATCHET"] = { index = "machado", nome = "Machado" },
- ["wbody|WEAPON_KNUCKLE"] = { index = "ingles", nome = "Soco-Inglês" },
- ["wbody|WEAPON_KNIFE"] = { index = "faca", nome = "Faca" },
- ["wbody|WEAPON_MACHETE"] = { index = "machete", nome = "Machete" },
- ["wbody|WEAPON_SWITCHBLADE"] = { index = "canivete", nome = "Canivete" },
- ["wbody|WEAPON_NIGHTSTICK"] = { index = "cassetete", nome = "Cassetete" },
- ["wbody|WEAPON_WRENCH"] = { index = "grifo", nome = "Chave de Grifo" },
- ["wbody|WEAPON_BATTLEAXE"] = { index = "batalha", nome = "Machado de Batalha" },
- ["wbody|WEAPON_POOLCUE"] = { index = "sinuca", nome = "Taco de Sinuca" },
- ["wbody|WEAPON_STONE_HATCHET"] = { index = "pedra", nome = "Machado de Pedra" },
- ["wbody|WEAPON_PISTOL"] = { index = "m1911", nome = "M1911" },
- ["wbody|WEAPON_PISTOL_MK2"] = { index = "fiveseven", nome = "FN Five Seven" },
- ["wbody|WEAPON_COMBATPISTOL"] = { index = "glock", nome = "Glock 19" },
- ["wbody|WEAPON_APPISTOL"] = { index = "vp9", nome = "Koch VP9" },
- ["wbody|WEAPON_STUNGUN"] = { index = "tazer", nome = "Tazer" },
- ["wbody|WEAPON_SNSPISTOL"] = { index = "hkp7m10", nome = "HK P7M10" },
- ["wbody|WEAPON_VINTAGEPISTOL"] = { index = "m1922", nome = "M1922" },
- ["wbody|WEAPON_REVOLVER"] = { index = "magnum44", nome = "Magnum 44" },
- ["wbody|WEAPON_MUSKET"] = { index = "winchester22", nome = "Winchester 22" },
- ["wbody|WEAPON_FLARE"] = { index = "sinalizador", nome = "Sinalizador" },
- ["wbody|WEAPON_BALL"] = { index = "bolinha", nome = "Bola de Baseball" },
- ["wbody|GADGET_PARACHUTE"] = { index = "paraquedas", nome = "Paraquedas" },
- ["wbody|WEAPON_FIREEXTINGUISHER"] = { index = "extintor", nome = "Extintor" },
- ["wbody|WEAPON_MICROSMG"] = { index = "uzi", nome = "Uzi" },
- ["wbody|WEAPON_SMG"] = { index = "mp5", nome = "MP5" },
- ["wbody|WEAPON_ASSAULTSMG"] = { index = "mtar21", nome = "MTAR-21" },
- ["wbody|WEAPON_COMBATPDW"] = { index = "sigsauer", nome = "Sig Sauer MPX" },
- ["wbody|WEAPON_PUMPSHOTGUN_MK2"] = { index = "remington", nome = "Remington 870" },
- ["wbody|WEAPON_CARBINERIFLE"] = { index = "m4a1", nome = "M4A1" },
- ["wbody|WEAPON_ASSAULTRIFLE"] = { index = "ak103", nome = "AK-103" },
- ["wbody|WEAPON_GUSENBERG"] = { index = "thompson", nome = "Thompson" },
- ["wbody|WEAPON_SMG_MK2"] = { index = "SMGMK2", nome = "SMG-MK2" },
- ["wbody|WEAPON_CARBINERIFLE_MK2"] = { index = "ADV", nome = "ADV" },
- ["wammo|WEAPON_BALL"] = { index = "m-bolinha", nome = "M-Bola de Baseball" },
- ["wammo|WEAPON_SMG_MK2"] = { index = "m-SMGMK2", nome = "Munição de SMG-MK2" },
- ["wammo|WEAPON_PISTOL"] = { index = "m-m1911", nome = "Munição de M1911" },
- ["wammo|WEAPON_PISTOL_MK2"] = { index = "m-fiveseven", nome = "Munição de FN Five Seven" },
- ["wammo|WEAPON_COMBATPISTOL"] = { index = "m-glock", nome = "Munição de Glock 19" },
- ["wammo|WEAPON_APPISTOL"] = { index = "m-vp9", nome = "Munição de Koch VP9" },
- ["wammo|WEAPON_STUNGUN"] = { index = "m-tazer", nome = "Munição de Tazer" },
- ["wammo|WEAPON_SNSPISTOL"] = { index = "m-hkp7m10", nome = "Munição de HK P7M10" },
- ["wammo|WEAPON_VINTAGEPISTOL"] = { index = "m-m1922", nome = "Munição de M1922" },
- ["wammo|WEAPON_REVOLVER"] = { index = "m-magnum44", nome = "Munição de Magnum 44" },
- ["wammo|WEAPON_MUSKET"] = { index = "m-winchester22", nome = "Munição de Winchester 22" },
- ["wammo|WEAPON_FLARE"] = { index = "m-sinalizador", nome = "Munição de Sinalizador" },
- ["wammo|GADGET_PARACHUTE"] = { index = "m-paraquedas", nome = "Munição de Paraquedas" },
- ["wammo|WEAPON_FIREEXTINGUISHER"] = { index = "m-extintor", nome = "Munição de Extintor" },
- ["wammo|WEAPON_MICROSMG"] = { index = "m-uzi", nome = "Munição de Uzi" },
- ["wammo|WEAPON_SMG"] = { index = "m-mp5", nome = "Munição de MP5" },
- ["wammo|WEAPON_ASSAULTSMG"] = { index = "m-mtar21", nome = "Munição de MTAR-21" },
- ["wammo|WEAPON_COMBATPDW"] = { index = "m-sigsauer", nome = "Munição de Sig Sauer MPX" },
- ["wammo|WEAPON_PUMPSHOTGUN_MK2"] = { index = "m-remington", nome = "Munição de Remington 870" },
- ["wammo|WEAPON_CARBINERIFLE"] = { index = "m-m4a1", nome = "Munição de M4A1" },
- ["wammo|WEAPON_ASSAULTRIFLE"] = { index = "m-ak103", nome = "Munição de AK-103" },
- ["wammo|WEAPON_GUSENBERG"] = { index = "m-thompson", nome = "Munição de Thompson" },
- ["wammo|WEAPON_PETROLCAN"] = { index = "combustivel", nome = "Combustível" },
- ["wbody|WEAPON_PETROLCAN"] = { index = "gasolina", nome = "Galão de Gasolina" },
- ["wammo|WEAPON_CARBINERIFLE_MK2"] = { index = "m-ADV", nome = "m-ADV" },
- }
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- ITEM
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('item',function(source,args,rawCommand)
- local user_id = vRP.getUserId(source)
- if vRP.hasPermission(user_id,"admin.permissao") then
- if args[1] and args[2] and itemlist[args[1]] ~= nil then
- vRP.giveInventoryItem(user_id,args[1],parseInt(args[2]))
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- GUARDA COLETE
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('gcolete',function(source,args,rawCommand)
- local source = source
- local user_id = vRP.getUserId(source)
- local colete = 0
- local datacolete = vRP.getUData(user_id,"vRP:datatable")
- local coletedata = json.decode(datacolete)
- local mycolete = coletedata.colete
- if mycolete == 100 then
- vRP.giveInventoryItem(user_id,"colete",1)
- vRPclient.setArmour(source,0)
- elseif mycolete > 0 and mycolete < 100 then
- TriggerClientEvent("Notify",source,"negado","Seu <b>Colete</b> precisa estar inteiro.")
- elseif mycolete == 0 then
- TriggerClientEvent("Notify",source,"negado","Você não tem nenhum <b>Colete</b>.")
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- PLAYERS ONLINE
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('players',function(source,args,rawCommand)
- local onlinePlayers = GetNumPlayerIndices()
- TriggerClientEvent("Notify",source,"importante","<b>Jogadores Online: "..onlinePlayers.."</b>")
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- /EQUIPAR
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- RegisterCommand('equipar',function(source,args,rawCommand)
- -- for k,v in pairs(itemlist) do
- -- if args[1] == v.index and args[1] ~= "mochila" then
- -- local user_id = vRP.getUserId(source)
- -- if vRP.tryGetInventoryItem(user_id,k,1) then
- -- local weapons = {}
- -- weapons[string.gsub(k,"wbody|","")] = { ammo = 0 }
- -- vRPclient._giveWeapons(source,weapons)
- -- vRP.logs("savedata/armamento.txt","[ID]: "..user_id.." / [FUNÇÃO]: Equipar / [ARMA]: "..v.index)
- -- else
- -- TriggerClientEvent("Notify",source,"negado","Armamento não encontrado.")
- -- end
- -- end
- -- end
- -- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- /RECARREGAR
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- RegisterCommand('recarregar',function(source,args,rawCommand)
- -- for k,v in pairs(itemlist) do
- -- if args[1] == v.index and args[1] ~= "mochila" then
- -- local uweapons = vRPclient.getWeapons(source)
- -- local weaponuse = string.gsub(k,"wbody|","")
- -- if uweapons[weaponuse] then
- -- local user_id = vRP.getUserId(source)
- -- if vRP.tryGetInventoryItem(user_id,"wammo|"..weaponuse,parseInt(args[2])) then
- -- local weapons = {}
- -- weapons[weaponuse] = { ammo = parseInt(args[2]) }
- -- vRPclient._giveWeapons(source,weapons,false)
- -- vRP.logs("savedata/armamento.txt","[ID]: "..user_id.." / [FUNÇÃO]: Recarregar / [ARMA]: "..v.index)
- -- else
- -- TriggerClientEvent("Notify",source,"negado","Munição não encontrada.")
- -- end
- -- else
- -- TriggerClientEvent("Notify",source,"importante","Equipe o armamento antes.")
- -- end
- -- end
- -- end
- -- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- /MOC
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- RegisterCommand('moc',function(source,args,rawCommand)
- -- local user_id = vRP.getUserId(source)
- -- if user_id then
- -- local data = vRP.getUserDataTable(user_id)
- -- if data then
- -- 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 ] - -")
- -- for k,v in pairs(data.inventory) do
- -- if k and v then
- -- TriggerClientEvent('chatMessage',source,"",{}," "..vRP.format(parseInt(v.amount)).."x "..itemlist[k].nome.."^2 | "..itemlist[k].index)
- -- end
- -- end
- -- end
- -- end
- -- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- /DROPAR
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('dropar',function(source,args,rawCommand)
- local user_id = vRP.getUserId(source)
- if user_id and args[1] then
- local px,py,pz = vRPclient.getPosition(source)
- for k,v in pairs(itemlist) do
- if args[1] == v.index then
- if args[2] and parseInt(args[2]) > 0 then
- if vRP.tryGetInventoryItem(user_id,k,parseInt(args[2])) then
- TriggerEvent("DropSystem:create",k,parseInt(args[2]),px,py,pz)
- vRPclient._playAnim(source,true,{{"pickup_object","pickup_low"}},false)
- vRP.logs("savedata/dropar.txt","[ID]: "..user_id.." / [ITEM]: "..k.." / [QTD]: "..parseInt(args[2]))
- end
- else
- local data = vRP.getUserDataTable(user_id)
- for i,o in pairs(data.inventory) do
- if itemlist[i].index == args[1] then
- if vRP.tryGetInventoryItem(user_id,k,parseInt(o.amount)) then
- TriggerEvent("DropSystem:create",k,parseInt(o.amount),px,py,pz)
- vRPclient._playAnim(source,true,{{"pickup_object","pickup_low"}},false)
- vRP.logs("savedata/dropar.txt","[ID]: "..user_id.." / [ITEM]: "..k.." / [QTD]: "..parseInt(o.amount))
- end
- end
- end
- end
- end
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- /REVISTAR
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('revistar',function(source,args,rawCommand)
- local user_id = vRP.getUserId(source)
- local nplayer = vRPclient.getNearestPlayer(source,2)
- local nuser_id = vRP.getUserId(nplayer)
- if nuser_id then
- local identity = vRP.getUserIdentity(user_id)
- local weapons = vRPclient.getWeapons(nplayer)
- local money = vRP.getMoney(nuser_id)
- local data = vRP.getUserDataTable(nuser_id)
- 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 ] - -")
- if data and data.inventory then
- for k,v in pairs(data.inventory) do
- TriggerClientEvent('chatMessage',source,"",{}," "..vRP.format(parseInt(v.amount)).."x "..itemlist[k].nome)
- end
- end
- TriggerClientEvent('chatMessage',source,"",{},"^4- - ^5E Q U I P A D O^4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -")
- for k,v in pairs(weapons) do
- if v.ammo < 1 then
- TriggerClientEvent('chatMessage',source,"",{}," 1x "..itemlist["wbody|"..k].nome)
- else
- TriggerClientEvent('chatMessage',source,"",{}," 1x "..itemlist["wbody|"..k].nome.." | "..vRP.format(parseInt(v.ammo)).."x Munições")
- end
- end
- TriggerClientEvent('chatMessage',source,"",{}," $"..vRP.format(parseInt(money)).." Dólares")
- TriggerClientEvent("Notify",nplayer,"aviso","Revistado por <b>"..identity.name.." "..identity.firstname.."</b>.")
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- SALÁRIO
- -----------------------------------------------------------------------------------------------------------------------------------------
- local salarios = {
- { ['permissao'] = "bronze.permissao", ['nome'] = "BRONZE", ['payment'] = 1500 },
- { ['permissao'] = "prata.permissao", ['nome'] = "PRATA", ['payment'] = 2500 },
- { ['permissao'] = "ouro.permissao", ['nome'] = "OURO", ['payment'] = 3500 },
- { ['permissao'] = "platina.permissao", ['nome'] = "PLATINA", ['payment'] = 5000 },
- { ['permissao'] = "policia.permissao", ['nome'] = "POLICIA", ['payment'] = 3000 },
- { ['permissao'] = "paramedico.permissao", ['nome'] = "PARAMEDICO", ['payment'] = 5500 },
- { ['permissao'] = "taxista.permissao", ['nome'] = "TAXISTA", ['payment'] = 500 }
- }
- RegisterServerEvent('salario:pagamento')
- AddEventHandler('salario:pagamento',function()
- local source = source
- local user_id = vRP.getUserId(source)
- if user_id then
- for k,v in pairs(salarios) do
- if vRP.hasPermission(user_id,v.permissao) then
- TriggerClientEvent("Notify",source,"importante","Obrigado por colaborar com a cidade, sua recompensa foi depositada.")
- vRP.giveBankMoney(user_id,parseInt(v.payment))
- vRP.logs("savedata/salario.txt","[ID]: "..user_id)
- end
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- NOCARJACK
- -----------------------------------------------------------------------------------------------------------------------------------------
- local veiculos = {}
- veiculos["CLONADOS"] = true
- RegisterServerEvent("TryDoorsEveryone")
- AddEventHandler("TryDoorsEveryone",function(veh,doors,placa)
- if not veiculos[placa] then
- TriggerClientEvent("SyncDoorsEveryone",-1,veh,doors)
- veiculos[placa] = true
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- AFKSYSTEM
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- [[RegisterServerEvent("kickAFK")
- -- AddEventHandler("kickAFK",function()
- -- local source = source
- -- local user_id = vRP.getUserId(source)
- -- if not vRP.hasPermission(user_id,"admin.permissao") then
- -- DropPlayer(source,"Voce foi desconectado por ficar ausente.")
- -- end
- -- end)]]
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- /SEQUESTRO
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('sequestro',function(source,args,rawCommand)
- local nplayer = vRPclient.getNearestPlayer(source,5)
- if nplayer then
- if vRPclient.isHandcuffed(nplayer) then
- if not vRPclient.getNoCarro(source) then
- local vehicle = vRPclient.getNearestVehicle(source,7)
- if vehicle then
- if vRPclient.getCarroClass(source,vehicle) then
- vRPclient.setMalas(nplayer)
- end
- end
- elseif vRPclient.isMalas(nplayer) then
- vRPclient.setMalas(nplayer)
- end
- else
- TriggerClientEvent("Notify",source,"aviso","A pessoa precisa estar algemada para colocar ou retirar do Porta-Malas.")
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- ALERTAS
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('alertas',function(source,args,rawCommand)
- local user_id = vRP.getUserId(source)
- if vRP.hasPermission(user_id,"alertas.permissao") then
- vRP.removeUserGroup(user_id,"Alertas")
- TriggerClientEvent("Notify",source,"importante","Você removeu as notificações.")
- else
- vRP.addUserGroup(user_id,"Alertas")
- TriggerClientEvent("Notify",source,"sucesso","Você ativou as notificações.")
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- TRATAMENTO
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('tratamento',function(source,args,rawCommand)
- local user_id = vRP.getUserId(source)
- if vRP.hasPermission(user_id,"paramedico.permissao") then
- local nplayer = vRPclient.getNearestPlayer(source,3)
- if nplayer then
- TriggerClientEvent('tratamento',nplayer)
- TriggerClientEvent("Notify",nplayer,"sucesso","Tratamento iniciado, aguarde a liberação do paramédico.")
- TriggerClientEvent("Notify",source,"sucesso","Tratamento no paciente iniciado com sucesso.")
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- CASAS
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('casas',function(source,args,rawCommand)
- local user_id = vRP.getUserId(source)
- if args[1] and vRP.hasPermission(user_id,"policia.permissao") then
- local nplayer = vRP.getUserSource(parseInt(args[1]))
- if nplayer == nil then
- return
- end
- user_id = vRP.getUserId(nplayer)
- end
- if user_id then
- local address = vRP.getUserAddress(user_id)
- local casas = ""
- if args[1] then
- if #address > 0 then
- for k,v in pairs(address) do
- casas = casas..v.home.." - Nº"..v.number
- if k ~= #address then
- casas = casas..", "
- end
- end
- TriggerClientEvent("Notify",source,"importante","Residências possuidas pelo passaporte <b>"..vRP.format(parseInt(args[1])).."</b>: "..casas)
- else
- TriggerClientEvent("Notify",source,"negado","Passaporte <b>"..vRP.format(parseInt(args[1])).."</b> não possui residências.")
- end
- else
- if #address > 0 then
- for k,v in pairs(address) do
- casas = casas..v.home.." - Nº"..v.number
- if k ~= #address then
- casas = casas..", "
- end
- end
- TriggerClientEvent("Notify",source,"importante","Residências possuidas: "..casas)
- else
- TriggerClientEvent("Notify",source,"importante","Não possui residências em seu nome.")
- end
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- MOTOR
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- RegisterCommand('motor',function(source,args,rawCommand)
- -- local user_id = vRP.getUserId(source)
- -- if not vRPclient.isInVehicle(source) then
- -- local vehicle = vRPclient.getNearestVehicle(source,7)
- -- if vRP.hasPermission(user_id,"mecanico.permissao") then
- -- TriggerClientEvent('cancelando',source,true)
- -- vRPclient._playAnim(source,false,{{"mini@repair","fixing_a_player"}},true)
- -- TriggerClientEvent("progress",source,30000,"reparando")
- -- SetTimeout(30000,function()
- -- TriggerClientEvent('cancelando',source,false)
- -- TriggerClientEvent('repararmotor',source,vehicle)
- -- vRPclient._stopAnim(source,false)
- -- end)
- -- else
- -- if vRP.tryGetInventoryItem(user_id,"militec",1) then
- -- TriggerClientEvent('cancelando',source,true)
- -- vRPclient._playAnim(source,false,{{"mini@repair","fixing_a_player"}},true)
- -- TriggerClientEvent("progress",source,30000,"reparando")
- -- SetTimeout(30000,function()
- -- TriggerClientEvent('cancelando',source,false)
- -- TriggerClientEvent('repararmotor',source,vehicle)
- -- vRPclient._stopAnim(source,false)
- -- end)
- -- else
- -- TriggerClientEvent("Notify",source,"negado","Precisa de um <b>Militec-1</b> para reparar o motor.")
- -- end
- -- end
- -- else
- -- TriggerClientEvent("Notify",source,"negado","Precisa estar próximo ou fora do veículo para efetuar os reparos.")
- -- end
- -- end)
- -- RegisterServerEvent("trymotor")
- -- AddEventHandler("trymotor",function(nveh)
- -- TriggerClientEvent("syncmotor",-1,nveh)
- -- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- REPARAR
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('reparar',function(source,args,rawCommand)
- local user_id = vRP.getUserId(source)
- if not vRPclient.isInVehicle(source) then
- local vehicle = vRPclient.getNearestVehicle(source,7)
- if vRP.hasPermission(user_id,"mecanico.permissao") then
- TriggerClientEvent('cancelando',source,true)
- vRPclient._playAnim(source,false,{{"mini@repair","fixing_a_player"}},true)
- TriggerClientEvent("progress",source,30000,"reparando")
- SetTimeout(30000,function()
- TriggerClientEvent('cancelando',source,false)
- TriggerClientEvent('reparar',source,vehicle)
- vRPclient._stopAnim(source,false)
- end)
- else
- if vRP.tryGetInventoryItem(user_id,"repairkit",1) then
- TriggerClientEvent('cancelando',source,true)
- vRPclient._playAnim(source,false,{{"mini@repair","fixing_a_player"}},true)
- TriggerClientEvent("progress",source,30000,"reparando")
- SetTimeout(30000,function()
- TriggerClientEvent('cancelando',source,false)
- TriggerClientEvent('reparar',source,vehicle)
- vRPclient._stopAnim(source,false)
- end)
- else
- TriggerClientEvent("Notify",source,"negado","Precisa de um <b>Kit de Reparos</b> para reparar o veículo.")
- end
- end
- else
- TriggerClientEvent("Notify",source,"negado","Precisa estar próximo ou fora do veículo para efetuar os reparos.")
- end
- end)
- RegisterServerEvent("tryreparar")
- AddEventHandler("tryreparar",function(nveh)
- TriggerClientEvent("syncreparar",-1,nveh)
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- ENVIAR
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('enviar',function(source,args,rawCommand)
- local user_id = vRP.getUserId(source)
- local nplayer = vRPclient.getNearestPlayer(source,2)
- local nuser_id = vRP.getUserId(nplayer)
- if nuser_id and args[1] and parseInt(args[2]) > 0 then
- for k,v in pairs(itemlist) do
- if args[1] == v.index then
- if vRP.getInventoryWeight(nuser_id)+vRP.getItemWeight(k)*parseInt(args[2]) <= vRP.getInventoryMaxWeight(nuser_id) then
- if vRP.tryGetInventoryItem(user_id,k,parseInt(args[2])) then
- vRP.giveInventoryItem(nuser_id,k,parseInt(args[2]))
- vRPclient._playAnim(source,true,{{"mp_common","givetake1_a"}},false)
- TriggerClientEvent("Notify",source,"sucesso","Enviou <b>"..parseInt(args[2]).."x "..v.nome.."</b>.")
- TriggerClientEvent("Notify",nplayer,"sucesso","Recebeu <b>"..parseInt(args[2]).."x "..v.nome.."</b>.")
- vRP.logs("savedata/enviar.txt","[ID]: "..user_id.." / [NID]: "..nuser_id.." / [ITEM]: "..k)
- end
- end
- end
- end
- elseif nuser_id and parseInt(args[1]) > 0 then
- if vRP.tryPayment(user_id,parseInt(args[1])) then
- vRP.giveMoney(nuser_id,parseInt(args[1]))
- vRPclient._playAnim(source,true,{{"mp_common","givetake1_a"}},false)
- TriggerClientEvent("Notify",source,"sucesso","Enviou <b>$"..vRP.format(parseInt(args[1])).." dólares</b>.")
- TriggerClientEvent("Notify",nplayer,"sucesso","Recebeu <b>$"..vRP.format(parseInt(args[1])).." dólares</b>.")
- vRP.logs("savedata/enviar.txt","[ID]: "..user_id.." / [NID]: "..nuser_id.." / [VALOR]: "..parseInt(args[1]))
- else
- TriggerClientEvent("Notify",source,"negado","Não tem a quantia que deseja enviar.")
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- GARMAS
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('garmas',function(source,args,rawCommand)
- local user_id = vRP.getUserId(source)
- if user_id then
- local weapons = vRPclient.replaceWeapons(source,{})
- for k,v in pairs(weapons) do
- vRP.giveInventoryItem(user_id,"wbody|"..k,1)
- if v.ammo > 0 then
- vRP.giveInventoryItem(user_id,"wammo|"..k,v.ammo)
- end
- end
- TriggerClientEvent("Notify",source,"sucesso","Guardou seu armamento na mochila.")
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- CLONEPLATE
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('cloneplate',function(source,args,rawCommand)
- local user_id = vRP.getUserId(source)
- if user_id then
- if vRPclient.isInVehicle(source) and vRP.tryGetInventoryItem(user_id,"placa",1) then
- TriggerClientEvent("cloneplates",source)
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- RG
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('rg', function(source, args, rawCommand) -- ready
- local user_id = vRP.getUserId(source)
- local identity = vRP.getUserIdentity(user_id)
- local firstname = identity.firstname
- local name = identity.name
- local registration = identity.registration
- local age = identity.age
- local money = vRP.getMoney(user_id)
- local phone = identity.phone
- local multas = vRP.getUData(user_id, "vRP:Multas") or "0"
- local groupv = vRP.getUserGroupByType(user_id,"job") or "Desempregado"
- local groupname = vRP.getGroupTitle(groupv)
- 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>", "")
- if vRP.request(source,"Deseja fechar o seu RG?",900) then
- vRPclient.removeDiv(source, "rg")
- else
- vRPclient.removeDiv(source, "rg")
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- MULTAS
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('multas',function(source,args,rawCommand)
- local user_id = vRP.getUserId(source)
- local value = vRP.getUData(parseInt(user_id),"vRP:multas")
- local multas = json.decode(value) or 0
- if args[1] then
- if parseInt(multas) > 0 and parseInt(args[1]) > 0 and parseInt(args[1]) <= parseInt(multas) then
- if vRP.tryFullPayment(user_id,parseInt(args[1])) then
- vRP.setUData(user_id,"vRP:multas",json.encode(parseInt(multas)-parseInt(args[1])))
- TriggerClientEvent("Notify",source,"sucesso","Você pagou <b>$"..parseInt(args[1]).."</b> em multas")
- else
- TriggerClientEvent("Notify",source,"aviso","<b>Dinheiro Insuficiente</b>")
- end
- else
- TriggerClientEvent("Notify",source,"aviso","Valor inválido, verifique suas <b>multas pendentes</b>")
- end
- else
- if parseInt(multas) == 0 then
- TriggerClientEvent("Notify",source,"aviso","Você não tem <b>multas</b> para pagar")
- else
- TriggerClientEvent("Notify",source,"sucesso","Você tem <b>$"..parseInt(multas).."</b> em multas para pagar")
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- ROUBAR
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('roubar',function(source,args,rawCommand)
- local user_id = vRP.getUserId(source)
- local nplayer = vRPclient.getNearestPlayer(source,2)
- if nplayer then
- local nuser_id = vRP.getUserId(nplayer)
- local policia = vRP.getUsersByPermission("policia.permissao")
- if #policia >= 1 then
- if vRP.request(nplayer,"Você está sendo roubado, deseja passar tudo?",30) then
- local vida = vRPclient.getHealth(nplayer)
- if vida <= 100 then
- TriggerClientEvent('cancelando',source,true)
- vRPclient._playAnim(source,false,{{"amb@medic@standing@kneel@idle_a","idle_a"}},true)
- TriggerClientEvent("progress",source,30000,"roubando")
- SetTimeout(30000,function()
- local ndata = vRP.getUserDataTable(nuser_id)
- if ndata ~= nil then
- if ndata.inventory ~= nil then
- for k,v in pairs(ndata.inventory) do
- if vRP.getInventoryWeight(user_id)+vRP.getItemWeight(k)*v.amount <= vRP.getInventoryMaxWeight(user_id) then
- if vRP.tryGetInventoryItem(nuser_id,k,v.amount) then
- vRP.giveInventoryItem(user_id,k,v.amount)
- end
- else
- TriggerClientEvent("Notify",source,"negado","Mochila não suporta <b>"..vRP.format(parseInt(v.amount)).."x "..itemlist[k].nome.."</b> por causa do peso.")
- end
- end
- end
- end
- local weapons = vRPclient.replaceWeapons(nplayer,{})
- for k,v in pairs(weapons) do
- vRP.giveInventoryItem(nuser_id,"wbody|"..k,1)
- if vRP.getInventoryWeight(user_id)+vRP.getItemWeight("wbody|"..k) <= vRP.getInventoryMaxWeight(user_id) then
- if vRP.tryGetInventoryItem(nuser_id,"wbody|"..k,1) then
- vRP.giveInventoryItem(user_id,"wbody|"..k,1)
- end
- else
- TriggerClientEvent("Notify",source,"negado","Mochila não suporta <b>1x "..itemlist["wbody"..k].nome.."</b> por causa do peso.")
- end
- if v.ammo > 0 then
- vRP.giveInventoryItem(nuser_id,"wammo|"..k,v.ammo)
- if vRP.getInventoryWeight(user_id)+vRP.getItemWeight("wammo|"..k)*v.ammo <= vRP.getInventoryMaxWeight(user_id) then
- if vRP.tryGetInventoryItem(nuser_id,"wammo|"..k,v.ammo) then
- vRP.giveInventoryItem(user_id,"wammo|"..k,v.ammo)
- end
- else
- TriggerClientEvent("Notify",source,"negado","Mochila não suporta <b>"..vRP.format(parseInt(v.ammo)).."x "..itemlist["wammo|"..k].nome.."</b> por causa do peso.")
- end
- end
- end
- local nmoney = vRP.getMoney(nuser_id)
- if vRP.tryPayment(nuser_id,nmoney) then
- vRP.giveMoney(user_id,nmoney)
- end
- vRPclient.setStandBY(source,parseInt(600))
- vRPclient._stopAnim(source,false)
- TriggerClientEvent('cancelando',source,false)
- TriggerClientEvent("Notify",source,"importante","Roubo concluido com sucesso.")
- end)
- else
- local ndata = vRP.getUserDataTable(nuser_id)
- if ndata ~= nil then
- if ndata.inventory ~= nil then
- for k,v in pairs(ndata.inventory) do
- if vRP.getInventoryWeight(user_id)+vRP.getItemWeight(k)*v.amount <= vRP.getInventoryMaxWeight(user_id) then
- if vRP.tryGetInventoryItem(nuser_id,k,v.amount) then
- vRP.giveInventoryItem(user_id,k,v.amount)
- end
- else
- TriggerClientEvent("Notify",source,"negado","Mochila não suporta <b>"..vRP.format(parseInt(v.amount)).."x "..itemlist[k].nome.."</b> por causa do peso.")
- end
- end
- end
- end
- local weapons = vRPclient.replaceWeapons(nplayer,{})
- for k,v in pairs(weapons) do
- vRP.giveInventoryItem(nuser_id,"wbody|"..k,1)
- if vRP.getInventoryWeight(user_id)+vRP.getItemWeight("wbody|"..k) <= vRP.getInventoryMaxWeight(user_id) then
- if vRP.tryGetInventoryItem(nuser_id,"wbody|"..k,1) then
- vRP.giveInventoryItem(user_id,"wbody|"..k,1)
- end
- else
- TriggerClientEvent("Notify",source,"negado","Mochila não suporta <b>1x "..itemlist["wbody|"..k].nome.."</b> por causa do peso.")
- end
- if v.ammo > 0 then
- vRP.giveInventoryItem(nuser_id,"wammo|"..k,v.ammo)
- if vRP.getInventoryWeight(user_id)+vRP.getItemWeight("wammo|"..k)*v.ammo <= vRP.getInventoryMaxWeight(user_id) then
- if vRP.tryGetInventoryItem(nuser_id,"wammo|"..k,v.ammo) then
- vRP.giveInventoryItem(user_id,"wammo|"..k,v.ammo)
- end
- else
- TriggerClientEvent("Notify",source,"negado","Mochila não suporta <b>"..vRP.format(parseInt(v.ammo)).."x "..itemlist["wammo|"..k].nome.."</b> por causa do peso.")
- end
- end
- end
- local nmoney = vRP.getMoney(nuser_id)
- if vRP.tryPayment(nuser_id,nmoney) then
- vRP.giveMoney(user_id,nmoney)
- end
- vRPclient.setStandBY(source,parseInt(600))
- TriggerClientEvent("Notify",source,"importante","Roubo concluido com sucesso.")
- end
- else
- TriggerClientEvent("Notify",source,"aviso","A pessoa está resistindo ao roubo.")
- end
- else
- TriggerClientEvent("Notify",source,"negado","Número insuficiente de policiais no momento.")
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- TRYTOW
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterServerEvent("trytow")
- AddEventHandler("trytow",function(nveh,rveh)
- TriggerClientEvent("synctow",-1,nveh,rveh)
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- TRUNK
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterServerEvent("trytrunk")
- AddEventHandler("trytrunk",function(nveh)
- TriggerClientEvent("synctrunk",-1,nveh)
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- WINS
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterServerEvent("trywins")
- AddEventHandler("trywins",function(nveh)
- TriggerClientEvent("syncwins",-1,nveh)
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- HOOD
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterServerEvent("tryhood")
- AddEventHandler("tryhood",function(nveh)
- TriggerClientEvent("synchood",-1,nveh)
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- DOORS
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterServerEvent("trydoors")
- AddEventHandler("trydoors",function(nveh,door)
- TriggerClientEvent("syncdoors",-1,nveh,door)
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- CALL
- -----------------------------------------------------------------------------------------------------------------------------------------
- local blips = {}
- RegisterCommand('chamar',function(source,args,rawCommand)
- local source = source
- local answered = false
- local user_id = vRP.getUserId(source)
- if user_id then
- local players = {}
- if args[1] == "911" then
- players = vRP.getUsersByPermission("policia.permissao")
- elseif args[1] == "112" then
- players = vRP.getUsersByPermission("paramedico.permissao")
- elseif args[1] == "mec" then
- players = vRP.getUsersByPermission("mecanico.permissao")
- elseif args[1] == "adm" then
- players = vRP.getUsersByPermission("chamado.permissao")
- elseif args[1] == "taxi" then
- players = vRP.getUsersByPermission("taxista.permissao")
- else
- TriggerClientEvent("Notify",source,"negado","Serviço inexistente.")
- return
- end
- local descricao = vRP.prompt(source,"Descrição:","")
- if descricao == "" then
- return
- end
- local identitys = vRP.getUserIdentity(user_id)
- TriggerClientEvent("Notify",source,"sucesso","Chamado enviado com sucesso.")
- for l,w in pairs(players) do
- local player = vRP.getUserSource(parseInt(w))
- local nuser_id = vRP.getUserId(player)
- local x,y,z = vRPclient.getPosition(source)
- local uplayer = vRP.getUserSource(user_id)
- if player and player ~= uplayer then
- async(function()
- vRPclient.playSound(player,"Out_Of_Area","DLC_Lowrider_Relay_Race_Sounds")
- TriggerClientEvent('chatMessage',player,"CHAMADO",{19,197,43},"Enviado por ^1"..identitys.name.." "..identitys.firstname.."^0, "..descricao)
- local ok = vRP.request(player,"Aceitar o chamado de <b>"..identitys.name.." "..identitys.firstname.."</b>?",30)
- if ok then
- if not answered then
- answered = true
- local identity = vRP.getUserIdentity(nuser_id)
- TriggerClientEvent("Notify",source,"importante","Chamado atendido por <b>"..identity.name.." "..identity.firstname.."</b>, aguarde no local.")
- vRPclient.playSound(source,"Event_Message_Purple","GTAO_FM_Events_Soundset")
- vRPclient._setGPS(player,x,y)
- else
- TriggerClientEvent("Notify",player,"negado","Chamado ja foi atendido por outra pessoa.")
- vRPclient.playSound(player,"CHECKPOINT_MISSED","HUD_MINI_GAME_SOUNDSET")
- end
- end
- local id = idgens:gen()
- blips[id] = vRPclient.addBlip(player,x,y,z,358,71,"Chamado",0.6,false)
- SetTimeout(300000,function() vRPclient.removeBlip(player,blips[id]) idgens:free(id) end)
- end)
- end
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- P
- -----------------------------------------------------------------------------------------------------------------------------------------
- local policia = {}
- RegisterCommand('p',function(source,args,rawCommand)
- local user_id = vRP.getUserId(source)
- local uplayer = vRP.getUserSource(user_id)
- local identity = vRP.getUserIdentity(user_id)
- local x,y,z = vRPclient.getPosition(source)
- if vRPclient.getHealth(source) > 100 then
- if vRP.hasPermission(user_id,"policia.permissao") then
- local soldado = vRP.getUsersByPermission("policia.permissao")
- for l,w in pairs(soldado) do
- local player = vRP.getUserSource(parseInt(w))
- if player and player ~= uplayer then
- async(function()
- local id = idgens:gen()
- policia[id] = vRPclient.addBlip(player,x,y,z,153,84,"Localização de "..identity.name.." "..identity.firstname,0.5,false)
- TriggerClientEvent("Notify",player,"importante","Localização recebida de <b>"..identity.name.." "..identity.firstname.."</b>.")
- vRPclient._playSound(player,"Place_Prop_Fail","DLC_Dmod_Prop_Editor_Sounds")
- SetTimeout(60000,function() vRPclient.removeBlip(player,policia[id]) idgens:free(id) end)
- end)
- end
- end
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- 911
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('911',function(source,args,rawCommand)
- if args[1] then
- local user_id = vRP.getUserId(source)
- local identity = vRP.getUserIdentity(user_id)
- if user_id then
- TriggerClientEvent('chatMessage',-1,identity.name.." "..identity.firstname,{65,130,255},rawCommand:sub(4))
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- 112
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('112',function(source,args,rawCommand)
- if args[1] then
- local user_id = vRP.getUserId(source)
- local identity = vRP.getUserIdentity(user_id)
- if user_id then
- TriggerClientEvent('chatMessage',-1,identity.name.." "..identity.firstname,{255,70,135},rawCommand:sub(4))
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- Twitter
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('twt',function(source,args,rawCommand)
- if args[1] then
- local user_id = vRP.getUserId(source)
- local identity = vRP.getUserIdentity(user_id)
- if user_id then
- TriggerClientEvent('chatMessage',-1,identity.name.." "..identity.firstname,{29,161,242},rawCommand:sub(4))
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- Ilegal
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('ilegal',function(source,args,rawCommand)
- if args[1] then
- local user_id = vRP.getUserId(source)
- local identity = vRP.getUserIdentity(user_id)
- if user_id then
- TriggerClientEvent('chatMessage',-1," ",{29,161,242},rawCommand:sub(7))
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- PR
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('pr',function(source,args,rawCommand)
- if args[1] then
- local user_id = vRP.getUserId(source)
- local identity = vRP.getUserIdentity(user_id)
- local permission = "policia.permissao"
- if vRP.hasPermission(user_id,permission) then
- local soldado = vRP.getUsersByPermission(permission)
- for l,w in pairs(soldado) do
- local player = vRP.getUserSource(parseInt(w))
- if player then
- async(function()
- TriggerClientEvent('chatMessage',player,identity.name.." "..identity.firstname,{255,175,175},rawCommand:sub(3))
- end)
- end
- end
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- HR
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('hr',function(source,args,rawCommand)
- if args[1] then
- local user_id = vRP.getUserId(source)
- local identity = vRP.getUserIdentity(user_id)
- local permission = "paramedico.permissao"
- if vRP.hasPermission(user_id,permission) then
- local soldado = vRP.getUsersByPermission(permission)
- for l,w in pairs(soldado) do
- local player = vRP.getUserSource(parseInt(w))
- if player then
- async(function()
- TriggerClientEvent('chatMessage',player,identity.name.." "..identity.firstname,{255,175,175},rawCommand:sub(3))
- end)
- end
- end
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- mec
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('mec',function(source,args,rawCommand)
- if args[1] then
- local user_id = vRP.getUserId(source)
- local identity = vRP.getUserIdentity(user_id)
- if user_id then
- TriggerClientEvent('chatMessage',-1,identity.name.." "..identity.firstname,{138,43,226},rawCommand:sub(4))
- end
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- ME
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('me',function(source,args,rawCommand)
- if args[1] then
- local user_id = vRP.getUserId(source)
- local identity = vRP.getUserIdentity(user_id)
- TriggerClientEvent('chatME',-1,source,identity.name,rawCommand:sub(3))
- vRP.logs("savedata/me.txt","[ID]: "..user_id.." / [MENSAGEM]: "..rawCommand:sub(3))
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- CARTAS
- -----------------------------------------------------------------------------------------------------------------------------------------
- RegisterCommand('card',function(source,args,rawCommand)
- local user_id = vRP.getUserId(source)
- local identity = vRP.getUserIdentity(user_id)
- if user_id then
- local cd = math.random(1,13)
- local naipe = math.random(1,4)
- TriggerClientEvent('CartasMe',-1,source,identity.name,cd,naipe)
- end
- end)
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- /PAYPAL
- -----------------------------------------------------------------------------------------------------------------------------------------
- -- RegisterCommand('paypal',function(source,args,rawCommand)
- -- local user_id = vRP.getUserId(source)
- -- if user_id then
- -- if args[1] == "sacar" and parseInt(args[2]) > 0 then
- -- local consulta = vRP.getUData(user_id,"vRP:paypal")
- -- local resultado = json.decode(consulta) or ""
- -- if resultado >= parseInt(args[2]) then
- -- vRP.giveBankMoney(user_id,parseInt(args[2]))
- -- vRP.setUData(user_id,"vRP:paypal",json.encode(parseInt(resultado-args[2])))
- -- TriggerClientEvent("Notify",source,"sucesso","Efetuou o saque de <b>$"..vRP.format(parseInt(args[2])).." dólares</b> da sua conta paypal.")
- -- vRP.logs("savedata/paypal.txt","[ID]: "..user_id.." / [SACAR]: "..parseInt(args[2]))
- -- else
- -- TriggerClientEvent("Notify",source,"negado","Dinheiro insuficiente em sua conta paypal.")
- -- end
- -- elseif args[1] == "trans" and parseInt(args[2]) > 0 and parseInt(args[3]) > 0 then
- -- local consulta = vRP.getUData(args[2],"vRP:paypal")
- -- local resultado = json.decode(consulta) or 0
- -- local banco = vRP.getBankMoney(user_id)
- -- if banco >= parseInt(args[3]) then
- -- vRP.setBankMoney(user_id,parseInt(banco-args[3]))
- -- vRP.setUData(parseInt(args[2]),"vRP:paypal",json.encode(parseInt(resultado+args[3])))
- -- vRP.logs("savedata/paypal.txt","[ID]: "..user_id.." / [NID]: "..parseInt(args[2]).." / [TRANSFERENCIA]: "..parseInt(args[3]))
- -- TriggerClientEvent("Notify",source,"sucesso","Enviou <b>$"..vRP.format(parseInt(args[3])).." dólares</b> ao passaporte <b>"..vRP.format(parseInt(args[2])).."</b>.")
- -- local player = vRP.getUserSource(parseInt(args[2]))
- -- if player == nil then
- -- return
- -- else
- -- local identity = vRP.getUserIdentity(user_id)
- -- 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.")
- -- end
- -- else
- -- TriggerClientEvent("Notify",source,"negado","Dinheiro insuficiente.")
- -- end
- -- end
- -- end
- -- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement