-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclient.lua
104 lines (94 loc) · 4.74 KB
/
client.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
-- Creditos: @BADTRIP#0611
-----------------------------------------------------------------------------------------------------------------------------------------
-- importa os Utils do VRP
-----------------------------------------------------------------------------------------------------------------------------------------
local Tunnel = module("vrp", "lib/Tunnel")
local Proxy = module("vrp", "lib/Proxy")
-----------------------------------------------------------------------------------------------------------------------------------------
-- Tunnel e Proxy VRP
-----------------------------------------------------------------------------------------------------------------------------------------
vRPclient = Tunnel.getInterface("vRP")
vRP = Proxy.getInterface("vRP")
-----------------------------------------------------------------------------------------------------------------------------------------
-- Tunnel e Proxy do Resource
-----------------------------------------------------------------------------------------------------------------------------------------
vRPidd = {}
Tunnel.bindInterface("vrp_admin_ids",vRPidd)
Proxy.addInterface("vrp_admin_ids",vRPidd)
SVIDclient = Tunnel.getInterface("vrp_admin_ids")
-----------------------------------------------------------------------------------------------------------------------------------------
-- variavels de Configuração
-----------------------------------------------------------------------------------------------------------------------------------------
local distancia = 10
local mostraSeuID = true
-----------------------------------------------------------------------------------------------------------------------------------------
-- variavels de Função
-----------------------------------------------------------------------------------------------------------------------------------------
local players = {}
local admim= {}
-----------------------------------------------------------------------------------------------------------------------------------------
-- Esse loop cria um array (table) com as informações de ids - Se fizer direto no loop do DRAWTEXT ele tem um delay ao mostrar o id (fica piscando)
-----------------------------------------------------------------------------------------------------------------------------------------
Citizen.CreateThread(
function()
while true do
Citizen.Wait(1000)
for id = 0, 255 do
if NetworkIsPlayerActive(id) then
if GetPlayerPed(id) ~= PlayerId() then
local pid = SVIDclient.getId(GetPlayerServerId(id))
players[id] = pid
admim = SVIDclient.getPermissao()
end
end
end
end
end
)
-----------------------------------------------------------------------------------------------------------------------------------------
-- Esse Loop Print os ID's na Cabeça
-----------------------------------------------------------------------------------------------------------------------------------------
Citizen.CreateThread(
function()
while true do
Citizen.Wait(5)
if IsControlPressed(1,121) then
for _, id in ipairs(GetActivePlayers()) do
x1, y1, z1 = table.unpack( GetEntityCoords( PlayerPedId(), true ) )
x2, y2, z2 = table.unpack( GetEntityCoords( GetPlayerPed( id ), true ) )
distance = math.floor(GetDistanceBetweenCoords(x1, y1, z1, x2, y2, z2, true))
if admim and (PlayerPedId() ~= GetPlayerPed( id ) or mostraSeuID)then
if ((distance < distancia)) then
DrawText3D(x2, y2, z2+1, players[id], 255, 255, 255)
end
end
end
end
end
end
)
-----------------------------------------------------------------------------------------------------------------------------------------
-- cria o texto 3D
-----------------------------------------------------------------------------------------------------------------------------------------
function DrawText3D(x,y,z, text, r,g,b)
local onScreen,_x,_y=World3dToScreen2d(x,y,z)
local px,py,pz=table.unpack(GetGameplayCamCoords())
local dist = GetDistanceBetweenCoords(px,py,pz, x,y,z, 1)
local scale = (1/dist)*2
local fov = (1/GetGameplayCamFov())*100
local scale = scale*fov
if onScreen then
SetTextFont(0)
SetTextProportional(1)
SetTextScale(0.0, 0.55)
SetTextColour(r, g, b, 255)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(2, 0, 0, 0, 150)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
SetTextCentre(1)
AddTextComponentString(text)
DrawText(_x,_y)
end
end