Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function vRP.towVehicle()
- Citizen.Trace('towVehicle')
- vRP.getNearestOwnedVehicle(7, function (ok, vtype, name)
- if ok then
- Citizen.Trace('towVehicle ok ')
- vRP.getOwnedVehiclePosition(vtype, function(x,y,z)
- vRP.getVehicleAtPosition(x,y,z, function(towVehicle)
- vRP.getNearestVehicle(5, function(veh)
- Citizen.Trace('towing ' .. veh .. " tow " .. towVehicle )
- if towVehicle ~= nil and veh ~= nil and towVehicle ~= veh then
- AttachEntityToEntity(veh, towVehicle, 20, -0.5, -5.0, 1.0, 0.0, 0.0, 0.0, false, false, false, false, 20, true)
- vRPserver.vehicleTowed()
- end
- end)
- end)
- end)
- end
- end)
- end
- function vRP.untowVehicle()
- Citizen.Trace('untowVehicle')
- vRP.getNearestOwnedVehicle(7, function (ok, vtype, name)
- if ok then
- Citizen.Trace('untowVehicle ok ')
- vRP.getOwnedVehiclePosition(vtype, function(x,y,z)
- vRP.getVehicleAtPosition(x,y,z, function(towVehicle)
- vRP.getNearestVehicle(5, function(veh)
- Citizen.Trace('untowing ' .. veh .. " tow " .. towVehicle )
- if towVehicle ~= nil and veh ~= nil and towVehicle ~= veh then
- AttachEntityToEntity(veh, towVehicle, 20, -0.5, -12.0, 1.0, 0.0, 0.0, 0.0, false, false, false, false, 20, true)
- DetachEntity(veh, true, true)
- vRPserver.vehicleunTowed()
- end
- end)
- end)
- end)
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement