Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ESX = nil
- local PlayerData = {}
- Citizen.CreateThread(function()
- while ESX == nil do
- TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
- Citizen.Wait(0)
- end
- end)
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(1000)
- PlayerData = ESX.GetPlayerData()
- end
- end)
- RegisterCommand('testcar', function(source, args, rawCommand)
- if PlayerData.job.name == 'cardealer' then
- local veh = args[1]
- local position=tonumber(args[2])
- local playerPed=GetPlayerPed(-1)
- local coords=GetEntityCoords(playerPed)
- local position1=vector3(-1204.19,-1738.02,4.39)
- if veh == nil then
- ESX.ShowNotification("~r~Please enter a car model")
- end
- vehiclehash = GetHashKey(veh)
- RequestModel(vehiclehash)
- Citizen.CreateThread(function()
- local waiting = 0
- while not HasModelLoaded(vehiclehash) do
- waiting = waiting + 100
- Citizen.Wait(100)
- if waiting > 5000 then
- ESX.ShowNotification("Could not load the vehicle model.")
- break
- end
- end
- if position then
- if position==1 then
- ESX.Game.SpawnVehicle(vehiclehash,position1,296,function(vehicle)
- --TaskWarpPedIntoVehicle(playerPed,vehicle,-1)
- FreezeEntityPosition(vehicle, true)
- end)
- end
- else
- ESX.ShowNotification("~r~No position")
- end
- end)
- elseif PlayerData.job.name ~= 'cardealer' then
- ESX.ShowNotification("~r~You cannot use this command")
- end
- if position then
- ESX.ShowNotification("~r~Not nill")
- end
- end)
- --CLEARING THE AREA OUT OF VEHICLES
- Citizen.CreateThread(function()
- while true do
- ClearAreaOfVehicles(-1168.08, -1747.34, 4.0, 30.0, false,false,false,false,false)
- Citizen.Wait(0)
- end
- end)
- RegisterCommand('dvtest', function()
- if PlayerData.job.name == 'cardealer' then
- if IsPedSittingInAnyVehicle(GetPlayerPed(-1)) and not IsEntityDead(GetPlayerPed(-1)) then
- DeleteEntity(GetVehiclePedIsIn(GetPlayerPed(-1),false))
- end
- end
- end)
- RegisterCommand('coords',function()
- print(GetEntityCoords(playerPed))
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement