Advertisement
ZernaxLeDozo

Untitled

Nov 22nd, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. local playerPed = GetPlayerPed(-1)
  2. local waypointBlip = GetFirstBlipInfoId(8)
  3. local x,y,z = table.unpack(Citizen.InvokeNative(0xFA7C7F0AADF25D09, waypointBlip, Citizen.ResultAsVector()))
  4.  
  5. if not waypointBlip then
  6. TriggerEvent("chatMessage", "", {255,0,0}, "You have to set a waypoint to use this script!")
  7. print("You have to set a waypoint to use this script!")
  8. return
  9. end
  10.  
  11. local vehicle = GetVehiclePedIsIn(playerPed, false)
  12.  
  13. if not vehicle then
  14. TriggerEvent("chatMessage", "", {255,0,0}, "You have to be in a vehicle to use this script!")
  15. print("You have to be in a vehicle to use this script!")
  16. return
  17. end
  18.  
  19. TaskVehicleDriveToCoord(playerPed, vehicle, x, y, z, 17.0, 0, vehicle, 786603, 15.0, true)
  20.  
  21. Citizen.CreateThread(function()
  22. while true do
  23. Citizen.Wait(0)
  24. if (GetDistanceBetweenCoords(GetEntityCoords(playerPed, true), x,y,z, false) < 15) then
  25. TaskVehicleDriveToCoord(GetPlayerPed(-1), GetVehiclePedIsIn(GetPlayerPed(-1), false), nil, nil, nil, 17.0, 0, GetVehiclePedIsIn(GetPlayerPed(-1), false), 786603, 15.0, false)
  26. break
  27. else
  28. SetTextComponentFormat('STRING')
  29. AddTextComponentString("Press ~INPUT_CONTEXT~ to stop the car")
  30. DisplayHelpTextFromStringLabel(0, 0, 1, -1)
  31. if IsControlJustPressed(1,38) then
  32. TaskVehicleDriveToCoord(GetPlayerPed(-1), GetVehiclePedIsIn(GetPlayerPed(-1), false), nil, nil, nil, 17.0, 0, GetVehiclePedIsIn(GetPlayerPed(-1), false), 786603, 15.0, false)
  33. break
  34. end
  35. end
  36. end
  37. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement