Advertisement
sanellim

Untitled

Jun 16th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. function vRP.towVehicle()
  2. Citizen.Trace('towVehicle')
  3. vRP.getNearestOwnedVehicle(7, function (ok, vtype, name)
  4. if ok then
  5. Citizen.Trace('towVehicle ok ')
  6. vRP.getOwnedVehiclePosition(vtype, function(x,y,z)
  7. vRP.getVehicleAtPosition(x,y,z, function(towVehicle)
  8. vRP.getNearestVehicle(5, function(veh)
  9. Citizen.Trace('towing ' .. veh .. " tow " .. towVehicle )
  10. if towVehicle ~= nil and veh ~= nil and towVehicle ~= veh then
  11. AttachEntityToEntity(veh, towVehicle, 20, -0.5, -5.0, 1.0, 0.0, 0.0, 0.0, false, false, false, false, 20, true)
  12. vRPserver.vehicleTowed()
  13. end
  14. end)
  15. end)
  16. end)
  17. end
  18. end)
  19. end
  20.  
  21. function vRP.untowVehicle()
  22. Citizen.Trace('untowVehicle')
  23. vRP.getNearestOwnedVehicle(7, function (ok, vtype, name)
  24. if ok then
  25. Citizen.Trace('untowVehicle ok ')
  26. vRP.getOwnedVehiclePosition(vtype, function(x,y,z)
  27. vRP.getVehicleAtPosition(x,y,z, function(towVehicle)
  28. vRP.getNearestVehicle(5, function(veh)
  29. Citizen.Trace('untowing ' .. veh .. " tow " .. towVehicle )
  30. if towVehicle ~= nil and veh ~= nil and towVehicle ~= veh then
  31. AttachEntityToEntity(veh, towVehicle, 20, -0.5, -12.0, 1.0, 0.0, 0.0, 0.0, false, false, false, false, 20, true)
  32. DetachEntity(veh, true, true)
  33. vRPserver.vehicleunTowed()
  34. end
  35. end)
  36. end)
  37. end)
  38. end
  39. end)
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement