Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. -- made by rose#0415
  2.  
  3. print("Du har nu loaded et høst animations script lavet af rose.")
  4.  
  5. local farm = {
  6. {x=2217.5212402344,y=5578.703125,z=53.725204467773} -- weed farm
  7. }
  8.  
  9. Citizen.CreateThread(function()
  10. -- while true do
  11.  
  12. -- for k,v in pairs(farm) do -- for flere farme
  13.  
  14.  
  15.  
  16.  
  17. if GetDistanceBetweenCoords(farm.x, farm.y, farm.z, GetEntityCoords(GetPlayerPed(-1))) < 5.0 then
  18.  
  19. DrawText3D(farm.x, farm.y, farm.z, "Tryk på B for at begynde at farme.");
  20. if IsControlPressed(0, 57) then
  21. TaskPlayAnim(GetPlayerPed(-1), animDict, 'WORLD_HUMAN_GARDENER_PLANT', 8.0, -8.0, 2700, 50, 0.0, true, true, true)
  22. while not HasAnimDictLoaded("WORLD_HUMAN_GARDENER_PLANT") do
  23. wait(0)
  24.  
  25. end
  26. if IsControlPressed(0, 57) then
  27. if not IsPedInjured(GetPlayerPed(-1)) then
  28. ClearPedSecondaryTask(GetPlayerPed(-1))
  29. end
  30. if not IsPedInAnyVehicle(GetPlayerPed(-1), 1) then
  31. SetPedCurrentWeaponVisible(GetPlayerPed(-1), 1, 1, 1, 1)
  32. end
  33. end
  34.  
  35. end
  36. end
  37.  
  38. end)
  39.  
  40. -----------------------------------------------------------
  41.  
  42. function DrawText3D(x,y,z, text)
  43. local onScreen, _x, _y = World3dToScreen2d(x, y, z)
  44. local px, py, pz = table.unpack(GetGameplayCamCoords())
  45.  
  46. SetTextScale(0.35, 0.35)
  47. SetTextFont(4)
  48. SetTextProportional(1)
  49. SetTextColour(255, 255, 255, 215)
  50. SetTextEntry("STRING")
  51. SetTextCentre(1)
  52. AddTextComponentString(text)
  53. DrawText(_x, _y)
  54. local factor = (string.len(text)) / 370
  55. DrawRect(_x, _y + 0.0125, 0.015 + factor, 0.03, 20,20,20,150)
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement