-
Notifications
You must be signed in to change notification settings - Fork 13
/
client.lua
67 lines (58 loc) · 2.05 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
------------------------------------
--- Police Backup, Made by FAXES ---
------------------------------------
--- CONFIG ---
local leoPeds = {
"s_m_y_cop_01",
}
--------------------------------------------------------------------------------------------------------
function checkPed(ped, PedList)
for i = 1, #PedList do
if GetHashKey(PedList[i]) == GetEntityModel(ped) then
return true
end
end
return false
end
function ShowInfo(text)
SetNotificationTextEntry("STRING")
AddTextComponentString(text)
DrawNotification(false, false)
end
function playCode99Sound()
PlaySoundFrontend(-1, "TIMER_STOP", "HUD_MINI_GAME_SOUNDSET", 1)
Wait(900)
PlaySoundFrontend(-1, "TIMER_STOP", "HUD_MINI_GAME_SOUNDSET", 1)
Wait(900)
PlaySoundFrontend(-1, "TIMER_STOP", "HUD_MINI_GAME_SOUNDSET", 1)
end
RegisterNetEvent('Fax:ShowInfo')
AddEventHandler('Fax:ShowInfo', function(notetext)
ShowInfo(notetext)
end)
RegisterNetEvent('Fax:BackupReq')
AddEventHandler('Fax:BackupReq', function(bk, s)
local src = s
local bkLvl = bk
local bkLvlTxt = "N/A"
local coords = GetEntityCoords(GetPlayerPed(GetPlayerFromServerId(src)))
local street1 = GetStreetNameAtCoord(coords.x, coords.y, coords.z, Citizen.ResultAsInteger(), Citizen.ResultAsInteger())
local streetName = (GetStreetNameFromHashKey(street1))
if checkPed(GetPlayerPed(PlayerId()), leoPeds) then
if bkLvl == "1" then
bkLvlTxt = "~b~code 1"
elseif bkLvl == "2" then
bkLvlTxt = "~y~code 2"
elseif bkLvl == "3" then
bkLvlTxt = "~r~CODE 3"
PlaySoundFrontend(-1, "Mission_Pass_Notify", "DLC_HEISTS_GENERAL_FRONTEND_SOUNDS", 1)
elseif bkLvl == "99" then
bkLvlTxt = "~r~~h~CODE 99"
end
ShowInfo("An officer is in need of assistance " .. bkLvlTxt .. "~s~. ~o~Location: ~s~" .. streetName .. ".")
SetNewWaypoint(coords.x, coords.y)
if bkLvl == "99" then
playCode99Sound()
end
end
end)