-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.lua
43 lines (34 loc) · 866 Bytes
/
server.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
ESX.RegisterServerCallback("requestUserData", function(player, cb, identifier)
print(identifier)
print(ESX.GetPlayerFromId(player).identifier)
local xPlayer = ESX.GetPlayerFromIdentifier(identifier)
if not xPlayer then
return cb("Player not found!")
end
local userData = {
{ "Identifier", xPlayer.identifier },
{ "Steam Name", GetPlayerName(xPlayer.source) },
{ "Character Name", xPlayer.getName() },
}
for _, account in pairs(xPlayer.getAccounts()) do
table.insert(userData, {
account.label,
MONEY_UNIT:format(account.money)
})
end
local job = xPlayer.getJob()
table.insert(userData, {
"Job Name",
job.label,
})
table.insert(userData, {
"Job Grade",
job.grade_label,
})
table.insert(userData, {
"Job Salary",
MONEY_UNIT:format(job.grade_salary)
})
print(ESX.DumpTable(xPlayer.getJob()))
cb(_, userData)
end)