Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local time = 7000 -- Duration of the display of the text : 1000ms = 1sec
- local nbrDisplaying = 1
- RegisterCommand('me', function(source, args)
- local text = '* the person' -- edit here if you want to change the language : EN: the person / FR: la personne
- for i = 1,#args do
- text = text .. ' ' .. args[i]
- end
- text = text .. ' *'
- TriggerServerEvent('3dme:shareDisplay', text)
- end)
- RegisterNetEvent('3dme:triggerDisplay')
- AddEventHandler('3dme:triggerDisplay', function(text, source)
- local offset = 1 + (nbrDisplaying*0.14)
- Display(GetPlayerFromServerId(source), text, offset)
- end)
- function Display(mePlayer, text, offset)
- local displaying = true
- Citizen.CreateThread(function()
- Wait(time)
- displaying = false
- end)
- Citizen.CreateThread(function()
- nbrDisplaying = nbrDisplaying + 1
- print(nbrDisplaying)
- while displaying do
- Wait(0)
- local coordsMe = GetEntityCoords(GetPlayerPed(mePlayer), false)
- local coords = GetEntityCoords(PlayerPedId(), false)
- local dist = GetDistanceBetweenCoords(coordsMe['x'], coordsMe['y'], coordsMe['z'], coords['x'], coords['y'], coords['z'], true)
- if dist < 50 then
- DrawText3D(coordsMe['x'], coordsMe['y'], coordsMe['z']+offset, text)
- end
- end
- nbrDisplaying = nbrDisplaying - 1
- end)
- end
- function DrawText3Ds(x,y,z, text)
- local onScreen,_x,_y=World3dToScreen2d(x,y,z)
- local px,py,pz=table.unpack(GetGameplayCamCoords())
- SetTextScale(0.35, 0.35)
- SetTextFont(4)
- SetTextProportional(1)
- SetTextColour(255, 255, 255, 215)
- SetTextEntry("STRING")
- SetTextCentre(1)
- AddTextComponentString(text)
- DrawText(_x,_y)
- local factor = (string.len(text)) / 370
- DrawRect(_x,_y+0.0125, 0.015+ factor, 0.03, 41, 11, 41, 68)
- end
- function DrawAdvancedText(x,y ,w,h,sc, text, r,g,b,a,font,jus)
- SetTextFont(font)
- SetTextProportional(0)
- SetTextScale(sc, sc)
- N_0x4e096588b13ffeca(jus)
- SetTextColour(r, g, b, a)
- SetTextDropShadow(0, 0, 0, 0,255)
- SetTextEdge(1, 0, 0, 0, 255)
- SetTextDropShadow()
- SetTextOutline()
- SetTextEntry("STRING")
- AddTextComponentString(text)
- DrawText(x - 0.1+w, y - 0.02+h)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement