Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. local time = 7000 -- Duration of the display of the text : 1000ms = 1sec
  2. local nbrDisplaying = 1
  3.  
  4. RegisterCommand('me', function(source, args)
  5. local text = '* the person' -- edit here if you want to change the language : EN: the person / FR: la personne
  6. for i = 1,#args do
  7. text = text .. ' ' .. args[i]
  8. end
  9. text = text .. ' *'
  10. TriggerServerEvent('3dme:shareDisplay', text)
  11. end)
  12.  
  13. RegisterNetEvent('3dme:triggerDisplay')
  14. AddEventHandler('3dme:triggerDisplay', function(text, source)
  15. local offset = 1 + (nbrDisplaying*0.14)
  16. Display(GetPlayerFromServerId(source), text, offset)
  17. end)
  18.  
  19. function Display(mePlayer, text, offset)
  20. local displaying = true
  21. Citizen.CreateThread(function()
  22. Wait(time)
  23. displaying = false
  24. end)
  25. Citizen.CreateThread(function()
  26. nbrDisplaying = nbrDisplaying + 1
  27. print(nbrDisplaying)
  28. while displaying do
  29. Wait(0)
  30. local coordsMe = GetEntityCoords(GetPlayerPed(mePlayer), false)
  31. local coords = GetEntityCoords(PlayerPedId(), false)
  32. local dist = GetDistanceBetweenCoords(coordsMe['x'], coordsMe['y'], coordsMe['z'], coords['x'], coords['y'], coords['z'], true)
  33. if dist < 50 then
  34. DrawText3D(coordsMe['x'], coordsMe['y'], coordsMe['z']+offset, text)
  35. end
  36. end
  37. nbrDisplaying = nbrDisplaying - 1
  38. end)
  39. end
  40.  
  41. function DrawText3Ds(x,y,z, text)
  42. local onScreen,_x,_y=World3dToScreen2d(x,y,z)
  43. local px,py,pz=table.unpack(GetGameplayCamCoords())
  44.  
  45. SetTextScale(0.35, 0.35)
  46. SetTextFont(4)
  47. SetTextProportional(1)
  48. SetTextColour(255, 255, 255, 215)
  49. SetTextEntry("STRING")
  50. SetTextCentre(1)
  51. AddTextComponentString(text)
  52. DrawText(_x,_y)
  53. local factor = (string.len(text)) / 370
  54. DrawRect(_x,_y+0.0125, 0.015+ factor, 0.03, 41, 11, 41, 68)
  55. end
  56.  
  57. function DrawAdvancedText(x,y ,w,h,sc, text, r,g,b,a,font,jus)
  58. SetTextFont(font)
  59. SetTextProportional(0)
  60. SetTextScale(sc, sc)
  61. N_0x4e096588b13ffeca(jus)
  62. SetTextColour(r, g, b, a)
  63. SetTextDropShadow(0, 0, 0, 0,255)
  64. SetTextEdge(1, 0, 0, 0, 255)
  65. SetTextDropShadow()
  66. SetTextOutline()
  67. SetTextEntry("STRING")
  68. AddTextComponentString(text)
  69. DrawText(x - 0.1+w, y - 0.02+h)
  70. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement