-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.lua
More file actions
26 lines (23 loc) · 1.02 KB
/
Copy pathclient.lua
File metadata and controls
26 lines (23 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
RegisterNetEvent('td_spawnVeh:SetVehicleProperties')
AddEventHandler('td_spawnVeh:SetVehicleProperties', function(vehicle, vehprops)
TD_SetVehicleProperties(NetworkGetEntityFromNetworkId(vehicle), vehprops)
end)
RegisterNetEvent('td_spawnVeh:spawn')
AddEventHandler('td_spawnVeh:spawn', function(vehicle, props)
local model = props['model']
local enginehealth = props['engineHealth']
local bodyhealth = props['bodyHealth']
local currentfuel = props['fuelLevel'] + 1.0
local playerPed = PlayerPedId()
local playerCoords = GetEntityCoords(playerPed)
local entity = NetworkGetEntityFromNetworkId(vehicle)
if GetVehicleNumberPlateText(entity) == props['plate'] then
SetVehicleEngineHealth(entity, enginehealth)
SetVehicleBodyHealth(entity, bodyhealth)
SetVehicleEngineOn(entity, false, true, true)
SetVehRadioStation(entity, "OFF")
-- Fuel system --
exports["lc_fuel"]:SetFuel(entity, currentfuel)
-----------------
end
end)