local hasAlreadyEnteredMarker, lastZone local tanker, trailer local decreaseRate = 1 local gas_tanker,fuelType,currentType = "","","" local liter,nitroPower = 0,0 local filling,refuel,startrefuel,ropeDelete,startTankerCar,returnFillRope,setData,HoldingSpecialNozzle,nitroActive,propFill,fuelSynced,deleteRope,electricControl= false, false,false,false,false,false,false,false,false,false,false,false,false local Rope,fuelnozzle,SpecialFuelNozzleObj,fuelVehicle ,currentAction,currentActionMsg,ElectricNozzle ,enozz= nil,nil,nil,nil,nil,nil,nil,nil local trailpurgeParticles,trailpurgeVehicles,purgeVehicles,purgeParticles,frknData,playerData,currentActionData,Props,fillData = {},{},{},{},{},{},{},{},{} local Keys = {["ESC"] = 322,["F1"] = 288,["F2"] = 289,["F3"] = 170,["F5"] = 166,["F6"] = 167,["F7"] = 168,["F8"] = 169,["F9"] = 56,["F10"] = 57,["~"] = 243,["1"] = 157,["2"] = 158,["3"] = 160,["4"] = 164,["5"] = 165,["6"] = 159,["7"] = 161,["8"] = 162,["9"] = 163,["-"] = 84,["="] = 83,["BACKSPACE"] = 177,["TAB"] = 37,["Q"] = 44,["W"] = 32,["E"] = 38,["R"] = 45,["T"] = 245,["Y"] = 246,["U"] = 303,["P"] = 199,["["] = 39,["]"] = 40,["ENTER"] = 18,["CAPS"] = 137,["A"] = 34,["S"] = 8,["D"] = 9,["F"] = 23,["G"] = 47,["H"] = 74,["K"] = 311,["L"] = 182,["LEFTSHIFT"] = 21,["Z"] = 20,["X"] = 73,["C"] = 26,["V"] = 0,["B"] = 29,["N"] = 249,["M"] = 244,[","] = 82,["."] = 81,["LEFTCTRL"] = 36,["LEFTALT"] = 19,["SPACE"] = 22,["RIGHTCTRL"] = 70,["HOME"] = 213,["PAGEUP"] = 10,["PAGEDOWN"] = 11,["DELETE"] = 178,["LEFT"] = 174,["RIGHT"] = 175,["TOP"] = 27,["DOWN"] = 173} RegisterCommand("emp", function(source, args, rawCommand) local employeeStations = {} for _, stationData in pairs(frknData) do local parsedEmployees = json.decode(stationData.employees) for _, employee in ipairs(parsedEmployees) do local employeeIdentifier = employee.identifier if playerData.citizenid == employeeIdentifier then table.insert(employeeStations, stationData) end end end if #employeeStations > 0 then SetNuiFocus(1, 1) OpenMenuExport() SendNUIMessage({ action = "BOSS_MENU", data = { myStation = employeeStations[1], playerData = playerData, config = Config.MyStation, type = "employee" } }) else Notify(Config.Notify["noemployee"]) end end) RegisterCommand("fuel", function() sendData = {} identifier = "" for k, v in pairs(frknData) do if CoreName == "qb-core" or CoreName == "qbx-core" then identifier = playerData.citizenid else playerData = GetPlayerData() identifier = playerData.identifier end if identifier == v.owner then sendData = v end end TriggerCallback('frkn-fuelstation:getdiscord',function(discord) Wait(500) if sendData.id == getFuelId() then if next(sendData) then OpenMenuExport() SetNuiFocus(1, 1) SendNUIMessage({ action = "BOSS_MENU", data = { myStation = sendData, playerData = playerData, config = Config.MyStation, type = "boss", identifier = identifier, discordAvatar = discord } }) else Notify(Config.Notify["noboss"]) end else Notify(Config.Notify["nofuelarea"]) end end) end) RegisterCommand("sell",function(source,args,rawCommand) local targetId = tonumber(args[1]) if targetId then TriggerCallback('frkn-fuelstation:sellFuel',function() end,getFuelId(),targetId) else Notify(Config.Notify["nofuel"]) end end) -- ???????????????????????????????????????????????? -- ? NUI CALLBACK ? -- ???????????????????????????????????????????????? RegisterNUICallback("exit", function() SetNuiFocus(false, false) SendNuiMessage({action = "CLOSE"}) CloseMenuExport() end) RegisterNUICallback("leaveVehicle",function(data,cb) local ped = PlayerPedId() local vehicle = GetVehiclePedIsIn(ped, false) TaskLeaveVehicle(ped, vehicle, 16) --BU KOD ACILACAK end) RegisterNUICallback("getProps",function(a,cb) cb(Config.TankerProp) end) RegisterNUICallback("selectProp",function(data,cb) SetNuiFocus(false,false) TriggerServerEvent('frkn-fuelstation:selectProp',data) end) RegisterNUICallback("setCoord",function(data,cb) SetNuiFocus(false,false) data = { pos = ChooseSpawnLocation(data.name,vector4(0, 0, 0,0)), id = data.id, hash = data.hash } if data.pos == "exit" then else CloseMenuExport() SendNUIMessage({action = "CLOSE_KEY"}) TriggerServerEvent('frkn-fuelstation:setCoord',data) end end) RegisterNUICallback("setProp",function(a,cb) SetNuiFocus(false,false) data = { pos = ChooseSpawnLocation(a.name,vector4(0, 0, 0,0)), id = a.id, hash = a.hash } if data.pos == "exit" then else CloseMenuExport() SendNUIMessage({action = "CLOSE_KEY"}) TriggerServerEvent('frkn-fuelstation:setProp',data) end end) RegisterNUICallback("hire", function(data, cb) -- if data.identifier == playerData.citizenid then -- cb(Config.NotifyMenu["hire"]["error"]) -- else TriggerServerEvent('frkn-fuelstation:hire', data) cb({status=true}) -- end end) RegisterNUICallback("fire", function(data, cb) TriggerServerEvent('frkn-fuelstation:fire', data) end) RegisterNUICallback("withdraw", function(data, cb) TriggerCallback('frkn-fuelstation:withdraw', function(bool, a) local combinedData = { message = bool.message, status = bool.status, amount = a } cb(combinedData) end, data) end) RegisterCommand("cartype",function(source,args,rawCommand) local ped = PlayerPedId() local veh = GetVehiclePedIsIn(ped, false) if IsPedInAnyVehicle(ped, true) then text = "Your car type is " .. getCarFuelType(veh) Notify(text) else Notify("You are not in a vehicle") end end) RegisterNUICallback("buyGas", function(data, cb) data.car = getVehicleName() data.plate = getVehiclePlate() fuelVehicle = GetVehiclePedIsIn(PlayerPedId(), false) local getFuelLevel = GetVehicleFuelLevel(fuelVehicle) local tank = json.decode(frknData[data.id]["gas_tanker"]) local currentTank = tank[data.type] local multiplication = frknData[data.id]["ownership"] == 0 and 2 or 1 liter = data.liter local msg = "success" if data.type == "electric" and getCarFuelType(fuelVehicle) ~= "electric" then canBuyGas = false msg = "electric2" end if data.type ~= "nitro" then TriggerCallback('frkn-fuelstation:carTypeCheck', function(check) local change = getFuelLevel <= Config.FuelReplacementValue if change or check == "none" or data.type == getCarFuelType(fuelVehicle) then msg = "success" else msg = "othergas" end if tonumber(currentTank) < tonumber(liter) then msg = "tanker" end if getFuelLevel + liter > 100 then msg = "full" canBuyGas = false end local canBuyGas = (frknData[data.id]["ownership"] == 0) or (msg == "success") if canBuyGas then TriggerCallback('frkn-fuelstation:buyGas', function(bool) bool.message = (multiplication == 2) and Config.NotifyMenu["gas"]["nostation"]["message"] or bool.message refuel = bool.status cb(bool) end, data, multiplication) else cb(Config.NotifyMenu["gas"][msg]) Citizen.Wait(1000) end end, getVehiclePlate(), data.type) else TriggerCallback('frkn-fuelstation:buyGas', function(bool) bool.message = (multiplication == 2) and Config.NotifyMenu["gas"]["nostation"]["message"] or bool.message refuel = bool.status cb(bool) end, data, multiplication) end end) RegisterNUICallback("changePrice", function(data, cb) TriggerCallback('frkn-fuelstation:changePrice', function(bool) cb(bool) end, data) end) RegisterNUICallback("setLevel", function(data, cb) -- local parsedData = json.decode(data) TriggerCallback('frkn-fuelstation:setLevel', function(bool) cb(bool) end, data) end) RegisterNUICallback("getUsers", function(data, cb) TriggerCallback('frkn-fuelstation:getUsers', function(bool) cb(bool) end, data) end) RegisterNUICallback("getEmployees", function(data, cb) cb(frknData[data.id].employees) end) RegisterNUICallback("changeName", function(data, cb) TriggerCallback('frkn-fuelstation:changeName', function(bool) cb(bool) end, data) end) RegisterNUICallback("fill", function(data, cb) TriggerCallback('frkn-fuelstation:fill', function(bool) cb(bool) Citizen.Wait(500) if bool.status then fillData = data StartFill() SendNUIMessage({action = 'CLOSE'}) SetNuiFocus(false, false) return end end, data) end) RegisterNUICallback("buyStation", function(data, cb) TriggerCallback('frkn-fuelstation:buyFuel',function(bool) cb(bool) end, data.buyStationId,frknData[data.buyStationId].price) end) RegisterNUICallback("setMap", function(data, cb) SetNewWaypoint(Config.GasStations[data.id].zones[1].x, Config.GasStations[data.id].zones[1].y, 0, "Gas") end) RegisterNUICallback("buyJerry",function(data,cb) TriggerCallback('frkn-fuelstation:buyJerry',function(bool) cb(bool) end,data) end) -- ???????????????????????????????????????????????? -- ? LOOP ? -- ???????????????????????????????????????????????? Citizen.CreateThread(function() RequestModel('electric_charger') while not HasModelLoaded('electric_charger') do RequestModel('electric_charger') Wait(2000) end local bones = { "bonnet", "boot", "door_dside_f", "door_pside_f", "seat_dside_f", "seat_pside_f", "seat_dside_r", "seat_pside_r", -- Motorcycles "engine", "wheel_lf", "wheel_rf", "wheel_lm1", "wheel_rm1", "wheel_lr", "wheel_rr" } if Config.ElectricChargerModel then for i = 1, #Config.GasStations do if Config.GasStations[i].electricchargercoords ~= nil then local heading = Config.GasStations[i].electricchargercoords[4] - 200 Config.GasStations[i].electriccharger = CreateObject('electric_charger', Config.GasStations[i].electricchargercoords.x, Config.GasStations[i].electricchargercoords.y, Config.GasStations[i].electricchargercoords.z, false, true, true) SetEntityHeading(Config.GasStations[i].electriccharger, heading) FreezeEntityPosition(Config.GasStations[i].electriccharger, 1) SetModelAsNoLongerNeeded('electric_charger') end end end if Config.Interaction.UseTarget then if Config.Interaction.Target == "qb-target" then for i = 1, #Config.GasStations do if Config.GasStations[i].electriccharger then exports[Config.Interaction.Target]:AddTargetEntity(Config.GasStations[i].electriccharger, { options = { { action = function(entity) openElectricMenu() end, canInteract = function(entity, distance, data) return IsPedInAnyVehicle(PlayerPedId(), true) end, icon = "fas fa-gas-pump", label = Config.Text["electricText"] }, }, distance = 4 }) end end elseif Config.Interaction.Target == "ox_target" then exports[Config.Interaction.Target]:addModel({'electric_charger'}, { { distance = 2.5, onSelect = function() openElectricMenu() end, icon = 'fas fa-gas-pump', label = Config.Text['electricText'], canInteract = function(entity) local playerPed = PlayerPedId() local inVehicle = IsPedInAnyVehicle(playerPed, false) return inVehicle end }, { distance = 2, onSelect = function() TriggerEvent('frkn-fuelstation:ropeDelete') end, icon = "fas fa-gas-pump", label = Config.Text["ropeDeleteText"], canInteract = function(entity) return not IsPedInAnyVehicle(PlayerPedId(), true) and ropeDelete and currentType == "electric" end }, { distance = 2, onSelect = function() rope() end, icon = "fas fa-gas-pump", label = Config.Text["refuelText"], canInteract = function(entity) return not IsPedInAnyVehicle(PlayerPedId(), true) and refuel and currentType == "electric" end }, { distance = 2, onSelect = function() openJerry(false) end, icon = "fas fa-gas-pump", label = Config.Text["charger"], canInteract = function(entity) return not IsPedInAnyVehicle(PlayerPedId(), true) and not filling and not returnFillRope and not refuel and not ropeDelete and not startrefuel end } }) end end if Config.Interaction.Target == "qb-target" then exports['qb-target']:AddTargetBone(bones, { options = { { action = function(entity) TriggerEvent('frkn-fuelstation:refuel') end, canInteract = function(entity, distance, data) local interact = false if not IsPedInAnyVehicle(PlayerPedId(), true) then if startrefuel then interact = true else interact = false end else interact = false end return interact end, icon = "fas fa-gas-pump", label = Config.Text["fuelText"] }, }, distance = 4 }) exports[Config.Interaction.Target]:AddCircleZone("buyFuel", vector3(Config.BuyCoord.x, Config.BuyCoord.y, Config.BuyCoord.z), 4.5, { name = "buyFuel", debugPoly = false, useZ = true, }, { options = { { event = "frkn-fuelstation:buyFuel", icon = "fas fa-gas-pump", label = Config.Text["buyFuel"], action = function() buyMenu() end, canInteract = function(entity, distance, data) return not IsPedInAnyVehicle(PlayerPedId(), true) end }, }, distance = 4 }) elseif Config.Interaction.Target == "ox_target" then exports[Config.Interaction.Target]:addLocalEntity({ bones = bones, options = { { name = 'frkn-fuelstation:refuel', icon = 'fas fa-gas-pump', label = Config.Text["fuelText"], onSelect = function(data) TriggerEvent('frkn-fuelstation:refuel') end, canInteract = function(entity, distance, coords) local interact = false if not IsPedInAnyVehicle(PlayerPedId(), true) then if startrefuel then interact = true else interact = false end else interact = false end return interact end } }, distance = 4 }) exports[Config.Interaction.Target]:addSphereZone({ coords = vector3(Config.BuyCoord.x, Config.BuyCoord.y, Config.BuyCoord.z), radius = 4.5, options = { { distance = 2, onSelect = function() buyMenu() end, icon = "fas fa-gas-pump", label = Config.Text["buyFuel"], canInteract = function(entity) return not IsPedInAnyVehicle(PlayerPedId(), true) end }, }, }) end for k, v in pairs(Config.props) do if Config.Interaction.Target == "qb-target" then exports[Config.Interaction.Target]:AddTargetModel(v, { options = { { action = function(entity) fuelMenu() end, canInteract = function(entity, distance, data) if Config.CarControl then return IsPedInAnyVehicle(PlayerPedId(), true) else return not IsPedInAnyVehicle(PlayerPedId(), true) end end, icon = "fas fa-gas-pump", label = Config.Text["buyGas"] }, { action = function(entity) openJerry(true) end, canInteract = function(entity, distance, data) return not IsPedInAnyVehicle(PlayerPedId(), true) and not filling and not returnFillRope and not refuel and not ropeDelete and not startrefuel end, icon = "fas fa-gas-pump", label = Config.Text["jerryCan"] }, { action = function(entity) startTankerCarFill() end, canInteract = function(entity, distance, data) return not IsPedInAnyVehicle(PlayerPedId(), true) and filling end, icon = "fas fa-gas-pump", label = Config.Text["fillTanker"] }, { action = function() TriggerEvent('frkn-fuelstation:ropeDelete') end, canInteract = function(entity, distance, data) return not IsPedInAnyVehicle(PlayerPedId(), true) and returnFillRope end, icon = "fas fa-gas-pump", label = Config.Text["returnRope"] }, { action = function(entity) rope() end, canInteract = function(entity, distance, data) return not IsPedInAnyVehicle(PlayerPedId(), true) and refuel and currentType ~= "electric" end, icon = "fas fa-gas-pump", label = Config.Text["refuelText"] }, { action = function() TriggerEvent('frkn-fuelstation:ropeDelete') end, canInteract = function(entity, distance, data) return not IsPedInAnyVehicle(PlayerPedId(), true) and ropeDelete and currentType ~= "electric" end, icon = "fas fa-gas-pump", label = Config.Text["ropeDeleteText"] }, }, distance = 4 }) elseif Config.Interaction.Target == "ox_target" then exports[Config.Interaction.Target]:addModel(v, { { distance = 2, onSelect = function(entity) fuelMenu() end, icon = "fas fa-gas-pump", label = Config.Text["buyGas"], canInteract = function(entity) if Config.CarControl then return IsPedInAnyVehicle(PlayerPedId(), true) else return not IsPedInAnyVehicle(PlayerPedId(), true) end end }, { distance = 2, onSelect = function() openJerry(true) end, icon = "fas fa-gas-pump", label = Config.Text["jerryCan"], canInteract = function(entity) return not IsPedInAnyVehicle(PlayerPedId(), true) and not filling and not returnFillRope and not refuel and not ropeDelete and not startrefuel end }, { distance = 2, onSelect = function() startTankerCarFill() end, icon = "fas fa-gas-pump", label = Config.Text["fillTanker"], canInteract = function(entity) return not IsPedInAnyVehicle(PlayerPedId(), true) and filling end }, { distance = 2, onSelect = function() TriggerEvent('frkn-fuelstation:ropeDelete') end, icon = "fas fa-gas-pump", label = Config.Text["returnRope"], canInteract = function(entity) return not IsPedInAnyVehicle(PlayerPedId(), true) and returnFillRope end }, { distance = 2, onSelect = function() rope() end, icon = "fas fa-gas-pump", label = Config.Text["refuelText"], canInteract = function(entity) return not IsPedInAnyVehicle(PlayerPedId(), true) and refuel and currentType ~= "electric" end }, { distance = 2, onSelect = function() TriggerEvent('frkn-fuelstation:ropeDelete') end, icon = "fas fa-gas-pump", label = Config.Text["ropeDeleteText"], canInteract = function(entity) return not IsPedInAnyVehicle(PlayerPedId(), true) and ropeDelete and currentType ~= "electric" end }, }) end end if Config.Interaction.Target == "ox_target" then exports[Config.Interaction.Target]:addGlobalVehicle({ { distance = 2, onSelect = function(data) TriggerEvent('frkn-fuelstation:refuel') end, icon = "fas fa-gas-pump", label = Config.Text["fuelText"], canInteract = function(entity) return not IsPedInAnyVehicle(PlayerPedId(), true) and startrefuel end }, { distance = 2, onSelect = function(data) TriggerEvent('frkn-fuelstation:refuelJerryCan') end, icon = "fas fa-gas-pump", label = Config.Text["jerry"], canInteract = function(entity) return not IsPedInAnyVehicle(PlayerPedId(), true) and not startrefuel end }, }) end end) AddEventHandler('onResourceStop', function(resource) if resource == GetCurrentResourceName() then for i = 1, #Config.GasStations do if Config.GasStations[i].electricchargercoords ~= nil then DeleteEntity(Config.GasStations[i].electriccharger) end end end end) blipControl = true Citizen.CreateThread(function() while blipControl do Citizen.Wait(0) if Config.Blip["name"] then if frknData ~= nil then table.sort(frknData, function(a, b) return a.id < b.id end) for x, y in pairs(Config.GasStations) do for _, v in ipairs(frknData) do if x == v.id then local blip = AddBlipForCoord(y.zones[1].x, y.zones[1].y) SetBlipSprite(blip, Config.Blip["sprite"]) SetBlipScale(blip, Config.Blip["scale"]) SetBlipColour(blip, Config.Blip["color"]) SetBlipDisplay(blip, Config.Blip["display"]) SetBlipAsShortRange(blip, true) BeginTextCommandSetBlipName("STRING") AddTextComponentString(v.fuel_name) EndTextCommandSetBlipName(blip) blipControl = false end end end end else for x, y in pairs(Config.GasStationsBlips) do local blip = AddBlipForCoord(y) SetBlipSprite(blip, Config.Blip["sprite"]) SetBlipScale(blip, Config.Blip["scale"]) SetBlipColour(blip, Config.Blip["color"]) SetBlipDisplay(blip, Config.Blip["display"]) SetBlipAsShortRange(blip, true) BeginTextCommandSetBlipName("STRING") AddTextComponentString(Config.Blip["text"]) EndTextCommandSetBlipName(blip) blipControl = false end end end end) Citizen.CreateThread(function() while not Config.Interaction.UseTarget do local sleep = 3000 local ped = PlayerPedId() local playerCoords = GetEntityCoords(PlayerPedId()) local pumpCoords, pump = GetClosestPump(playerCoords) if filling then local tx,ty,tz= Config.TankerFillingCoords.x,Config.TankerFillingCoords.y,Config.TankerFillingCoords.z if not IsPedInAnyVehicle(ped, true) then local playerCoords = GetEntityCoords(PlayerPedId()) local a = #(vector3(tx, ty, tz) - playerCoords) if a ~= -1 and a <= 4.5 then sleep = 1 DrawText3D(tx, ty, tz + 1, "[E] - Fill Tanker Car") if IsControlJustReleased(0, 38) then startTankerCarFill() sleep = 3000 end end end end if returnFillRope then local tx,ty,tz= Config.TankerFillingCoords.x,Config.TankerFillingCoords.y,Config.TankerFillingCoords.z local distance = #(vector3(tx, ty, tz) - playerCoords) if distance ~= -1 and distance <= 4.5 then sleep = 5 DrawText3D(tx, ty, tz + 1, "[E] - Return Fill Rope") if IsControlJustReleased(0, 38) then TriggerEvent('frkn-fuelstation:ropeDelete') returnFillRope = false sleep = 3000 end end end if startTankerCar then local tankerCoords = GetEntityCoords(tanker) local textCoords = vector3(tankerCoords.x, tankerCoords.y, tankerCoords.z -1.0) local distance = #(vector3(textCoords.x, textCoords.y, textCoords.z) - playerCoords) if distance ~= -1 and distance <= 4.5 then sleep = 5 DrawText3D(textCoords.x, textCoords.y, textCoords.z, "[E] - Fill the Tanker") if IsControlJustReleased(0, 38) then TriggerEvent('frkn-fuelstation:refuelTank') sleep = 5 end end end if finishFill then local tankerCoords = GetEntityCoords(tanker) local textCoords = vector3(tankerCoords.x, tankerCoords.y, tankerCoords.z -1.0) local distance = #(vector3(textCoords.x, textCoords.y, textCoords.z) - playerCoords) if distance ~= -1 and distance <= 4.5 then sleep = 5 DrawText3D(textCoords.x, textCoords.y, textCoords.z, "[E] - Take the hose") if IsControlJustReleased(0, 38) then sleep = 3000 TriggerEvent('frkn-fuelstation:rope2') end end end if propFill then local ax = aggg.pos.x local ay = aggg.pos.y local az = aggg.pos.z local playerCoords = GetEntityCoords(PlayerPedId()) local distance = #(vector3(ax, ay, az) - playerCoords) if distance ~= -1 and distance <= 4.5 then sleep = 5 DrawText3D(ax, ay, az + 1, "[E] - Fill Tanker") if IsControlJustReleased(0, 38) then sleep = 5 fillTanker() end end end Citizen.Wait(sleep) end end) Citizen.CreateThread(function() while not Config.Interaction.UseTarget do local sleep = 3000 local ped = PlayerPedId() local playerCoords = GetEntityCoords(PlayerPedId()) local electricCoords, electric = GetClosestPump(playerCoords,true) local veh = GetVehiclePedIsIn(ped, false) local buyDistance = #(vector3(Config.BuyCoord.x, Config.BuyCoord.y, Config.BuyCoord.z) - playerCoords) if buyDistance ~= -1 and buyDistance <= 4.5 then sleep = 5 DrawText3D(Config.BuyCoord.x, Config.BuyCoord.y, Config.BuyCoord.z, "[E] - Buy Fuel") if IsControlJustReleased(0, 38) then sleep = 2000 buyMenu() end end if Config.ElectricChargerModel then local distance = #(vector3(electricCoords.x, electricCoords.y, electricCoords.z) - playerCoords) if distance ~= -1 and distance <= 4.5 then if startrefuel then if IsControlJustReleased(0, 38) then sleep = 2000 TriggerEvent('frkn-fuelstation:refuel') startrefuel = false end end if ropeDelete and currentType == "electric" then DrawText3D(electricCoords.x, electricCoords.y, electricCoords.z + 1, Config.Text["ropeDeleteText"]) if IsControlJustReleased(0, 38) then sleep = 2000 TriggerEvent('frkn-fuelstation:ropeDelete') ropeDelete = false end end if refuel and currentType == "electric" then DrawText3D(electricCoords.x, electricCoords.y, electricCoords.z + 1, Config.Text["refuelText"]) if IsControlJustReleased(0, 38) then sleep = 2000 rope() refuel = false end end sleep = 5 if IsPedInAnyVehicle(ped, true) then DrawText3D(electricCoords.x, electricCoords.y, electricCoords.z + 1, Config.Text["electricText"]) if IsControlJustReleased(0, 38) then if getCarFuelType(veh) == "electric" then sleep = 2000 SetNuiFocus(1, 1) currentType = "electric" OpenMenuExport() SendNUIMessage({ action = 'BUY_GAS', id = getFuelId(), data = { stations = frknData, playerData = playerData, id = getFuelId(), fuelType = getCarFuelType(veh), fuelLevel = getFuelLevel(), vehicleName = getVehicleName(), tax = Config.MyStation["tax"], electric = true } }) else Notify(Config.Notify["electric"]) end end end end end Citizen.Wait(sleep) end end) function openElectricMenu() local veh = GetVehiclePedIsIn(PlayerPedId(), false) if getCarFuelType(veh) == "electric" then SetNuiFocus(1, 1) currentType = "electric" OpenMenuExport() SendNUIMessage({ action = 'BUY_GAS', id = getFuelId(), data = { stations = frknData, playerData = playerData, id = getFuelId(), fuelType = getCarFuelType(veh), fuelLevel = getFuelLevel(), vehicleName = getVehicleName(), tax = Config.MyStation["tax"], electric = true } }) else Notify(Config.Notify["electric"]) end end Citizen.CreateThread(function() while not Config.Interaction.UseTarget do local sleep = 2000 local ped = PlayerPedId() local playerCoords = GetEntityCoords(PlayerPedId()) local pumpCoords, pump = GetClosestPump(playerCoords) local propCoords = GetEntityCoords(pump) local distance = Vdist(playerCoords.x, playerCoords.y, playerCoords.z, propCoords.x, propCoords.y, propCoords.z) local vehicle = GetVehiclePedIsIn(ped, false) if distance ~= -1 and distance <= 4.5 then sleep = 5 if startrefuel then if IsControlJustReleased(0, 38) then sleep = 2000 TriggerEvent('frkn-fuelstation:refuel') startrefuel = false end end if ropeDelete and currentType ~= "electric" then DrawText3D(pumpCoords.x, pumpCoords.y, pumpCoords.z + 1, Config.Text["ropeDeleteText"]) if IsControlJustReleased(0, 38) then sleep = 2000 TriggerEvent('frkn-fuelstation:ropeDelete') ropeDelete = false end end if refuel and currentType ~= "electric" then DrawText3D(pumpCoords.x, pumpCoords.y, pumpCoords.z + 1, Config.Text["refuelText"]) if IsControlJustReleased(0, 38) then sleep = 2000 rope() refuel = false end else if IsPedInAnyVehicle(ped, true) then DrawText3D(pumpCoords.x, pumpCoords.y, pumpCoords.z + 1, Config.Text["buyGas"]) if IsControlJustReleased(0, 38) then if getCarFuelType(vehicle) ~= "electric" then sleep = 2000 SetNuiFocus(1, 1) currentType = "normal" OpenMenuExport() SendNUIMessage({ action = 'BUY_GAS', id = getFuelId(), data = { stations = frknData, playerData = playerData, id = getFuelId(), fuelType = getCarFuelType(vehicle), fuelLevel = getFuelLevel(), vehicleName = getVehicleName(), tax = Config.MyStation["tax"], electric = false } }) else Notify(Config.Notify["electric2"]) end end end end end Citizen.Wait(sleep) end end) function fuelMenu() local veh = GetVehiclePedIsIn(PlayerPedId(), false) if getCarFuelType(veh) ~= "electric" then SetNuiFocus(1, 1) currentType = "normal" OpenMenuExport() SendNUIMessage({ action = 'BUY_GAS', id = getFuelId(), data = { stations = frknData, playerData = playerData, id = getFuelId(), fuelType = getCarFuelType(veh), fuelLevel = getFuelLevel(), vehicleName = getVehicleName(), tax = Config.MyStation["tax"], electric = false } }) else Notify(Config.Notify["electric2"]) end end local nitroPower = 0 local decreaseRate = 1 local isEngineBroken = false newHandling = {} local variab = false maxSpeed = 0 Citizen.CreateThread(function() while true do Citizen.Wait(100) if IsPedInAnyVehicle(PlayerPedId(), false) then local ped = PlayerPedId() local myNitroVehicle = GetVehiclePedIsIn(ped, false) if not variab then maxSpeed = GetVehicleHandlingFloat(myNitroVehicle, "CHandlingData", "fInitialDriveMaxFlatVel") variab = true end if nitroPower > 0 and IsControlPressed(0, Keys[Config.NitroKey]) then if not nitroActive then nitroPower = nitroPower - decreaseRate if IsControlPressed(0, 71) then ModifyVehicleTopSpeed(GetVehiclePedIsIn(ped, false), Config.MaxValueMultipler*1.0) SetVehicleBoostActive(myNitroVehicle, true) SetVehicleLightTrailEnabled(myNitroVehicle, true) TriggerServerEvent("frkn-custom:syncNitro", true, false, false) else SetVehicleNitroPurgeEnabled(myNitroVehicle, true) TriggerServerEvent("frkn-custom:syncNitro", false, true, false) ModifyVehicleTopSpeed(GetVehiclePedIsIn(ped, false), 0.0) end end nitroActive = true if IsControlPressed(0, 71) then nitroPower = nitroPower - decreaseRate ModifyVehicleTopSpeed(GetVehiclePedIsIn(ped, false), Config.MaxValueMultipler*1.0) SetVehicleNitroPurgeEnabled(myNitroVehicle, false) CreateVehicleExhaustBackfire(myNitroVehicle, 1.25) StopScreenEffect("RaceTurbo") StartScreenEffect("RaceTurbo", 0, false) SetTimecycleModifier("rply_motionblur") ShakeGameplayCam("SKY_DIVING_SHAKE", 0.25) end else if nitroActive then nitroPower = nitroPower - decreaseRate ModifyVehicleTopSpeed(GetVehiclePedIsIn(ped, false), 0.0) SetVehicleNitroPurgeEnabled(myNitroVehicle, false) SetVehicleLightTrailEnabled(myNitroVehicle, false) TriggerServerEvent("frkn-custom:syncNitro", false, false, false) StopGameplayCamShaking(true) SetTransitionTimecycleModifier("default", 0.35) end nitroActive = false end end end end) Citizen.CreateThread(function() while true do Citizen.Wait(2000) local ped = PlayerPedId() local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) if GetPedInVehicleSeat(vehicle, -1) == ped then ManageFuelUsage(vehicle) if fuelSynced then fuelSynced = false end TriggerCallback('frkn-fuelstation:carTypeCheck',function(check) if check then fuelType = check if Config.CarBroken then if fuelType ~= getCarFuelType(vehicle) then if not isEngineBroken then setEngine(vehicle) end else if setData then setHandling(vehicle, fuelType) end end end end end,getVehiclePlate()) end end end) -- ???????????????????????????????????????????????? -- ? EVENT ? -- ???????????????????????????????????????????????? RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function() playerData = GetPlayerData() TriggerServerEvent('frkn-fuelstation:dataPostClient') end) RegisterNetEvent('esx:playerLoaded', function() playerData = GetPlayerData() TriggerServerEvent('frkn-fuelstation:dataPostClient') end) Citizen.CreateThread(function() while true do Citizen.Wait(5500) if NetworkIsPlayerActive(PlayerId()) then playerData = GetPlayerData() TriggerServerEvent('frkn-fuelstation:dataPostClient') TriggerServerEvent('frkn-fuelstation:clientProp') break end end end) RegisterNetEvent('frkn-fuelstation:setClient') AddEventHandler('frkn-fuelstation:setClient',function(data) frknData = data if frknData then for k, v in pairs(frknData) do id = v.id owner = v.owner fuel_name = v.fuel_name owner_name = v.owner_name owner_number = v.owner_number ownership = v.ownership price = v.price rate = v.rate gas_price = v.gas_price gas_tanker = v.gas_tanker gas_data = v.gas_data employees = v.employees gas_level = v.gas_level gas_safe_money = v.gas_safe_money gas_prop = v.gas_prop gas_netID = v.gas_netID desc = v.desc img = v.img end end end) RegisterNetEvent('frkn-fuelstation:allDataUpdate') AddEventHandler('frkn-fuelstation:allDataUpdate', function(newData) if frknData then for k, v in pairs(frknData) do for a, b in pairs(newData) do if k == a then v.id = b.id v.owner = b.owner v.fuel_name = b.fuel_name v.owner_name = b.owner_name v.owner_number = b.owner_number v.ownership = b.ownership v.price = b.price v.rate = b.rate v.employees = b.employees v.gas_price = b.gas_price v.gas_tanker = b.gas_tanker v.gas_data = b.gas_data v.gas_level = b.gas_level v.gas_safe_money = b.gas_safe_money v.gas_prop = b.gas_prop v.gas_netID = b.gas_netID v.desc = b.desc v.img = b.img end end end end end) RegisterNetEvent('frkn-fuelstation:oneDataUpdate') AddEventHandler('frkn-fuelstation:oneDataUpdate',function(newData, id, dataType) if frknData then for k, v in pairs(frknData) do if id == v.id then if v[dataType] then v[dataType] = newData end end end end end) RegisterNetEvent('frkn-fuelstation:clientPropUpdate', function (data,netId,cCoords,hash) Props = data cCoords = json.decode(containerCoords) SetEntityAsMissionEntity(NetworkGetEntityFromNetworkId(tonumber(netId)), true, true) SetEntityHeading(NetworkGetEntityFromNetworkId(tonumber(netId)), cCoords.w) FreezeEntityPosition(NetworkGetEntityFromNetworkId(tonumber(netId)), true) SetModelAsNoLongerNeeded(hash) end) RegisterNetEvent('frkn-fuelstation:clientSetNitro') AddEventHandler('frkn-fuelstation:clientSetNitro',function(data) nitroPower = data.liter*10 nitroActive = true end) --NITRO SYSTEM RegisterNetEvent("frkn-custom:sync") AddEventHandler("frkn-custom:sync",function(playerServerId, boostEnabled, purgeEnabled, lastVehicle) local playerId = GetPlayerFromServerId(playerServerId) if not NetworkIsPlayerConnected(playerId) then return end local player = GetPlayerPed(playerId) local vehicle = GetVehiclePedIsIn(player, lastVehicle) local driver = GetPedInVehicleSeat(vehicle, -1) SetVehicleLightTrailEnabled(vehicle, boostEnabled) SetVehicleNitroPurgeEnabled(vehicle, purgeEnabled) end) AddEventHandler('frkn-fuelstation:hasEnteredMarker', function(zone) currentAction = 'shop_menu' currentActionMsg = ('press_menu') currentActionData = {zone = zone} end) AddEventHandler('frkn-fuelstation:hasExitedMarker', function(zone) currentAction = false SetNuiFocus(false, false) end) RegisterNetEvent('frkn-fuelstation:ropeDelete') AddEventHandler('frkn-fuelstation:ropeDelete',function() deleteRope = true local ped = PlayerPedId() LoadAnimDict("anim@am_hold_up@male") TaskPlayAnim(ped, "anim@am_hold_up@male", "shoplift_high", 2.0, 8.0, -1, 50, 0, 0, 0, 0) TriggerServerEvent("InteractSound_SV:PlayOnSource", "putbacknozzle", 0.4) Wait(250) DeleteObject(SpecialFuelNozzleObj) DeleteObject(ElectricNozzle) SpecialFuelNozzleObj = nil ElectricNozzle = nil if Config.PumpHose then RopeUnloadTextures() DeleteRope(Rope) Rope = nil end ClearPedTasks(ped) filling = false ropeDelete = false HoldingSpecialNozzle = false returnFillRope = false end) function rope() local ped = PlayerPedId() if currentType == "electric" then LoadAnimDict("anim@am_hold_up@male") TaskPlayAnim(ped, "anim@am_hold_up@male", "shoplift_high", 2.0, 8.0, -1, 50, 0, 0, 0, 0) TriggerServerEvent("InteractSound_SV:PlayOnSource", "pickupnozzle", 0.4) Wait(300) StopAnimTask(ped, "anim@am_hold_up@male", "shoplift_high", 1.0) ElectricNozzle = CreateObject('electric_nozzle', 1.0, 1.0, 1.0, true, true, false) local lefthand = GetPedBoneIndex(ped, 18905) AttachEntityToEntity(ElectricNozzle, ped, lefthand, 0.24, 0.10, -0.052 --[[FWD BWD]], -45.0 --[[ClockWise]], 120.0 --[[Weird Middle Axis]], 75.00 --[[Counter Clockwise]], 0, 1, 0, 1, 0, 1) local grabbedelectricnozzlecoords = GetEntityCoords(ped) startrefuel = true refuel = false Wait(1000) else if HoldingSpecialNozzle then return end LoadAnimDict("anim@am_hold_up@male") TaskPlayAnim(ped, "anim@am_hold_up@male", "shoplift_high", 2.0, 8.0, -1, 50, 0, 0, 0, 0) TriggerServerEvent("InteractSound_SV:PlayOnSource", "pickupnozzle", 0.4) Wait(300) StopAnimTask(ped, "anim@am_hold_up@male", "shoplift_high", 1.0) SpecialFuelNozzleObj = CreateObject('prop_cs_fuel_nozle', 1.0, 1.0, 1.0, true, true, false) local lefthand = GetPedBoneIndex(ped, 18905) AttachEntityToEntity(SpecialFuelNozzleObj, ped, lefthand, 0.13, 0.04, 0.01, -42.0, -115.0, -63.42, 0, 1, 0, 1, 0, 1) local grabbednozzlecoords = GetEntityCoords(ped) HoldingSpecialNozzle = true if Config.PumpHose then local pumpCoords, pump = GetClosestPump(grabbednozzlecoords) -- Load Rope Textures RopeLoadTextures() while not RopeAreTexturesLoaded() do Wait(0) RopeLoadTextures() end -- Wait for Pump to exist. while not pump do Wait(0) end Rope = AddRope(pumpCoords.x, pumpCoords.y, pumpCoords.z + 2.0, 0.0, 0.0, 0.0, 3.0, Config.RopeType['fuel'], 8.0 --[[ DO NOT SET THIS TO 0.0!!! GAME WILL CRASH!]], 0.0, 1.0, false, false, false, 1.0, true) while not Rope do Wait(0) end ActivatePhysics(Rope) Wait(100) local nozzlePos = GetEntityCoords(SpecialFuelNozzleObj) nozzlePos = GetOffsetFromEntityInWorldCoords(SpecialFuelNozzleObj, 0.0, -0.033, -0.195) AttachEntitiesToRope(Rope, pump, SpecialFuelNozzleObj, pumpCoords.x, pumpCoords.y, pumpCoords.z + 2.1, nozzlePos.x, nozzlePos.y, nozzlePos.z, length, false, false, nil, nil) end CreateThread(function() while HoldingSpecialNozzle do local currentcoords = GetEntityCoords(ped) local dist = #(grabbednozzlecoords - currentcoords) if dist > Config.NozzLength or IsPedInAnyVehicle(ped, false) then HoldingSpecialNozzle = false DeleteObject(SpecialFuelNozzleObj) if Config.PumpHose then RopeUnloadTextures() DeleteRope(Rope) refuel = false startrefuel = false end if Config.FuelNozzleExplosion then AddExplosion(grabbednozzlecoords.x, grabbednozzlecoords.y, grabbednozzlecoords.z, 'EXP_TAG_PROPANE', 1.0, true,false, 5.0) StartScriptFire(grabbednozzlecoords.x, grabbednozzlecoords.y, grabbednozzlecoords.z - 1,25,false) SetFireSpreadRate(10.0) Wait(5000) StopFireInRange(grabbednozzlecoords.x, grabbednozzlecoords.y, grabbednozzlecoords.z - 1, 3.0) end end Wait(2500) end end) startrefuel = true refuel = false end refuel = false end RegisterNetEvent('frkn-fuelstation:rope2') AddEventHandler('frkn-fuelstation:rope2', function() local ped = PlayerPedId() if HoldingSpecialNozzle then return end LoadAnimDict("anim@am_hold_up@male") TaskPlayAnim(ped, "anim@am_hold_up@male", "shoplift_high", 2.0, 8.0, -1, 50, 0, 0, 0, 0) TriggerServerEvent("InteractSound_SV:PlayOnSource", "pickupnozzle", 0.4) Wait(300) StopAnimTask(ped, "anim@am_hold_up@male", "shoplift_high", 1.0) SpecialFuelNozzleObj = CreateObject('prop_cs_fuel_nozle', 1.0, 1.0, 1.0, true, true, false) local lefthand = GetPedBoneIndex(ped, 18905) AttachEntityToEntity(SpecialFuelNozzleObj, ped, lefthand, 0.13, 0.04, 0.01, -42.0, -115.0, -63.42, 0, 1, 0, 1, 0, 1) local grabbednozzlecoords = GetEntityCoords(ped) local a = GetEntityCoords(ped)-5 HoldingSpecialNozzle = true if Config.PumpHose then local nozzlePos = GetEntityCoords(SpecialFuelNozzleObj) nozzlePos = GetOffsetFromEntityInWorldCoords(SpecialFuelNozzleObj, 0.0, -0.033, -0.195) AttachEntitiesToRope(SpecialFuelNozzleObj, grabbednozzlecoords.x, grabbednozzlecoords.y, grabbednozzlecoords.z + 2.1, nozzlePos.x, nozzlePos.y, nozzlePos.z, length, false, false, nil, nil) end finishFill = false propFill = true returnFillRope = false local ax = aggg.pos.x local ay = aggg.pos.y local az = aggg.pos.z local playerCoords = GetEntityCoords(PlayerPedId()) local distance = #(vector3(ax, ay, az) - playerCoords) exports[Config.Interaction.Target]:AddCircleZone("propFill", vector3(ax, ay, az), 4.5, { name = "propFill", debugPoly = false, useZ = true, }, { options = { { action = function(entity) fillTanker() end, canInteract = function(entity, distance, data) interact = false if not IsPedInAnyVehicle(ped, true) then if propFill then interact = true else interact = false end else interact = false end return interact end, icon = "fas fa-gas-pump", label = Config.Text["fillTanker"] }, }, distance = 4 }) end) RegisterNetEvent('frkn-fuelstation:refuelTank') AddEventHandler('frkn-fuelstation:refuelTank',function() TriggerServerEvent("InteractSound_SV:PlayOnSource", "refuel", 0.3) local ped = PlayerPedId() RequestAnimDict(Config.RefuelAnimationDictionary) while not HasAnimDictLoaded(Config.RefuelAnimationDictionary) do Wait(100) end local bootBoneIndex = GetEntityBoneIndexByName(vehicle, 'boot') local vehBootCoords = GetWorldPositionOfEntityBone(vehicle,(bootBoneIndex)) TaskTurnPedToFaceCoord(PlayerPedId(), vehBootCoords, 500) TaskPlayAnim(ped, Config.RefuelAnimationDictionary, Config.RefuelAnimation, 8.0, 1.0, -1, 1, 0, 0, 0, 0) Wait(5000) StopAnimTask(ped, Config.RefuelAnimationDictionary, Config.RefuelAnimation, 3.0, 3.0, -1, 2, 0, 0, 0, 0) for k, v in pairs(frknData) do if CoreName == "qb-core" or CoreName == "qbx-core" then if playerData.citizenid == v.owner then if v.gas_prop ~= "[]" then local gasPropData = json.decode(v.gas_prop) aggg = json.decode(v.gas_prop) SetNewWaypoint(Config.GasStations[v.id].zones[1].x,Config.GasStations[v.id].zones[1].y, 0, "Gas") end end else if playerData.identifier == v.owner then if v.gas_prop ~= "[]" then local gasPropData = json.decode(v.gas_prop) aggg = json.decode(v.gas_prop) SetNewWaypoint(Config.GasStations[v.id].zones[1].x,Config.GasStations[v.id].zones[1].y, 0, "Gas") end end end if v.gas_prop ~= "[]" then local gasPropData = json.decode(v.gas_prop) aggg = json.decode(v.gas_prop) SetNewWaypoint(Config.GasStations[v.id].zones[1].x,Config.GasStations[v.id].zones[1].y, 0, "Gas") end end startTankerCar = false returnFillRope = true Wait(3000) finishFill = true local bones = {"bonnet","boot","door_dside_f","door_pside_f","seat_dside_f","seat_pside_f","seat_dside_r","seat_pside_r"} if Config.Interaction.Target == "qb-target" then exports[Config.Interaction.Target]:AddTargetBone(bones, { options = { { action = function(entity) TriggerEvent('frkn-fuelstation:rope2') end, canInteract = function(entity, distance, data) interact = false if not IsPedInAnyVehicle(ped, true) then if finishFill then interact = true else interact = false end else interact = false end return interact end, icon = "fas fa-gas-pump", label = Config.Text["takeHose"] }, }, distance = 4 }) else exports[Config.Interaction.Target]:addLocalEntity({ bones = bones, options = { { name = 'frkn-fuelstation:refuel', icon = 'fas fa-gas-pump', label = Config.Text["fuelText"], onSelect = function(data) TriggerEvent('frkn-fuelstation:refuel') end, canInteract = function(entity, distance, coords) local interact = false if not IsPedInAnyVehicle(PlayerPedId(), true) then if startrefuel then interact = true else interact = false end else interact = false end return interact end } }, distance = 4 }) end end) RegisterNetEvent('frkn-fuelstation:refuel') AddEventHandler('frkn-fuelstation:refuel',function() if IsPlayerNearVehicle() then TriggerServerEvent("InteractSound_SV:PlayOnSource", "refuel", 0.5) local ped = PlayerPedId() RequestAnimDict(Config.RefuelAnimationDictionary) while not HasAnimDictLoaded(Config.RefuelAnimationDictionary) do Wait(100) end local bootBoneIndex = GetEntityBoneIndexByName(vehicle, 'boot') local vehBootCoords = GetWorldPositionOfEntityBone(vehicle,(bootBoneIndex)) TaskTurnPedToFaceCoord(PlayerPedId(), vehBootCoords, 500) TaskPlayAnim(ped, Config.RefuelAnimationDictionary, Config.RefuelAnimation, 8.0, 1.0, -1, 1, 0, 0, 0, 0) Wait(Config.ReFuelTime) StopAnimTask(ped, Config.RefuelAnimationDictionary, Config.RefuelAnimation, 3.0, 3.0, -1, 2, 0, 0, 0, 0) end refuel = false startrefuel = false Wait(500) SetLocalFuel(fuelVehicle,tonumber(liter)) ropeDelete = true setData = true TriggerServerEvent("InteractSound_SV:PlayOnSource", "fuelstop", 0.4) end) RegisterCommand("del",function() DeleteObject(SpecialFuelNozzleObj) DeleteObject(ElectricNozzle) DeleteRope(Rope) DeleteObject(enozz) SpecialFuelNozzleObj = nil ElectricNozzle = nil enozz = nil if Config.PumpHose then RopeUnloadTextures() DeleteRope(Rope) Rope = nil end ClearPedTasks(ped) filling = false ropeDelete = false HoldingSpecialNozzle = false returnFillRope = false end) RegisterNetEvent('frkn-fuelstation:refuelJerryCan') AddEventHandler('frkn-fuelstation:refuelJerryCan', function() if IsPlayerNearVehicle() then local vehicle = checkForVehicles() if vehicle == 0 then return end local ped = PlayerPedId() local vehicleType = getCarFuelType(vehicle) TriggerCallback('frkn-fuelstation:jerryMetadata', function(metadata) if not metadata then Notify(Config.Notify["itemError"]) return end if vehicleType == "electric" and metadata.type ~= "electric" then Notify(Config.Notify["electric2"]) return end if vehicleType ~= metadata.type then Notify(Config.Notify["wrongFuel"]) return end if vehicleType ~= "electric" and metadata.type ~= "electric" then if GetSelectedPedWeapon(ped) ~= 883325847 then Notify(Config.Notify["noJerry"]) return end if GetAmmoInPedWeapon(ped, 883325847) <= 0 then Notify(Config.Notify["noJerry"]) return end if GetVehicleFuelLevel(vehicle) >= 100.0 then Notify(Config.Notify["fullTank"]) return end end if vehicleType == "electric" and metadata.type == "electric" then enozz = CreateObject('electric_nozzle', 1.0, 1.0, 1.0, true, true, false) local lefthand = GetPedBoneIndex(ped, 18905) AttachEntityToEntity(enozz, ped, lefthand, 0.24, 0.10, -0.052 --[[FWD BWD]], -45.0 --[[ClockWise]], 120.0 --[[Weird Middle Axis]], 75.00 --[[Counter Clockwise]], 0, 1, 0, 1, 0, 1) end RequestAnimDict('timetable@gardener@filling_can') while not HasAnimDictLoaded('timetable@gardener@filling_can') do Wait(100) end local bootBoneIndex = GetEntityBoneIndexByName(vehicle, 'boot') local vehBootCoords = GetWorldPositionOfEntityBone(vehicle, (bootBoneIndex)) TaskTurnPedToFaceCoord(PlayerPedId(), vehBootCoords, 500) TaskPlayAnim(ped, 'timetable@gardener@filling_can', 'gar_ig_5_filling_can', 8.0, 1.0, -1, 1, 0, 0, 0, 0) isFilling = true local currentF = GetVehicleFuelLevel(vehicle) local jerryItem = "" Citizen.CreateThread(function() while isFilling do Citizen.Wait(2000) local fuelAdd = math.random(30, 50) / 10.0 local ammoInJerryCan = GetAmmoInPedWeapon(ped, 883325847) if vehicleType ~= "electric" and metadata.type ~= "electric" then jerryItem = Config.Jerry["jerryItem"] if ammoInJerryCan - fuelAdd>= 0 then currentF = currentF + fuelAdd SetPedAmmo(ped, 883325847, math.floor(ammoInJerryCan - fuelAdd)) else StopAnimTask(ped, 'timetable@gardener@filling_can', 'gar_ig_5_filling_can', 8.0, 1.0, -1, 1, 0, 0, 0, 0) isFilling = false end end if vehicleType == "electric" and metadata.type == "electric" then jerryItem = Config.Jerry["chargeItem"] currentF = currentF + fuelAdd end if currentF >= 100.0 then currentF = 100.0 isFilling = false if enozz then DeleteObject(enozz) enozz = nil end StopAnimTask(ped, 'timetable@gardener@filling_can', 'gar_ig_5_filling_can', 8.0, 1.0, -1, 1, 0, 0, 0, 0) TriggerServerEvent('frkn-fuelstation:removeItem', jerryItem) end SetFuel(vehicle, currentF) end end) end, vehicleType) end Wait(500) RemoveAnimDict('timetable@gardener@filling_can') TriggerServerEvent("InteractSound_SV:PlayOnSource", "fuelstop", 0.4) end) -- ???????????????????????????????????????????????? -- ? FUNCTION ? -- ???????????????????????????????????????????????? function checkForVehicles() local PlayerPed = PlayerPedId() local PlayerPos = GetEntityCoords(PlayerPed) local veh = 0 veh = GetClosestVehicle(PlayerPos.x, PlayerPos.y, PlayerPos.z, 7.5, 0, 70) if veh ~= 0 then return veh else return 0 end end function startTankerCarFill() rope() startrefuel = false filling = false Wait(100) startTankerCar = true local bones = {"bonnet","boot","door_dside_f","door_pside_f","seat_dside_f","seat_pside_f","seat_dside_r","seat_pside_r"} if Config.Interaction.Target == "qb-target" then exports[Config.Interaction.Target]:AddTargetBone(bones, { options = { { action = function(entity) TriggerEvent('frkn-fuelstation:refuelTank') end, canInteract = function(entity, distance, data) interact = false if not IsPedInAnyVehicle(ped, true) then if startTankerCar then interact = true else interact = false end else interact = false end return interact end, icon = "fas fa-gas-pump", label = Config.Text["fillTanker"] }, }, distance = 4 }) else exports[Config.Interaction.Target]:addLocalEntity({ bones = bones, options = { { name = 'frkn-fuelstation:refuel', icon = 'fas fa-gas-pump', label = Config.Text["fuelText"], onSelect = function(data) TriggerEvent('frkn-fuelstation:refuel') end, canInteract = function(entity, distance, coords) local interact = false if not IsPedInAnyVehicle(PlayerPedId(), true) then if startrefuel then interact = true else interact = false end else interact = false end return interact end } }, distance = 4 }) end end function loadTankerCarFill() startTankerCar = false TriggerEvent('frkn-fuelstation:ropeDelete') end function buyMenu() SetNuiFocus(1, 1) OpenMenuExport() SendNUIMessage({ action = 'BUY_FUEL', data = {stations = frknData, playerData = playerData} }) end function openJerry(x) SetNuiFocus(1, 1) OpenMenuExport() SendNUIMessage({ action = 'JERRY_CAN', data = {config = Config.Jerry, playerData = playerData, type = x} }) end function LoadAnimDict(dict) while not HasAnimDictLoaded(dict) do RequestAnimDict(dict) Citizen.Wait(500) end end function GetClosestPump(coords, isElectric) if isElectric then local electricPump = nil electricPump = GetClosestObjectOfType(coords.x, coords.y, coords.z, 3.0, "electric_charger", true, true, true) local pumpCoords = GetEntityCoords(electricPump) return pumpCoords, electricPump else local pump = nil local pumpCoords for i = 1, #Config.props, 1 do local currentPumpModel = Config.props[i] pump = GetClosestObjectOfType(coords.x, coords.y, coords.z, 3.0, currentPumpModel, true, true, true) pumpCoords = GetEntityCoords(pump) if pump ~= 0 then break end end return pumpCoords, pump end end function SetLocalFuel(vehicle,fuel) if type(fuel) == 'number' and fuel >= 0 and fuel <= 100 and GetVehicleFuelLevel(vehicle) + fuel <=100 then SetVehicleFuelLevel(vehicle,GetVehicleFuelLevel(vehicle) + fuel) DecorSetFloat(vehicle, '_FUEL_LEVEL', GetVehicleFuelLevel(vehicle)) end end function GetFuel(vehicle) return GetVehicleFuelLevel(vehicle) end exports('GetFuel', GetFuel) function SetFuel(vehicle, fuel) if type(fuel) == 'number' and fuel >= 0 and fuel <= 100 then SetVehicleFuelLevel(vehicle, fuel + 0.0) DecorSetFloat(vehicle, '_FUEL_LEVEL', GetVehicleFuelLevel(vehicle)) end end exports('SetFuel', SetFuel) function SetCurrentFuel(vehicle, fuel) if type(fuel) == 'number' and fuel >= 0 and fuel <= 100 then SetVehicleFuelLevel(vehicle, fuel + 0.0) DecorSetFloat(vehicle, Config.FuelDecor, GetVehicleFuelLevel(vehicle)) end end function DrawText3D(x, y, z, text) local onScreen, _x, _y = World3dToScreen2d(x, y, z) local px, py, pz = table.unpack(GetGameplayCamCoords()) SetTextScale(0.32, 0.32) SetTextFont(4) SetTextProportional(1) SetTextColour(255, 255, 255, 215) SetTextEntry("STRING") SetTextCentre(1) AddTextComponentString(text) DrawText(_x, _y) local factor = (string.len(text)) / 500 DrawRect(_x, _y + 0.0125, 0.015 + factor, 0.03, 41, 11, 41, 68) end function getFuelId() local id = 0 Stations = {} CreateThread(function() for k = 1, #Config.GasStations do Stations[k] = PolyZone:Create(Config.GasStations[k].zones, { name = "GasStation" .. k, minZ = Config.GasStations[k].minz, maxZ = Config.GasStations[k].maxz, debugPoly = false }) Stations[k]:onPlayerInOut(function(isPointInside) if isPointInside then id = k end end) end end) Citizen.Wait(100) return id end function IsPlayerNearVehicle() local vehicle = GetClosestVehicle() local closestVehCoords = GetEntityCoords(vehicle) if #(GetEntityCoords(PlayerPedId(), closestVehCoords)) > 3.0 then return true end return false end function ManageFuelUsage(vehicle) if IsVehicleEngineOn(vehicle) then SetCurrentFuel(vehicle, GetVehicleFuelLevel(vehicle) - Config.FuelUsage[Round(GetVehicleCurrentRpm(vehicle), 1)] * (Config.Classes[GetVehicleClass(vehicle)] or 1.0) / 10) end end function setHandling(vehicle,carFuel) newHandling = getCarHandling() newHandling["fClutchChangeRateScaleDownShift"] = newHandling["fClutchChangeRateScaleDownShift"] + Config.handling[carFuel]["downshift"] SetVehicleHandlingFloat(vehicle,"CHandlingData","fClutchChangeRateScaleDownShift",newHandling["fClutchChangeRateScaleDownShift"]) newHandling["fClutchChangeRateScaleUpShift"] = newHandling["fClutchChangeRateScaleUpShift"] + Config.handling[carFuel]["upshift"] SetVehicleHandlingFloat(vehicle,"CHandlingData","fClutchChangeRateScaleUpShift",newHandling["fClutchChangeRateScaleUpShift"]) newHandling["fLowSpeedTractionLossMult"] = newHandling["fLowSpeedTractionLossMult"] + Config.handling[carFuel]["tractionloss"] SetVehicleHandlingFloat(vehicle,"CHandlingData","fLowSpeedTractionLossMult",newHandling["fLowSpeedTractionLossMult"]) newHandling["fTractionCurveLateral"] = newHandling["fTractionCurveLateral"] + Config.handling[carFuel]["tractionlateral"] SetVehicleHandlingFloat(vehicle,"CHandlingData","fTractionCurveLateral",newHandling["fTractionCurveLateral"]) newHandling["fBrakeForce"] = newHandling["fBrakeForce"] + Config.handling[carFuel]["brakeforce"] SetVehicleHandlingFloat(vehicle,"CHandlingData","fBrakeForce",newHandling["fBrakeForce"]) newHandling["fTractionCurveMax"] = newHandling["fTractionCurveMax"] + Config.handling[carFuel]["tractionmax"] SetVehicleHandlingFloat(vehicle,"CHandlingData","fTractionCurveMax",newHandling["fTractionCurveMax"]) newHandling["fTractionCurveMin"] = newHandling["fTractionCurveMin"] + Config.handling[carFuel]["tractionmin"] SetVehicleHandlingFloat(vehicle,"CHandlingData","fTractionCurveMin",newHandling["fTractionCurveMin"]) newHandling["fDriveInertia"] = newHandling["fDriveInertia"] + Config.handling[carFuel]["driveinteria"] SetVehicleHandlingFloat(vehicle,"CHandlingData","fDriveInertia",newHandling["fDriveInertia"]) setData = false end function setEngine(vehicle) isEngineBroken = true local randomBreakdownTime = math.random(300000,600000) -- 300000 600000 5 ile 10 dk arasinda arac bozulabilir Wait(randomBreakdownTime) SetVehicleEngineHealth(vehicle,Config.CarBreakdownValue) end function getCarHandling() local Vehicle = GetVehiclePedIsIn(PlayerPedId(), false) local handling = {} handling["fDriveInertia"] = GetVehicleHandlingFloat(Vehicle, "CHandlingData", "fDriveInertia") handling["fClutchChangeRateScaleDownShift"] = GetVehicleHandlingFloat(Vehicle, "CHandlingData", "fClutchChangeRateScaleDownShift") handling["fClutchChangeRateScaleUpShift"] = GetVehicleHandlingFloat(Vehicle, "CHandlingData", "fClutchChangeRateScaleUpShift") handling["fLowSpeedTractionLossMult"] = GetVehicleHandlingFloat(Vehicle, "CHandlingData", "fLowSpeedTractionLossMult") handling["fTractionCurveLateral"] = GetVehicleHandlingFloat(Vehicle, "CHandlingData", "fTractionCurveLateral") handling["fBrakeForce"] = GetVehicleHandlingFloat(Vehicle, "CHandlingData", "fBrakeForce") handling["fSuspensionRaise"] = GetVehicleHandlingFloat(Vehicle, "CHandlingData", "fSuspensionRaise") handling["fTractionCurveMax"] = GetVehicleHandlingFloat(Vehicle, "CHandlingData", "fTractionCurveMax") handling["fTractionCurveMin"] = GetVehicleHandlingFloat(Vehicle, "CHandlingData", "fTractionCurveMin") return handling end function fillTanker() propFill = false finishFill = false local ped = PlayerPedId() RequestAnimDict(Config.RefuelAnimationDictionary) while not HasAnimDictLoaded(Config.RefuelAnimationDictionary) do Wait(100) end TaskPlayAnim(ped, Config.RefuelAnimationDictionary, Config.RefuelAnimation, 8.0, 1.0, -1, 1, 0, 0, 0, 0) Wait(2000) StopAnimTask(ped, Config.RefuelAnimationDictionary, Config.RefuelAnimation, 3.0, 3.0, -1, 2, 0, 0, 0, 0) TriggerEvent('frkn-fuelstation:ropeDelete') TriggerServerEvent('frkn-fuelstation:fillEvent') DeleteEntity(tanker) DeleteEntity(trailer) end function fuelCheck(dataType) ch = nil TriggerCallback('frkn-fuelstation:carTypeCheck',function(check) ch = check end,getVehiclePlate(),dataType) Citizen.Wait(2000) return ch end function getVehicleName() local playerVehicle = GetVehiclePedIsIn(PlayerPedId(), false) return GetDisplayNameFromVehicleModel(GetEntityModel(playerVehicle)) end function getVehiclePlate() local playerVehicle = GetVehiclePedIsIn(PlayerPedId(), false) return GetVehicleNumberPlateText(playerVehicle) end function getFuelLevel() local playerVehicle = GetVehiclePedIsIn(PlayerPedId(), false) return GetVehicleFuelLevel(playerVehicle) end function getCarFuelType(playerVehicle) local vehicleModel = GetEntityModel(playerVehicle) if Config.ElectricCars[GetDisplayNameFromVehicleModel(vehicleModel):lower()] then fuelType = Config.ElectricCars[GetDisplayNameFromVehicleModel( vehicleModel):lower()] else local vehicleClass = GetVehicleClass(playerVehicle) if vehicleClass == 0 or vehicleClass == 1 or vehicleClass == 2 or vehicleClass == 3 or vehicleClass == 4 or vehicleClass == 5 then fuelType = "basic" elseif vehicleClass == 6 or vehicleClass == 7 then fuelType = "premium" else fuelType = "basic" end end return fuelType end function DrawText3D(x, y, z, text) local onScreen, _x, _y = World3dToScreen2d(x, y, z) local px, py, pz = table.unpack(GetGameplayCamCoords()) SetTextScale(0.32, 0.32) SetTextFont(4) SetTextProportional(1) SetTextColour(255, 255, 255, 215) SetTextEntry("STRING") SetTextCentre(1) AddTextComponentString(text) DrawText(_x, _y) local factor = (string.len(text)) / 500 DrawRect(_x, _y + 0.0125, 0.015 + factor, 0.03, 41, 11, 41, 68) end function StartFill() SetNewWaypoint(Config.TankerFillingCoords.x,Config.TankerFillingCoords.y) SpawnTrailer() filling = true end function SpawnTanker() local tankerHash = GetHashKey(Config.TankerHash) RequestModel(tankerHash) while not HasModelLoaded(tankerHash) do Citizen.Wait(0) end local playerCoords = GetEntityCoords(PlayerPedId()) tanker = CreateVehicle(tankerHash, playerCoords.x, playerCoords.y - 5, playerCoords.z, GetEntityHeading(PlayerPedId()), true, false) SetEntityAsMissionEntity(tanker, true, true) SetVehicleOnGroundProperly(tanker) -- SetVehicleNumberPlateText(tanker, "TANKER") SetEntityCollision(tanker, true, true) SetEntityInvincible(tanker, true) SetEntityCanBeDamaged(tanker, false) AddVehicleKey(tanker) end function SpawnTrailer() local trailerHash = GetHashKey(Config.TrailerHash) RequestModel(trailerHash) while not HasModelLoaded(trailerHash) do Citizen.Wait(0) end local playerCoords = GetEntityCoords(PlayerPedId()) trailer = CreateVehicle(trailerHash, playerCoords.x, playerCoords.y, playerCoords.z, GetEntityHeading(PlayerPedId()), true, false) SetEntityAsMissionEntity(trailer, true, true) SetVehicleOnGroundProperly(trailer) -- SetVehicleNumberPlateText(trailer, "TRAILER") TaskWarpPedIntoVehicle(PlayerPedId(), trailer, -1) SetVehicleEngineOn(trailer, true, true, true) SetVehicleBodyHealth(trailer, 1000) SetVehicleEngineHealth(trailer, 1000) SetVehiclePetrolTankHealth(trailer, 1000) SetVehicleFixed(trailer) SetVehicleDeformationFixed(trailer) Wait(100) SpawnTanker() AttachTankerToTrailer() TriggerServerEvent('qb-vehiclekeys:server:AcquireVehicleKeys', GetVehicleNumberPlateText(trailer)) TriggerEvent("vehiclekeys:client:SetOwner", GetVehicleNumberPlateText(trailer)) end function AttachTankerToTrailer() if DoesEntityExist(tanker) and DoesEntityExist(trailer) then AttachEntityToEntity(tanker, trailer, 0, 0.0, -6.0, 1.6, 0.0, 0.0, 0.0,false, false, false, false, 2, true) end end function IsVehicleLightTrailEnabled(vehicle) return trailpurgeVehicles[vehicle] == true end function CreateVehicleLightTrail(vehicle, bone, scale) UseParticleFxAssetNextCall("core") local ptfx = StartParticleFxLoopedOnEntityBone("veh_light_red_trail",vehicle,0.0,0.0,0.0,0.0,0.0,0.0,bone,scale,false,false,false) SetParticleFxLoopedEvolution(ptfx, "speed", 1.0, false) return ptfx end function SetVehicleLightTrailEnabled(vehicle, enabled) if IsVehicleLightTrailEnabled(vehicle) == enabled then return end if enabled then local ptfxs = {} local leftTrail = CreateVehicleLightTrail(vehicle, GetEntityBoneIndexByName(vehicle, "taillight_l"), 1.0) local rightTrail = CreateVehicleLightTrail(vehicle, GetEntityBoneIndexByName(vehicle, "taillight_r"), 1.0) table.insert(ptfxs, leftTrail) table.insert(ptfxs, rightTrail) trailpurgeVehicles[vehicle] = true trailpurgeParticles[vehicle] = ptfxs else if trailpurgeParticles[vehicle] and #trailpurgeParticles[vehicle] > 0 then for _, particleId in ipairs(trailpurgeParticles[vehicle]) do StopVehicleLightTrail(particleId, 500) end end trailpurgeVehicles[vehicle] = nil trailpurgeParticles[vehicle] = nil end end function StopVehicleLightTrail(ptfx, duration) Citizen.CreateThread( function() local startTime = GetGameTimer() local endTime = GetGameTimer() + duration while GetGameTimer() < endTime do Citizen.Wait(0) local now = GetGameTimer() local scale = (endTime - now) / duration SetParticleFxLoopedScale(ptfx, scale) SetParticleFxLoopedAlpha(ptfx, scale) end StopParticleFxLooped(ptfx) end) end function CreateVehicleExhaustBackfire(vehicle, scale) local exhaustNames = {"exhaust","exhaust_2","exhaust_3","exhaust_4","exhaust_5","exhaust_6","exhaust_7","exhaust_8","exhaust_9","exhaust_10","exhaust_11","exhaust_12","exhaust_13","exhaust_14","exhaust_15","exhaust_16"} for _, exhaustName in ipairs(exhaustNames) do local boneIndex = GetEntityBoneIndexByName(vehicle, exhaustName) if boneIndex ~= -1 then local pos = GetWorldPositionOfEntityBone(vehicle, boneIndex) local off = GetOffsetFromEntityGivenWorldCoords(vehicle, pos.x, pos.y, pos.z) UseParticleFxAssetNextCall("core") StartParticleFxNonLoopedOnEntity("veh_backfire",vehicle,off.x,off.y,off.z,0.0,0.0,0.0,scale,false,false,false) end end end function IsVehicleNitroPurgeEnabled(vehicle) return purgeVehicles[vehicle] == true end function SetVehicleNitroPurgeEnabled(vehicle, enabled) if IsVehicleNitroPurgeEnabled(vehicle) == enabled then return end if enabled then local bone = GetEntityBoneIndexByName(vehicle, "bonnet") local pos = GetWorldPositionOfEntityBone(vehicle, bone) local off = GetOffsetFromEntityGivenWorldCoords(vehicle, pos.x, pos.y, pos.z) local ptfxs = {} for i = 0, 3 do local leftPurge = CreateVehiclePurgeSpray(vehicle, off.x - 0.5, off.y + 0.05, off.z, 40.0, -20.0, 0.0, 0.5) local rightPurge = CreateVehiclePurgeSpray(vehicle, off.x + 0.5, off.y + 0.05, off.z, 40.0, 20.0, 0.0, 0.5) table.insert(ptfxs, leftPurge) table.insert(ptfxs, rightPurge) end purgeVehicles[vehicle] = true purgeParticles[vehicle] = ptfxs else if purgeParticles[vehicle] and #purgeParticles[vehicle] > 0 then for _, particleId in ipairs(purgeParticles[vehicle]) do StopParticleFxLooped(particleId) end end purgeVehicles[vehicle] = nil purgeParticles[vehicle] = nil end end function CreateVehiclePurgeSpray(vehicle, xOffset, yOffset, zOffset, xRot, yRot, zRot, scale) UseParticleFxAssetNextCall("core") return StartParticleFxLoopedOnEntity("ent_sht_steam",vehicle,xOffset,yOffset,zOffset,xRot,yRot,zRot,scale,false,false,false) end local function RotationToDirection( rotation ) local adjustedRotation = { x = (math.pi / 180) * rotation.x, y = (math.pi / 180) * rotation.y, z = (math.pi / 180) * rotation.z } local direction = { x = -math.sin(adjustedRotation.z) * math.abs(math.cos(adjustedRotation.x)), y = math.cos(adjustedRotation.z) * math.abs(math.cos(adjustedRotation.x)), z = math.sin(adjustedRotation.x) } return direction end local function RayCastGamePlayCamera( distance ) local cameraRotation = GetGameplayCamRot() local cameraCoord = GetGameplayCamCoord() local direction = RotationToDirection(cameraRotation) local destination = { x = cameraCoord.x + direction.x * distance, y = cameraCoord.y + direction.y * distance, z = cameraCoord.z + direction.z * distance } local a, b, c, d, e = GetShapeTestResult(StartShapeTestRay(cameraCoord.x, cameraCoord.y, cameraCoord.z, destination.x, destination.y, destination.z, -1, PlayerPedId(), 0)) return c, e end local function up( object, offset ) DisableControlAction(0, 27, true) if IsDisabledControlPressed(0, 27) then -- arrow up local delta = 0.05 DisableControlAction(0, 36, true) if IsDisabledControlPressed(0, 36) then -- ctrl held down delta = 0.10 end local object_coords = GetEntityCoords(object) SetEntityCoords(object, object_coords.x + offset.x, object_coords.y + offset.y, object_coords.z + offset.z + delta) end end local function down( object, offset ) DisableControlAction(0, 173, true) if IsDisabledControlPressed(0, 173) then -- arrow up local delta = 0.05 DisableControlAction(0, 36, true) if IsDisabledControlPressed(0, 36) then -- ctrl held down delta = 0.10 end local object_coords = GetEntityCoords(object) SetEntityCoords(object, object_coords.x + offset.x, object_coords.y + offset.y, object_coords.z + offset.z - delta) end end local function left( object, offset, xy ) DisableControlAction(0, 174, true) if IsDisabledControlPressed(0, 174) then -- arrow up local delta = 0.05 DisableControlAction(0, 36, true) if IsDisabledControlPressed(0, 36) then -- ctrl held down delta = 0.10 end local object_coords = GetEntityCoords(object) if xy == "x" then SetEntityCoords(object, object_coords.x + offset.x + delta, object_coords.y + offset.y, object_coords.z + offset.z) else SetEntityCoords(object, object_coords.x + offset.x, object_coords.y + offset.y + delta, object_coords.z + offset.z) end end end local function right( object, offset, xy ) DisableControlAction(0, 175, true) if IsDisabledControlPressed(0, 175) then -- arrow up local delta = 0.05 DisableControlAction(0, 36, true) if IsDisabledControlPressed(0, 36) then -- ctrl held down delta = 0.10 end local object_coords = GetEntityCoords(object) if xy == "x" then SetEntityCoords(object, object_coords.x + offset.x - delta, object_coords.y + offset.y, object_coords.z + offset.z) else SetEntityCoords(object, object_coords.x + offset.x, object_coords.y + offset.y - delta, object_coords.z + offset.z) end end end local object function ChooseSpawnLocation( model, offset ) local plyped = PlayerPedId() local pedCoord = GetEntityCoords(plyped) local object_placed = false local xy = "x" object = CreateObject(GetHashKey(model), pedCoord.x + offset.x, pedCoord.y + offset.y, pedCoord.z + offset.z, 1, 0, 0) SetEntityAlpha(object, 150, true) SetEntityCollision(object, false, false) while true do BlockWeaponWheelThisFrame() local coords, entity = RayCastGamePlayCamera(50.0) if IsControlJustReleased(0, 38) then object_placed = true end if IsControlJustReleased(0, 191) then local ec = GetEntityCoords(object) local w = GetEntityHeading(object) DeleteEntity(object) return vector4(ec.x - offset.x, ec.y - offset.y, ec.z - offset.z, w) end up(object, offset) down(object, offset) right(object, offset, xy) left(object, offset, xy) DisableControlAction(0, 81, true) if IsDisabledControlJustPressed(0, 81) then local head = GetEntityHeading(object) local delta = 7.5 DisableControlAction(0, 36, true) if IsDisabledControlPressed(0, 36) then -- ctrl held down delta = 1.0 end head = head + delta SetEntityHeading(object, head) end DisableControlAction(0, 99, true) if IsDisabledControlJustPressed(0, 99) then local head = GetEntityHeading(object) local delta = 7.5 DisableControlAction(0, 36, true) if IsDisabledControlPressed(0, 36) then -- ctrl held down delta = 1.0 end head = head - delta SetEntityHeading(object, head) end DisableControlAction(0, 200, true) if IsDisabledControlJustPressed(0, 200) then DeleteEntity(object) return "exit" end if IsControlPressed(0, 10) then xy = "x" end if IsControlPressed(0, 11) then xy = "y" end DisableControlAction(0, 36, true) if not object_placed then SetEntityCoords(object, coords.x + offset.x, coords.y + offset.y, coords.z + offset.z) end Wait(0) FreezeEntityPosition(object,true) end end --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS --discord.gg/fiveleaksontop FIVE LEAKS