-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathclient.lua
35 lines (30 loc) · 863 Bytes
/
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
local function SendReactMessage(action, data)
SendNUIMessage({action = action, data = data})
end
local function toggleNuiFrame(shouldShow)
SetNuiFocus(shouldShow, shouldShow)
SendReactMessage('setVisible', shouldShow)
end
local function ShowIDCard(data)
/*
Data structure (table):
firstName: string,
lastName: string,
dob: string,
sex: string ('m' or 'f', not case sensitive),
exp: string,
cref: string,
class: string,
pref: string,
*/
print(json.encode(data))
toggleNuiFrame(true)
SendReactMessage('openIDCard', data)
end
exports('ShowIDCard', ShowIDCard)
RegisterNetEvent('identity:client:showIdCard')
AddEventHandler('identity:client:showIdCard', ShowIDCard)
RegisterNUICallback('hideFrame', function(_, cb)
toggleNuiFrame(false)
cb({})
end)