-
Notifications
You must be signed in to change notification settings - Fork 0
/
readme.txt
98 lines (82 loc) · 4.25 KB
/
readme.txt
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
+-------------------------------------------------------+
|███████╗██╗███████╗██╗ ██╗██╗ ██╗██╗ ██╗███████╗|
|██╔════╝██║██╔════╝██║ ██║██║ ██║██║ ██║██╔════╝|
|███████╗██║█████╗ ██║ ██║███████║██║ ██║███████╗|
|╚════██║██║██╔══╝ ██║ ██║██╔══██║██║ ██║╚════██║|
|███████║██║██║ ╚██████╔╝██║ ██║███████╗██║███████║|
|╚══════╝╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝╚══════╝|
+-------------------------------------------------------+
Welcome to the readme part of the SifuhlisFakeID script for QBCore!
Dependencies:
- QBCore Framework
- Ox_lib
- qb-idcard (https://github.com/itsHyper/qb-idcard)
Installation!
drag and drop this script into your resources and make sure you
"ensure SifuhlisFakeID" in the server.cfg
(Or if you have a dedicated [scripts] folder that is already ensured in the server.cfg, you can drag it to that folder)
Go to the following in qb-idcard > server > server.lua
look for
-----------------------------------------------
local ShowId = function(source, item, nui)
local src = source
local found = false
local character = QBCore.Functions.GetPlayer(src)
local PlayerPed = GetPlayerPed(src)
local PlayerCoords = GetEntityCoords(PlayerPed)
local info = {
['name'] = item.info.firstname,
['lastname'] = item.info.lastname,
['gender'] = item.info.gender,
['dob'] = item.info.birthdate,
['nationality'] = item.info.nationality,
['type'] = item.info.type
}
for k, v in pairs(QBCore.Functions.GetPlayers()) do
local TargetPed = GetPlayerPed(v)
local dist = #(PlayerCoords - GetEntityCoords(TargetPed))
if dist < 3.0 and PlayerPed ~= TargetPed then
TriggerClientEvent('QBCore:Notify', src, "You showed your idcard")
TriggerClientEvent('qb-idcard:client:open', v, info, nui)
found = true
break
end
end
if not found then TriggerClientEvent('qb-idcard:client:open', src, info, nui) end
if nui == 'policecard' then TriggerClientEvent('qb-idcard:client:policebadgeanim', src) end
end
and change it with
local ShowId = function(source, item, nui)
local src = source
local found = false
local character = QBCore.Functions.GetPlayer(src)
local PlayerPed = GetPlayerPed(src)
local PlayerCoords = GetEntityCoords(PlayerPed)
-- Use the custom data if available; otherwise, fall back on player data
local info = {
['name'] = item.info.firstname or character.PlayerData.charinfo.firstname,
['lastname'] = item.info.lastname or character.PlayerData.charinfo.lastname,
['gender'] = item.info.gender or character.PlayerData.charinfo.gender,
['dob'] = item.info.birthdate or character.PlayerData.charinfo.birthdate,
['nationality'] = item.info.nationality or character.PlayerData.charinfo.nationality,
['type'] = item.info.type or "ID Card"
}
for k, v in pairs(QBCore.Functions.GetPlayers()) do
local TargetPed = GetPlayerPed(v)
local dist = #(PlayerCoords - GetEntityCoords(TargetPed))
if dist < 3.0 and PlayerPed ~= TargetPed then
TriggerClientEvent('QBCore:Notify', src, "You showed your ID card")
TriggerClientEvent('qb-idcard:client:open', v, info, nui)
found = true
break
end
end
if not found then
TriggerClientEvent('qb-idcard:client:open', src, info, nui)
end
if nui == 'policecard' then
TriggerClientEvent('qb-idcard:client:policebadgeanim', src)
end
end
-----------------------------------------------
Make sure you also check the config! Set it to what you want really! :3