Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Draw3DText(x,y,z, text)
- local onScreen,_x,_y = World3dToScreen2d(x,y,z)
- local px,py,pz = table.unpack(GetGameplayCamCoord())
- local dist = GetDistanceBetweenCoords(px,py,pz, x,y,z, 1)
- local scale = 0.5
- if onScreen then
- -- Formalize the text
- SetTextColour(255, 255, 255, 255)
- SetTextScale(scale, scale)
- SetTextFont(0)
- SetTextProportional(1)
- SetTextCentre(true)
- SetTextDropshadow(10, 100, 100, 100, 255)
- -- Calculate width and height
- BeginTextCommandWidth("STRING")
- AddTextComponentString(text)
- local height = GetTextScaleHeight(scale, 0)
- local width = EndTextCommandGetWidth(0)
- -- Diplay the text
- SetTextEntry("STRING")
- AddTextComponentString(text)
- EndTextCommandDisplayText(_x, _y)
- DrawRect(_x, _y+0.019, width+0.005, height+0.005, 102, 56, 56 ,125)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement