Ir para conteúdo
CUPOM: 6AB9C 10% DE DESCONTO - ANARRIÊÊÊÊ 🔥 ×
  • Cadastre-se
CUPOM: 6AB9C 10% DE DESCONTO - ANARRIÊÊÊÊ 🔥

BrunoR

Membro
  • Total de Posts

    102
  • Registro em

  • Última visita

  • Dias Ganhos

    1
  • Pontos

    0 [ Doar ]

Tudo que BrunoR postou

  1. o de vocês funcionou ? o meu continua nao aparecendo as imagens ;(
  2. Boa noite Flaw, isso ja aconteceu comigo e quando fui ver, tinha colocado mapas novos bugado. Verifique se não foi a mesma coisa que aconteceu com você. Abraços.
  3. Boa noite, A linha do código que da erro é essa: data.thirst = data.thirst + variation parte do codigo: function vRP.varyThirst(user_id, variation) local data = vRP.getUserDataTable(user_id) if data then local was_thirsty = data.thirst >= 100 data.thirst = data.thirst + variation local is_thirsty = data.thirst >= 100 local overflow = data.thirst-100 if overflow > 0 then vRPclient._varyHealth(vRP.getUserSource(user_id),-overflow*2) end if data.thirst < 0 then data.thirst = 0 elseif data.thirst > 100 then data.thirst = 100 end local source = source local user_id = vRP.getUserId(source) -- TriggerClientEvent("nation_hud:setThirst",source, 1 - (data.thirst / 100)) TriggerClientEvent("statusThirst",vRP.getUserSource(user_id),100-data.thirst) TriggerClientEvent("hud:statusThirst",vRP.getUserSource(user_id),100-data.thirst) --TriggerClientEvent("hud:updateNeeds",source,data.hunger, data.thirst) -- TriggerClientEvent("vrp_hud:update",source, data.hunger, data.thirst) end end Script da HUD: ----------------------------------------------------------------------------------------------------------------------------------------- -- VRP ----------------------------------------------------------------------------------------------------------------------------------------- local Tunnel = module("vrp","lib/Tunnel") local Proxy = module("vrp","lib/Proxy") vRP = Proxy.getInterface("vRP") dogz = Tunnel.getInterface("vRP") dg = {} Tunnel.bindInterface("hud",dg) ----------------------------------------------------------------------------------------------------------------------------------------- -- VARIABLES ----------------------------------------------------------------------------------------------------------------------------------------- local voice = 2 local stress = 0 local stamina = 0 local oxigen = 0 local hunger = 100 local thirst = 100 local hardness = {} local showHud = false local talking = false local showMovie = false local radioDisplay = "" local homeInterior = false local hour = nil local minute = nil local playerActive = false local hotkey = true ----------------------------------------------------------------------------------------------------------------------------------------- -- SEATBELT ----------------------------------------------------------------------------------------------------------------------------------------- local beltLock = 0 local beltSpeed = 0 local beltVelocity = 0 local updateFoods = GetGameTimer() ----------------------------------------------------------------------------------------------------------------------------------------- -- DIVINABLES ----------------------------------------------------------------------------------------------------------------------------------------- local divingMask = nil local divingTank = nil local clientOxigen = 100 local divingTimers = GetGameTimer() ----------------------------------------------------------------------------------------------------------------------------------------- -- CLOCKVARIABLES ----------------------------------------------------------------------------------------------------------------------------------------- local clockHours = 18 local clockMinutes = 0 local timeDate = GetGameTimer() local weatherSync = "EXTRASUNNY" ----------------------------------------------------------------------------------------------------------------------------------------- -- VRP:PLAYERACTIVE ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("vrp:playerActive") AddEventHandler("vrp:playerActive",function(user_id) playerActive = true end) ----------------------------------------------------------------------------------------------------------------------------------------- -- THREADGLOBAL ----------------------------------------------------------------------------------------------------------------------------------------- Citizen.CreateThread(function() while true do if playerActive then if divingMask ~= nil then if GetGameTimer() >= divingTimers then divingTimers = GetGameTimer() + 35000 clientOxigen = clientOxigen - 1 dogz.clientOxigen() if clientOxigen <= 0 then ApplyDamageToPed(PlayerPedId(),50,false) end end end end Citizen.Wait(5000) end end) ----------------------------------------------------------------------------------------------------------------------------------------- -- THREADFOODS ----------------------------------------------------------------------------------------------------------------------------------------- Citizen.CreateThread(function() while true do if playerActive then local ped = PlayerPedId() if GetGameTimer() >= updateFoods and GetEntityHealth(ped) > 101 then updateFoods = GetGameTimer() + 90000 thirst = thirst - 1 hunger = hunger - 1 dogz.clientFoods() end end Citizen.Wait(30000) end end) ----------------------------------------------------------------------------------------------------------------------------------------- -- THREADGLOBAL ----------------------------------------------------------------------------------------------------------------------------------------- Citizen.CreateThread(function() while true do if GetGameTimer() >= timeDate then timeDate = GetGameTimer() + 3000 clockMinutes = clockMinutes + 2 if clockMinutes >= 60 then clockHours = clockHours + 1 clockMinutes = 0 if clockHours >= 24 then clockHours = 0 end end end Citizen.Wait(10000) end end) --[[ ----------------------------------------------------------------------------------------------------------------------------------------- -- THREADTIMERS ----------------------------------------------------------------------------------------------------------------------------------------- Citizen.CreateThread(function() while true do if homeInterior then SetWeatherTypeNow("EXTRASUNNY") SetWeatherTypePersist("EXTRASUNNY") SetWeatherTypeNowPersist("EXTRASUNNY") NetworkOverrideClockTime(12,00,00) else SetWeatherTypeNow(weatherSync) SetWeatherTypePersist(weatherSync) SetWeatherTypeNowPersist(weatherSync) NetworkOverrideClockTime(clockHours,clockMinutes,00) end if beltLock >= 1 then DisableControlAction(1,75,true) end Citizen.Wait(0) end end) ]] ----------------------------------------------------------------------------------------------------------------------------------------- -- VOICETALKING ----------------------------------------------------------------------------------------------------------------------------------------- AddEventHandler("hud:userTalking",function(status) talking = status end) ----------------------------------------------------------------------------------------------------------------------------------------- -- PROGRESS ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("Progress") AddEventHandler("Progress",function(progressTimer) SendNUIMessage({ progress = true, progressTimer = parseInt(progressTimer - 500) }) end) ----------------------------------------------------------------------------------------------------------------------------------------- -- THREADHUD ----------------------------------------------------------------------------------------------------------------------------------------- Citizen.CreateThread(function() while true do if showHud then updateDisplayHud() end Citizen.Wait(500) end end) ----------------------------------------------------------------------------------------------------------------------------------------- -- UPDATEDISPLAYHUD ----------------------------------------------------------------------------------------------------------------------------------------- local streetLast = 0 local flexDirection = "Norte" function updateDisplayHud() local ped = PlayerPedId() local coords = GetEntityCoords(ped) local heading = GetEntityHeading(ped) local armour = GetPedArmour(ped) local health = GetEntityHealth(ped) local streetName = GetStreetNameFromHashKey(GetStreetNameAtCoord(coords["x"],coords["y"],coords["z"])) if heading >= 315 or heading < 45 then flexDirection = "Norte" elseif heading >= 45 and heading < 135 then flexDirection = "Oeste" elseif heading >= 135 and heading < 225 then flexDirection = "Sul" elseif heading >= 225 and heading < 315 then flexDirection = "Leste" end hours = GetClockHours() minutes = GetClockMinutes() if hours <= 9 then hours = "0"..hours end if minutes <= 9 then minutes = "0"..minutes end local horario = hours..":"..minutes if IsPedInAnyVehicle(ped) then local vehicle = GetVehiclePedIsUsing(ped) local fuel = GetVehicleFuelLevel(vehicle) local plate = string.gsub(GetVehicleNumberPlateText(vehicle), " ", "") local speed = GetEntitySpeed(vehicle) * 3.6 local showBelt = true if GetVehicleClass(vehicle) == 8 and (GetVehicleClass(vehicle) >= 13 and GetVehicleClass(vehicle) <= 16) and GetVehicleClass(vehicle) == 21 then showBelt = false end SendNUIMessage({ vehicle = true, talking = talking, health = health, armour = armour, thirst = thirst, hunger = hunger, stress = stress, stamina = stamina, oxigen = clientOxigen, suit = divingMask, street = streetName, direction = flexDirection, radio = radioDisplay, voice = voice, fuel = fuel, speed = speed, time = horario, showbelt = showBelt, seatbelt = beltLock, hardness = (hardness[plate] or 0), hotkey = hotkey }) else SendNUIMessage({ vehicle = false, talking = talking, health = health, armour = armour, thirst = thirst, hunger = hunger, stress = stress, stamina = stamina, oxigen = clientOxigen, suit = divingMask, street = streetName, direction = flexDirection, radio = radioDisplay, voice = voice, time = horario, hotkey = hotkey }) end end ----------------------------------------------------------------------------------------------------------------------------------------- -- HUD ----------------------------------------------------------------------------------------------------------------------------------------- RegisterCommand("hud",function(source,args) showHud = not showHud updateDisplayHud() SendNUIMessage({ hud = showHud }) end) Citizen.CreateThread(function() showHud = not showHud updateDisplayHud() SendNUIMessage({ hud = showHud }) end) ----------------------------------------------------------------------------------------------------------------------------------------- -- MOVIE ----------------------------------------------------------------------------------------------------------------------------------------- RegisterCommand("movie",function(source,args) showMovie = not showMovie updateDisplayHud() SendNUIMessage({ movie = showMovie }) end) ----------------------------------------------------------------------------------------------------------------------------------------- -- THREADTIMERS ----------------------------------------------------------------------------------------------------------------------------------------- Citizen.CreateThread(function() DisplayRadar(false) RequestStreamedTextureDict("circlemap",false) while not HasStreamedTextureDictLoaded("circlemap") do Citizen.Wait(100) end AddReplaceTexture("platform:/textures/graphics","radarmasksm","circlemap","radarmasksm") SetMinimapClipType(1) SetMinimapComponentPosition("minimap","L","B",0.0,0.0,0.158,0.28) SetMinimapComponentPosition("minimap_mask","L","B",0.155,0.12,0.080,0.164) SetMinimapComponentPosition("minimap_blur","L","B",-0.005,0.021,0.240,0.302) Citizen.Wait(5000) SetBigmapActive(true,false) Citizen.Wait(100) SetBigmapActive(false,false) end) ----------------------------------------------------------------------------------------------------------------------------------------- -- HUD:TOGGLEHOOD ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("hud:toggleHood") AddEventHandler("hud:toggleHood",function() showHood = not showHood if showHood then SetPedComponentVariation(PlayerPedId(),1,69,0,1) else SetPedComponentVariation(PlayerPedId(),1,0,0,1) end SendNUIMessage({ hood = showHood }) end) ----------------------------------------------------------------------------------------------------------------------------------------- -- HUD:HARDNESS ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("hud:plateHardness") AddEventHandler("hud:plateHardness",function(vehPlate,status) hardness[vehPlate] = parseInt(status) end) ----------------------------------------------------------------------------------------------------------------------------------------- -- HUD:ALLHARDNESS ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("hud:allHardness") AddEventHandler("hud:allHardness",function(vehHardness) hardness = vehHardness end) ----------------------------------------------------------------------------------------------------------------------------------------- -- HUD:REMOVEHOOD ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("hud:removeHood") AddEventHandler("hud:removeHood",function() if showHood then showHood = false SendNUIMessage({ hood = showHood }) SetPedComponentVariation(PlayerPedId(),1,0,0,1) end end) ----------------------------------------------------------------------------------------------------------------------------------------- -- STATUSFOOD ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("statusHunger", function(statusHunger) hunger = parseInt(statusHunger) end) RegisterNetEvent("statusThirst", function(statusThrist) thirst = parseInt(statusThrist) end) RegisterNetEvent("statusStress", function(statusStress) stress = parseInt(statusStress) end) ----------------------------------------------------------------------------------------------------------------------------------------- -- STATUSOXIGEN ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("statusOxigen") AddEventHandler("statusOxigen",function(number) clientOxigen = parseInt(number) end) ----------------------------------------------------------------------------------------------------------------------------------------- -- RECHARGEOXIGEN ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("hud:rechargeOxigen") AddEventHandler("hud:rechargeOxigen",function() TriggerEvent("Notify","verde","Reabastecimento concluído.",3000) dogz.rechargeOxigen() clientOxigen = 100 end) ----------------------------------------------------------------------------------------------------------------------------------------- -- HUDACTIVE ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("hudActived") AddEventHandler("hudActived",function(status) showHud = status updateDisplayHud() --testar isso dps SendNUIMessage({ hud = showHud }) end) RegisterKeyMapping('shortcuts', 'Atalhos', 'keyboard', 'u') RegisterCommand("shortcuts", function() hotkey = false end) ----------------------------------------------------------------------------------------------------------------------------------------- -- HUD:VOICEMODE ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("pma-voice:setTalkingMode", function(status) voice = status end) ----------------------------------------------------------------------------------------------------------------------------------------- -- HUD:RADIODISPLAY ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("hud:RadioDisplay") AddEventHandler("hud:RadioDisplay",function(number) if parseInt(number) <= 0 then radioDisplay = "" else radioDisplay = parseInt(number) end end) ----------------------------------------------------------------------------------------------------------------------------------------- -- FOWARDPED ----------------------------------------------------------------------------------------------------------------------------------------- function fowardPed(ped) local heading = GetEntityHeading(ped) + 90.0 if heading < 0.0 then heading = 360.0 + heading end heading = heading * 0.0174533 return { x = math.cos(heading) * 2.0, y = math.sin(heading) * 2.0 } end ----------------------------------------------------------------------------------------------------------------------------------------- -- THREADBELT ----------------------------------------------------------------------------------------------------------------------------------------- Citizen.CreateThread(function() while true do local timeDistance = 999 if playerActive then local ped = PlayerPedId() if IsPedInAnyVehicle(ped) then if not IsPedOnAnyBike(ped) and not IsPedInAnyHeli(ped) and not IsPedInAnyPlane(ped) then timeDistance = 1 local vehicle = GetVehiclePedIsUsing(ped) local speed = GetEntitySpeed(vehicle) * 3.6 if speed ~= beltSpeed then local plate = string.gsub(GetVehicleNumberPlateText(vehicle), " ", "") if ((beltSpeed - speed) >= 50 and beltLock == 0) or ((beltSpeed - speed) >= 60 and beltLock == 1 and hardness[plate] == nil and GetPedInVehicleSeat(vehicle,-1) == ped) then local fowardVeh = fowardPed(ped) local coords = GetEntityCoords(ped) SetEntityCoords(ped,coords["x"] + fowardVeh["x"],coords["y"] + fowardVeh["y"],coords["z"] + 1,1,0,0,0) SetEntityVelocity(ped,beltVelocity["x"],beltVelocity["y"],beltVelocity["z"]) ApplyDamageToPed(ped,50,false) Citizen.Wait(1) SetPedToRagdoll(ped,5000,5000,0,0,0,0) end beltVelocity = GetEntityVelocity(vehicle) beltSpeed = speed end end else if beltSpeed ~= 0 then beltSpeed = 0 end if beltLock == 1 then beltLock = 0 end end end Citizen.Wait(timeDistance) end end) ----------------------------------------------------------------------------------------------------------------------------------------- -- SEATBELT ----------------------------------------------------------------------------------------------------------------------------------------- RegisterCommand("seatbelt",function(source,args) local ped = PlayerPedId() if IsPedInAnyVehicle(ped) then if not IsPedOnAnyBike(ped) then if beltLock == 1 then TriggerEvent("vrp_sound:source","unbelt",0.5) beltLock = 0 else TriggerEvent("vrp_sound:source","belt",0.5) beltLock = 1 end end end end) ----------------------------------------------------------------------------------------------------------------------------------------- -- KEYMAPPING ----------------------------------------------------------------------------------------------------------------------------------------- RegisterKeyMapping("seatbelt","Colocar/Retirar o cinto.","keyboard","g") ----------------------------------------------------------------------------------------------------------------------------------------- -- HUD:SYNCTIMERS ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("hud:syncTimers") AddEventHandler("hud:syncTimers",function(timer) clockHours = parseInt(timer[2]) clockMinutes = parseInt(timer[1]) weatherSync = timer[3] end) ----------------------------------------------------------------------------------------------------------------------------------------- -- HOMES:HOURS ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("homes:Hours") AddEventHandler("homes:Hours",function(status) homeInterior = status end) ----------------------------------------------------------------------------------------------------------------------------------------- -- THREADHEALTHREDUCE ----------------------------------------------------------------------------------------------------------------------------------------- Citizen.CreateThread(function() while true do local ped = PlayerPedId() if GetEntityHealth(ped) > 101 then if hunger >= 6 and hunger <= 15 then ApplyDamageToPed(ped,1,false) TriggerEvent("Notify","Fome","🍔 Sofrendo com a fome.",5000,"left") elseif hunger <= 5 then ApplyDamageToPed(ped,2,false) TriggerEvent("Notify","Fome","🍔 Sofrendo com a fome.",5000,"left") end if thirst >= 6 and thirst <= 15 then ApplyDamageToPed(ped,1,false) TriggerEvent("Notify","Sede","💧 Sofrendo com a sede.",5000,"left") elseif thirst <= 5 then ApplyDamageToPed(ped,2,false) TriggerEvent("Notify","Sede","💧 Sofrendo com a sede.",5000,"left") end end Citizen.Wait(15000) end end) ----------------------------------------------------------------------------------------------------------------------------------------- -- THREADSHAKESTRESS ----------------------------------------------------------------------------------------------------------------------------------------- Citizen.CreateThread(function() while true do local timeDistance = 999 if playerActive then local ped = PlayerPedId() local health = GetEntityHealth(ped) if health > 101 then if stress >= 99 then ShakeGameplayCam("LARGE_EXPLOSION_SHAKE",0.75) elseif stress >= 80 and stress <= 98 then timeDistance = 9990 ShakeGameplayCam("LARGE_EXPLOSION_SHAKE",0.50) elseif stress >= 60 and stress <= 79 then timeDistance = 7500 ShakeGameplayCam("LARGE_EXPLOSION_SHAKE",0.25) elseif stress >= 40 and stress <= 59 then timeDistance = 9990 ShakeGameplayCam("LARGE_EXPLOSION_SHAKE",0.05) end end end Citizen.Wait(timeDistance) end end) ----------------------------------------------------------------------------------------------------------------------------------------- -- REMOVESCUBA ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("hud:removeScuba") AddEventHandler("hud:removeScuba",function() local ped = PlayerPedId() if DoesEntityExist(divingMask) or DoesEntityExist(divingTank) then if DoesEntityExist(divingMask) then TriggerServerEvent("tryDeleteObject",NetworkGetNetworkIdFromEntity(divingMask)) divingMask = nil end if DoesEntityExist(divingTank) then TriggerServerEvent("tryDeleteObject",NetworkGetNetworkIdFromEntity(divingTank)) divingTank = nil end SetEnableScuba(ped,false) SetPedMaxTimeUnderwater(ped,10.0) end end) ----------------------------------------------------------------------------------------------------------------------------------------- -- HUD:SETDIVING ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent("hud:setDiving") AddEventHandler("hud:setDiving",function() local ped = PlayerPedId() if DoesEntityExist(divingMask) or DoesEntityExist(divingTank) then if DoesEntityExist(divingMask) then TriggerServerEvent("tryDeleteObject",NetworkGetNetworkIdFromEntity(divingMask)) divingMask = nil end if DoesEntityExist(divingTank) then TriggerServerEvent("tryDeleteObject",NetworkGetNetworkIdFromEntity(divingTank)) divingTank = nil end SetEnableScuba(ped,false) SetPedMaxTimeUnderwater(ped,10.0) else local maskModel = GetHashKey("p_s_scuba_mask_s") local tankModel = GetHashKey("p_s_scuba_tank_s") RequestModel(tankModel) while not HasModelLoaded(tankModel) do Citizen.Wait(1) end RequestModel(maskModel) while not HasModelLoaded(maskModel) do Citizen.Wait(1) end if HasModelLoaded(tankModel) then divingTank = CreateObject(tankModel,1.0,1.0,1.0,true,true,false) AttachEntityToEntity(divingTank,ped,GetPedBoneIndex(ped,24818),-0.28,-0.24,0.0,180.0,90.0,0.0,1,1,0,0,2,1) SetEntityAsMissionEntity(divingTank,true,true) SetModelAsNoLongerNeeded(divingTank) end if HasModelLoaded(maskModel) then divingMask = CreateObject(maskModel,1.0,1.0,1.0,true,true,false) AttachEntityToEntity(divingMask,ped,GetPedBoneIndex(ped,12844),0.0,0.0,0.0,180.0,90.0,0.0,1,1,0,0,2,1) SetEntityAsMissionEntity(divingMask,true,true) SetModelAsNoLongerNeeded(divingMask) end SetEnableScuba(ped,true) SetPedMaxTimeUnderwater(ped,2000.0) end end) ----------------------------------------------------------------------------------------------------------------------------------------- -- ----------------------------------------------------------------------------------------------------------------------------------------- Citizen.CreateThread(function() while true do local skips = 1000 local ped = PlayerPedId() if IsPedInAnyVehicle(ped) and showHud then if not IsMinimapRendering() then DisplayRadar(true) end else if IsMinimapRendering() then DisplayRadar(false) end end if beltLock == 1 then skips = 1 DisableControlAction(1,75,true) -- não deixa sair do veiculo enquanto estiver de cinto end Citizen.Wait(skips) end end)
  4. Bom dia amigo, Obrigado pelo apoio em tentar ajudar. Fiz a alteração e agora apresentou o erro abaixo: script:vrp] SCRIPT ERROR: @vrp/modules/survival.lua:83: attempt to perform arithmetic on a nil value (field 'thirst') ;(
  5. Boa noite, A minha base o fome e sede estava funcionando normalmente e agora está dando o erro abaixo: SCRIPT ERROR: @vrp/modules/survival.lua:82: attempt to compare number with nil Segue o código abaixo complexo e a linha 82 é essa parte: local was_thirsty = data.thirst >= 100 OBS: Nem a fome nem a sede está abaixando. Não consegui descobrir o motivo desse erro ;( function vRP.varyThirst(user_id, variation) local data = vRP.getUserDataTable(user_id) if data then local was_thirsty = data.thirst >= 100 data.thirst = data.thirst + variation local is_thirsty = data.thirst >= 100 local overflow = data.thirst-100 if overflow > 0 then vRPclient._varyHealth(vRP.getUserSource(user_id),-overflow*2) end if data.thirst < 0 then data.thirst = 0 elseif data.thirst > 100 then data.thirst = 100 end local source = vRP.getUserSource(user_id) -- TriggerClientEvent("nation_hud:setThirst",source, 1 - (data.thirst / 100)) TriggerClientEvent("statusThirst",vRP.getUserSource(user_id),100-data.thirst) TriggerClientEvent("hud:statusThirst",vRP.getUserSource(user_id),100-data.thirst) --TriggerClientEvent("hud:updateNeeds",source,data.hunger, data.thirst) -- TriggerClientEvent("vrp_hud:update",source, data.hunger, data.thirst) end end
  6. Coloquei o seu codigo e resolveu amigo, Obrigado pelo apoio 😉 Abraços.
  7. Boa noite Murai, Segue abaixo o meu arquivo: OBS: Inclusive se o carro estiver quebrado eu não consigo guardar e isso é muito ruim, é nessa parte que vejo isso tbm ? Desde ja agradeço. -- GUARDAR O VEÍCULO -- RegisterNUICallback("save-vehicle", function(data) if data and data.vehicle and not block then local modelName = GetDisplayNameFromVehicleModel(data.vehicle):lower() local inStreet, netveh = checkInStreet(modelName) if inStreet then local vehicle = NetToVeh(netveh) if DoesEntityExist(vehicle) then local distance = #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(vehicle)) if distance < 30 then local plate, engine, body, fuel = GetVehicleNumberPlateText(vehicle), parseInt(GetVehicleEngineHealth(vehicle)), parseInt(GetVehicleBodyHealth(vehicle)), parseInt(GetVehicleFuelLevel(vehicle)) local danoMotor = engine/10 local danoChassi = body/10 if danoMotor >= 90 then if danoChassi >= 90 then --TriggerEvent("Notify","sucesso","Seu motor está em "..parseInt(engine/10), 3000) func.saveVehicle(data.vehicle, plate, engine, body, fuel) TriggerServerEvent("nation:deleteVehicleSync",netveh) notify(data.vehicle, "guardou", config.getVehicleModel(data.vehicle)) closeGarage() else closeGarage() TriggerEvent("Notify","negado","Sua lataria está muito danificado, chame um mecânico para arrumar antes de guardar!", 3000) end else closeGarage() TriggerEvent("Notify","negado","Seu motor está muito danificado, chame um mecânico para arrumar antes de guardar!", 3000) end end end end end end) RegisterNUICallback("save-nearest-vehicle", function(data) if not block then local vehicle = getNearestVehicle(15) if DoesEntityExist(vehicle) then local distance = #(GetEntityCoords(PlayerPedId()) - GetEntityCoords(vehicle)) if distance < 30 then local plate, engine, body, fuel = GetVehicleNumberPlateText(vehicle), parseInt(GetVehicleEngineHealth(vehicle)), parseInt(GetVehicleBodyHealth(vehicle)), parseInt(GetVehicleFuelLevel(vehicle)) local vehInfo = func.getVehicleInfo(GetEntityModel(vehicle)) if vehInfo and vehInfo.name then func.saveVehicle(vehInfo.name, plate, engine, body, fuel) TriggerServerEvent("nation:deleteVehicleSync",VehToNet(vehicle)) notify(vehInfo.name, "guardou", config.getVehicleModel(vehInfo.name)) end closeGarage() end end end end)
  8. Boa noite, Como seria uma query pra eu zerar todas as horas da coluna TempoTotal ?? o nome da tabela é vrp_users Desde ja agradeço!
  9. Boa noite, Alguém sabe qual a parte da nation garage que mexe com o código na parte de guardar o veiculo e spawnar ? Na minha cidade, se eu guardar o veiculo quebrado, quando eu retiro ele, automaticamente ele spawna bonzinho, como se nada tivesse acontecido. Alguém pode me ajudar ? --- GUARDA O VEÍCULO NA GARAGEM E SALVA SUAS INFORMAÇÕES NO BANCO DE DADOS ----- function func.saveVehicle(vehicle,plate,engine,body,fuel,estado) if not vehicle or not plate or not engine or not body or not fuel then return end local user_id = vRP.getVehiclePlate(plate) or vRP.getUserByRegistration(plate) -- local vehicle = vRP.query("creative/get_vehicles",{ user_id = parseInt(user_id), vehicle = vehicle }) -- if vehicle[1] ~= nil then -- end if user_id then -- vRP.execute("vRP/setVehicleData", { engine = engine, body = body, fuel = fuel, estado = json.encode(estado or {}), user_id = user_id, vehicle = vehicle }) vRP.execute("vrp/set_update_vehicles",{ user_id = parseInt(user_id), vehicle = vehicle, engine = parseInt(engine), body = parseInt(body), fuel = parseInt(fuel) }) print(user_id, vehicle, fuel) end end ----------------------------------------------------------------------------------------------------------------------------------------- --[ SPAWNAR VEÍCULO ]-------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------- RegisterNetEvent('spawnarveiculo2') AddEventHandler('spawnarveiculo2',function(name) local mhash = GetHashKey(name) while not HasModelLoaded(mhash) do RequestModel(mhash) Citizen.Wait(10) end if HasModelLoaded(mhash) then local ped = PlayerPedId() local nveh = CreateVehicle(mhash,GetEntityCoords(ped),GetEntityHeading(ped),true,true) NetworkRegisterEntityAsNetworked(nveh) while not NetworkGetEntityIsNetworked(nveh) do NetworkRegisterEntityAsNetworked(nveh) Citizen.Wait(1) end SetVehicleOnGroundProperly(nveh) SetVehicleAsNoLongerNeeded(nveh) SetVehicleIsStolen(nveh,false) SetPedIntoVehicle(ped,nveh,-1) SetVehicleNeedsToBeHotwired(nveh,false) SetEntityInvincible(nveh,false) SetVehicleNumberPlateText(nveh,vRP.getRegistrationNumber()) Citizen.InvokeNative(0xAD738C3085FE7E11,nveh,true,true) SetVehicleHasBeenOwnedByPlayer(nveh,true) SetVehRadioStation(nveh,"OFF") SetModelAsNoLongerNeeded(mhash) end end)
    TOOPPP Testei na minha City e está funcionando bem mesmo! 😉 Obrigado Hide!!
    Bom diaa, Testei na minha base e não funcionou ;(
  10. Boa noite, Alguém tem o código pra conseguir por VIP armas na Cidade ? De modo que todo tiro que essa pessoa der, não ativa a policia. Abraços.
  11. Está dando esse erro e ninguém consegue tirar o carro da garagem, porque o blip some ;( [Conteúdo oculto]
  12. Hideki, O único código que achei foi esse aqui e não sei o que fazer ;( Pode ajudar ? Foto da tabela: [Conteúdo oculto] vRP._prepare("vRP/create_ipva", "ALTER TABLE vrp_user_vehicles ADD IF NOT EXISTS ipva varchar(255) DEFAULT '1930912803'") Citizen.CreateThread(function() vRP.execute("vrp/create_ipva") while config.reset do if #vehicles > 0 then local users = vRP.getUsers() for i in ipairs(vehicles) do local active = false for j in ipairs(users) do local src = users[j] if fclient.isVehicleActive(src,vehicles[i].netveh) then active = true vehicles[i].time = config.tempoReset * 60 break end end if not active then vehicles[i].time = vehicles[i].time - 60 if vehicles[i].time <= 0 then fclient.deleteVehicle(-1,vehicles[i].netveh) table.remove(vehicles,i) end end end end Citizen.Wait(60*1000) end end)
  13. Muito Obrigado amigo! 😉 Agora quando starto a base está aparecendo esse erro: [script:combo_oxmysql] Prepare inexistent (vrp/create_ipva). Tentei tirar o - da frente do prepare (codigo que você postou) mais nao deu certo tbm ;(
×
×
  • Criar Novo...