Forum içeriğine ve tüm hizmetlerimize erişim sağlamak için foruma kayıt olmalı ya da giriş yapmalısınız. Foruma üye olmak tamamen ücretsizdir.
Hocam telefonda vale oldu fakat araçlar gözükmüyor içerisindegcphone/client/valet.lua {
local enroute = false
local mechPed = nil
function setCars(cars)
SendNUIMessage({event = 'updateCars', cars = cars})
end
RegisterNUICallback('getCars', function(data)
ESX.TriggerServerCallback('gcPhone:getCars', function(data)
for i = 1, #data do
model = GetDisplayNameFromVehicleModel(data["props"].model)
data["props"].model = model
end
setCars(data)
end)
end)
RegisterNUICallback('getCarsValet', function(data)
if enroute then
exports['mythic_notify']:SendAlert('inform', 'Valeyi Bekleyin')
return
end
local gameVehicles = ESX.Game.GetVehicles()
for i = 1, #gameVehicles do
local vehicle = gameVehicles
if DoesEntityExist(vehicle) then
if ESX.Math.Trim(GetVehicleNumberPlateText(vehicle)) == ESX.Math.Trim(data.props.plate) then
local vehicleCoords = GetEntityCoords(vehicle)
SetNewWaypoint(vehicleCoords.x, vehicleCoords.y)
exports['mythic_notify']:SendAlert('inform', 'Vale zaten dışarıda')
return
end
end
end
TriggerServerEvent("gcPhone:valet-car-set-outside", data.props.plate)
local player = PlayerPedId()
local playerPos = GetEntityCoords(player)
local driverhash = 999748158
local vehhash = data.props.model
while not HasModelLoaded(driverhash) and RequestModel(driverhash) or not HasModelLoaded(vehhash) and RequestModel(vehhash) do
RequestModel(driverhash)
RequestModel(vehhash)
Citizen.Wait(0)
end
SpawnVehicle(playerPos.x, playerPos.y, playerPos.z, vehhash, driverhash, data.props)
end)
function SpawnVehicle(x, y, z, vehhash, driverhash, props) --Spawning Function
local found, spawnPos, spawnHeading = GetClosestVehicleNodeWithHeading(x + math.random(-100, 100), y + math.random(-100, 100), z, 0, 3, 0)
ESX.Game.SpawnVehicle(vehhash, spawnPos, spawnHeading, function(callback_vehicle)
SetVehicleHasBeenOwnedByPlayer(callback_vehicle, true)
SetEntityAsMissionEntity(callback_vehicle, true, true)
ClearAreaOfVehicles(GetEntityCoords(callback_vehicle), 5000, false, false, false, false, false);
SetVehicleOnGroundProperly(callback_vehicle)
ESX.Game.SetVehicleProperties(callback_vehicle, props)
mechPed = CreatePedInsideVehicle(callback_vehicle, 26, driverhash, -1, true, false) --Driver Spawning.
mechBlip = AddBlipForEntity(callback_vehicle) --Blip Spawning.
SetBlipFlashes(mechBlip, true)
SetBlipColour(mechBlip, 5)
GoToTarget(x, y, z, callback_vehicle, mechPed, vehhash)
end) --Car Spawning.
end
function GoToTarget(x, y, z, vehicle, driver, vehhash, target)
enroute = true
while enroute do
Citizen.Wait(500)
local player = PlayerPedId()
local playerPos = GetEntityCoords(player)
SetDriverAbility(driver, 1.0) -- values between 0.0 and 1.0 are allowed.
SetDriverAggressiveness(driver, 0.0)
TaskVehicleDriveToCoord(driver, vehicle, playerPos.x, playerPos.y, playerPos.z, 20.0, 0, vehhash, 4457279, 1, true)
local distanceToTarget = #(playerPos - GetEntityCoords(vehicle))
if distanceToTarget < 15 or distanceToTarget > 150 then
RemoveBlip(mechBlip)
TaskVehicleTempAction(driver, vehicle, 27, 6000)
--SetVehicleUndriveable(vehicle, true)
SetEntityHealth(mechPed, 2000)
GoToTargetWalking(x, y, z, vehicle, driver)
enroute = false
end
end
end
function GoToTargetWalking(x, y, z, vehicle, driver)
Citizen.Wait(500)
TaskWanderStandard(driver, 10.0, 10)
TriggerServerEvent('gcPhone:finish')
Citizen.Wait(35000)
DeletePed(mechPed)
mechPed = nil
end
}
gchpone/server/valet.lua
{
ESX.RegisterServerCallback("gcPhone:getCars", function(a, b)
local c = ESX.GetPlayerFromId(a)
if not c then
return
end;
MySQL.Async.fetchAll("SELECT plate, vehicle, stored FROM owned_vehicles WHERE owner = @cid and type = T type", {["@cid"] = c.identifier, [" T type"] = "car"}, function(d)
local e = {} for f, g in ipairs(d) do
table.insert(e, {["garage"] = g["stored"], ["plate"] = g["plate"], ["props"] = json.decode(g["vehicle"])})
end;
b(e)
end)
end)
RegisterServerEvent("gcPhone:finish")
AddEventHandler("gcPhone:finish", function(a)
local b = source;
local c = ESX.GetPlayerFromId(b)
TriggerClientEvent('mythic_notify:client:SendAlert', source, { type = 'inform', text = 'Valeye '..Config.valetPrice.. 'TL ödedin.', length = 2500})
c.removeAccountMoney("bank", Config.valetPrice)
end)
RegisterServerEvent("gcPhone:valet-car-set-outside")
AddEventHandler("gcPhone:valet-car-set-outside", function(a)
local b = source;
local c = ESX.GetPlayerFromId(b)
if c then
MySQL.Async.insert("UPDATE owned_vehicles SET stored = @stored WHERE plate = @plate", {["@plate"] = a, ["@stored"] = 0})
end
end)
}
esx_vehicleshop scriptini ve içinde SQL dosyasını kurun.Yok bulamadım kurulu değil sanırım
Tamamdır Database'de Owned_Vehicles Kısmı Geldi Şimdi Nabacağımesx_vehicleshop scriptini ve içinde SQL dosyasını kurun.
Linkleri,görmek için Giriş yap veya üye ol.
Şöyle Bir Hata Aldım Okutur'kenLinkleri,görmek için Giriş yap veya üye ol.
şu anda aktif olarak kullandığım telefon
Forumdan daha fazla yararlanmak için giriş yapın veya kayıt olun!