-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.lua
More file actions
117 lines (104 loc) · 3.56 KB
/
client.lua
File metadata and controls
117 lines (104 loc) · 3.56 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
--[[
CREDITS:
CREATED BY RHYS19
Proximity and players in pursuit by Xander1998
--]]
RegisterNetEvent('AdminScript:NoPerms')
AddEventHandler('AdminScript:NoPerms', function()
TriggerEvent("chatMessage", "Admin Script", {255, 0, 0}, "Insufficient Permissions to run command.")
end)
local admins = {}
RegisterNetEvent("adminpursuit:AddAdmin")
AddEventHandler("adminpursuit:AddAdmin", function(playerID)
table.insert(admins, playerID)
end)
RegisterNetEvent("adminpursuit:RemoveAdmin")
AddEventHandler("adminpursuit:RemoveAdmin", function(playerID)
local index = nil
for a = 1, #admins do
if admins[a] == playerID then
index = a
end
end
if index ~= nil then
table.remove(admins, index)
end
end)
Citizen.CreateThread(function()
while true do
for a = 1, #admins do
-- Local Player
local lPlayer = PlayerId()
local lPlayerPed = GetPlayerPed(lPlayer)
local lPlayerPedPos = GetEntityCoords(lPlayerPed, false)
-- Admin Player
local oPlayer = GetPlayerFromServerId(admins[a])
local oPlayerPed = GetPlayerPed(oPlayer)
local oPlayerPedPos = GetEntityCoords(oPlayerPed, false)
if GetPlayerServerId(lPlayer) == admins[a] then
local distance = Vdist(lPlayerPedPos.x, lPlayerPedPos.y, lPlayerPedPos.z, oPlayerPedPos.x, oPlayerPedPos.y, oPlayerPedPos.z)
if distance < 75.0 then
DrawText5("~g~Priorities Are On Hold")
DrawText2("~r~ ADMIN PURSUIT NEARBY")
DrawText3("~y~ Pull over, and stop what you are doing!")
local pursuitCount = 0
for b = 1, #admins do
if admins[a] then
pursuitCount = pursuitCount + 1
end
end
DrawText4("~o~ There is currently " .. tostring(pursuitCount) .. " Admin(s) in pursuit!")
end
end
end
Citizen.Wait(0)
end
end)
function DrawText2(text)
SetTextFont(0)
SetTextProportional(1)
SetTextScale(0.0, 0.85)
SetTextDropshadow(1, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(0.299, 0.0)
end
function DrawText3(text)
SetTextFont(0)
SetTextProportional(1)
SetTextScale(2.2, 0.45)
SetTextDropshadow(2, 2, 2, 2, 2)
SetTextEdge(0, 0, 0, 0, 55)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(0.345, 0.055)
end
function DrawText4(text)
SetTextFont(0)
SetTextProportional(1)
SetTextScale(0.0, 0.45)
SetTextDropshadow(1, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(0.345, 0.088)
end
function DrawText5(text)
SetTextFont(0)
SetTextProportional(1)
SetTextScale(0.0, 0.45)
SetTextDropshadow(1, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
AddTextComponentString(text)
DrawText(0.399, 0.122)
end