@@ -9,36 +9,37 @@ local blip = AddBlipForCoord(v2.x, v2.y)
9
9
-- sets the blip id (which icon will be desplayed)
10
10
-- https://runtime.fivem.net/doc/natives/#_0xDF735600A4696DAF
11
11
SetBlipSprite (blip , 364 )
12
- -- sets where the blip to be shown on both the minimap and the menu map
12
+ -- sets where the blip to be shown on both the minimap and the menu map
13
13
-- https://runtime.fivem.net/doc/natives/#_0x9029B2F3DA924928
14
14
SetBlipDisplay (blip , 6 )
15
15
-- how big the blip will be
16
16
-- https://runtime.fivem.net/doc/natives/#_0xD38744167B2FA257
17
17
SetBlipScale (blip , 0.9 )
18
18
-- blip entry type
19
- BeginTextCommandSetBlipName (" STRING" );
19
+ BeginTextCommandSetBlipName (" STRING" )
20
20
-- The title of the blip
21
21
AddTextComponentString (" Do not enter" )
22
22
EndTextCommandSetBlipName (blip )
23
23
24
-
25
- RegisterCommand (" tp" , function (source , args )
26
- -- https://runtime.fivem.net/doc/natives/#_0x06843DA7060A026B
27
- SetEntityCoords (PlayerPedId (), v3 .x , v3 .y , v3 .z , true , true , true , false )
28
- SetEntityHeading (PlayerPedId (), v3 .w )
29
- end )
30
-
24
+ RegisterCommand (
25
+ " tp" ,
26
+ function (source , args )
27
+ -- https://runtime.fivem.net/doc/natives/#_0x06843DA7060A026B
28
+ SetEntityCoords (PlayerPedId (), v3 .x , v3 .y , v3 .z , true , true , true , false )
29
+ SetEntityHeading (PlayerPedId (), v3 .w )
30
+ end
31
+ )
31
32
32
33
-- forked from https://forum.fivem.net/t/3d-text-above-cyrcle-marker-trigger/161363/7 user: MixZira
33
- function Draw3DText (x , y , z , text )
34
+ function Draw3DText (x , y , z , scl_factor , text )
34
35
local onScreen , _x , _y = World3dToScreen2d (x , y , z )
35
36
local p = GetGameplayCamCoords ()
36
37
local distance = GetDistanceBetweenCoords (p .x , p .y , p .z , x , y , z , 1 )
37
38
local scale = (1 / distance ) * 2
38
39
local fov = (1 / GetGameplayCamFov ()) * 100
39
- local scale = scale * fov
40
+ local scale = scale * fov * scl_factor
40
41
if onScreen then
41
- SetTextScale (0.0 , 0.35 )
42
+ SetTextScale (0.0 , scale )
42
43
SetTextFont (0 )
43
44
SetTextProportional (1 )
44
45
SetTextColour (255 , 255 , 255 , 255 )
@@ -49,19 +50,21 @@ function Draw3DText(x, y, z, text)
49
50
SetTextEntry (" STRING" )
50
51
SetTextCentre (1 )
51
52
AddTextComponentString (text )
52
- DrawText (_x ,_y )
53
+ DrawText (_x , _y )
53
54
end
54
55
end
55
56
56
57
local distance_until_text_disappears = 5000
57
58
58
- Citizen .CreateThread (function ()
59
- while true do
60
- Citizen .Wait (0 )
61
- -- the "Vdist2" native checks how far two vectors are from another.
59
+ Citizen .CreateThread (
60
+ function ()
61
+ while true do
62
+ Citizen .Wait (0 )
63
+ -- the "Vdist2" native checks how far two vectors are from another.
62
64
-- https://runtime.fivem.net/doc/natives/#_0xB7A628320EFF8E47
63
65
if Vdist2 (GetEntityCoords (PlayerPedId (), false ), v1 ) < distance_until_text_disappears then
64
- Draw3DText (v1 .x ,v1 .y ,v1 .z , " test" )
66
+ Draw3DText (v1 .x , v1 .y , v1 .z , 1.5 , " test" )
65
67
end
68
+ end
66
69
end
67
- end )
70
+ )
0 commit comments