-
Notifications
You must be signed in to change notification settings - Fork 56
/
Conversion Manual.lua
348 lines (175 loc) · 11.8 KB
/
Conversion Manual.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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
---------Clientside functions---------
esx:onPlayerDeath -> hospital:server:SetDeathStatus
esx:playerLoaded -> QBCore:Client:OnPlayerLoaded (use for setting a variable to let the script know the player is ready)
esx:showAdvancedNotification -> QBCore:Notify
esx:showHelpNotification -> QBCore:Notify
esx:showNotification -> QBCore:Notify
ESX.GetPlayerData -> QBCore.Functions.GetPlayerData
ESX.IsPlayerLoaded -> None (checks if player is loaded so not relevant)
ESX.SetPlayerData -> QBCore:Player:SetPlayerData
ESX.TriggerServerCallback -> QBCore.Functions.TriggerCallback
ESX.Game.DeleteObject -> None (Can use FiveM native DeleteEntity)
ESX.Game.DeleteVehicle -> QBCore.Functions.DeleteVehicle
ESX.Game.GetClosestObject -> None (Can use FiveM native GetClosestObjectOfType)
ESX.Game.GetClosestPed -> QBCore.Functions.GetClosestPed
ESX.Game.GetClosestPlayer -> QBCore.Functions.GetClosestPlayer
ESX.Game.GetClosestVehicle -> QBCore.Functions.GetClosestVehicle
ESX.Game.GetObjects -> None (uses enumeration)
ESX.Game.GetPedMugshot -> None (Can use FiveM native RegisterPedheadshot)
ESX.Game.GetPeds -> None (uses enumeration)
ESX.Game.GetPlayers -> QBCore.Functions.GetPlayers
ESX.Game.GetPlayersInArea -> None (uses enumeration)
ESX.Game.GetVehicleInDirection -> None (uses ray casting)
ESX.Game.GetVehicles -> QBCore.Functions.GetVehicles
ESX.Game.GetVehiclesInArea -> None (uses enumeration)
ESX.Game.IsSpawnPointClear -> None (uses getvehiclesinarea)
ESX.Game.SetVehicleProperties -> QBCore.Functions.SetVehicleProperties
ESX.Game.SpawnLocalObject -> None (dont bother)
ESX.Game.SpawnLocalVehicle -> None (dont bother)
ESX.Game.SpawnObject -> None (Can use FiveM Native CreateObject)
ESX.Game.SpawnVehicle -> QBCore.Functions.SpawnVehicle
ESX.Game.Teleport -> (Can use FiveM Native SetEntityCoords and SetEntityHeading)
ESX.Game.Utils.DrawText3D -> QBCore.Functions.DrawText3D
There is no direct translation for replacing ESX.Streaming or ESX.Scaleform or ESX.UI
---------Serverside functions---------
QBCore.Functions.ExecuteSql = function(wait, query, cb)
QBCore.Functions.GetIdentifier = function(source, idtype)
QBCore.Functions.GetSource = function(identifier)
QBCore.Functions.GetPlayer = function(source)
QBCore.Functions.GetPlayerByCitizenId = function(citizenid)
QBCore.Functions.GetPlayerByPhone = function(number)
QBCore.Functions.GetPlayers = function()
QBCore.Functions.CreateCallback = function(name, cb)
QBCore.Functions.TriggerCallback = function(name, source, cb, ...)
QBCore.Functions.CreateUseableItem = function(item, cb)
QBCore.Functions.CanUseItem = function(item)
QBCore.Functions.UseItem = function(source, item)
QBCore.Functions.AddPermission = function(source, permission)
QBCore.Functions.RemovePermission = function(source)
QBCore.Functions.HasPermission = function(source, permission)
QBCore.Functions.GetPermission = function(source)
QBCore.Functions.IsPlayerBanned = function (source)
--------- Playerdata:Client Side---------
local xPlayer = QBCore.Functions.GetPlayerData() <-- Client is automatically the source so no need to specify
local citizenid = xPlayer.citizenid <-- See here i do NOT have to put "PlayerData"
--------- Playerdata:Server Side---------
local xPlayer = QBCore.Functions.GetPlayer(source) <-- Have to specify the source
local citizenid = xPlayer.PlayerData.citizenid <-- See here i DO have to put "PlayerData"
PlayerData.citizenid -> Returns player's citizen id
PlayerData.steam -> Returns player's steam id
PlayerData.license -> Returns player's rockstar id
PlayerData.name -> Returns player's name
PlayerData.cid -> Returns player's in-game id
PlayerData.money['cash'] -> Returns the player's cash amount
PlayerData.money['bank'] -> Returns the player's bank amount
PlayerData.charinfo -> Returns a table of the player's character info
PlayerData.charinfo.firstname -> Returns player's characters first name
PlayerData.charinfo.lastname -> Returns player's characters last name
PlayerData.charinfo.birthdate -> Returns player's characters birth date
PlayerData.charinfo.gender -> Returns player's characters gender
PlayerData.charinfo.nationality -> Returns player's characters nationality
PlayerData.charinfo.phone -> Returns player's characters phone number
PlayerData.charinfo.account -> Returns player's characters bank account number
PlayerData.metadata -> Returns a table of the player's metadata
PlayerData.metadata["hunger"] -> Returns player's hunger level
PlayerData.metadata["thirst"] -> Returns player's thirst level
PlayerData.metadata["stress"] -> Returns player's stress level
PlayerData.metadata["isdead"] -> Returns player's death status
PlayerData.metadata["inlaststand"] -> Returns player's last stand status
PlayerData.metadata["armor"] -> Returns player's armor level
PlayerData.metadata["ishandcuffed"] -> Returns player's handcuff status
PlayerData.metadata["tracker"] -> Returns if player is wearing a tracker
PlayerData.metadata["injail"] -> Returns player's jail status
PlayerData.metadata["jailitems"] -> Returns a table of the player's jail items
PlayerData.metadata["status"] -> Returns a table of the player's status
PlayerData.metadata["phone"] -> Returns a table of the player's phone data
PlayerData.metadata["fitbit"] -> Returns a table of the player's fitbit data
PlayerData.metadata["commandbinds"] -> Returns a table of the player's binds
PlayerData.metadata["bloodtype"] -> Returns the player's blood type
PlayerData.metadata["dealerrep"] -> Returns the player's dealer rep amount
PlayerData.metadata["craftingrep"] -> Returns the player's crafting rep amount
PlayerData.metadata["attachmentcraftingrep"] -> Returns the player's attachment crafting rep amount
PlayerData.metadata["currentapartment"] -> Returns the player's current apartment
playerData.metadata["jobrep"] -> Returns the player's job rep amount
PlayerData.metadata["callsign"] -> Returns the player's callsign
PlayerData.metadata["fingerprint"] -> Returns the player's fingerprint
PlayerData.metadata["walletid"] -> Returns the player's wallet id
PlayerData.metadata["criminalrecord"] -> Returns a table of the player's criminal record
PlayerData.metadata["licences"] -> Returns a table of the player's licenses
PlayerData.metadata["inside"] -> Returns a table of the player's inside info
PlayerData.metadata["phonedata"] -> Returns a table of the player's phone data (installed apps)
PlayerData.job -> Returns a table of the player's job info
PlayerData.job.name -> Returns the player's job name
PlayerData.job.label -> Returns the player's job label
PlayerData.job.payment -> Returns the player's job payment amount
PlayerData.job.onduty -> Returns the player's duty status
PlayerData.gang -> Returns a table of the player's gang info
PlayerData.gang.name -> Returns the player's gang name
PlayerData.gang.label -> Returns the player's gang label
PlayerData.position -> Returns the player's position
---------ESX TO QBCore CLIENTSIDE---------
esx:onPlayerDeath -> hospital:server:SetDeathStatus
esx:playerLoaded -> QBCore:Client:OnPlayerLoaded (use for setting a variable to let the script know the player is ready)
esx:showAdvancedNotification -> QBCore:Notify
esx:showHelpNotification -> QBCore:Notify
esx:showNotification -> QBCore:Notify
ESX.GetPlayerData -> QBCore.Functions.GetPlayerData
ESX.IsPlayerLoaded -> None (checks if player is loaded so not relevant)
ESX.SetPlayerData -> QBCore:Player:SetPlayerData
ESX.TriggerServerCallback -> QBCore.Functions.TriggerCallback
ESX.Game.DeleteObject -> None (Can use FiveM native DeleteEntity)
ESX.Game.DeleteVehicle -> QBCore.Functions.DeleteVehicle
ESX.Game.GetClosestObject -> None (Can use FiveM native GetClosestObjectOfType)
ESX.Game.GetClosestPed -> QBCore.Functions.GetClosestPed
ESX.Game.GetClosestPlayer -> QBCore.Functions.GetClosestPlayer
ESX.Game.GetClosestVehicle -> QBCore.Functions.GetClosestVehicle
ESX.Game.GetObjects -> None (uses enumeration)
ESX.Game.GetPedMugshot -> None (Can use FiveM native RegisterPedheadshot)
ESX.Game.GetPeds -> None (uses enumeration)
ESX.Game.GetPlayers -> QBCore.Functions.GetPlayers
ESX.Game.GetPlayersInArea -> None (uses enumeration)
ESX.Game.GetVehicleInDirection -> None (uses ray casting)
ESX.Game.GetVehicles -> QBCore.Functions.GetVehicles
ESX.Game.GetVehiclesInArea -> None (uses enumeration)
ESX.Game.IsSpawnPointClear -> None (uses getvehiclesinarea)
ESX.Game.SetVehicleProperties -> QBCore.Functions.SetVehicleProperties
ESX.Game.SpawnLocalObject -> None (dont bother)
ESX.Game.SpawnLocalVehicle -> None (dont bother)
ESX.Game.SpawnObject -> None (Can use FiveM Native CreateObject)
ESX.Game.SpawnVehicle -> QBCore.Functions.SpawnVehicle
ESX.Game.Teleport -> (Can use FiveM Native SetEntityCoords and SetEntityHeading)
ESX.Game.Utils.DrawText3D -> QBCore.Functions.DrawText3D
There is no direct translation for replacing ESX.Streaming or ESX.Scaleform or ESX.UI
---------Serverside---------
ESX.CreatePickup -> None (irrelevant and done through qb-inventory)
ESX.GetItemLabel -> None (Just returns item label)
ESX.GetPlayerFromId -> QBCore.Functions.GetPlayer
ESX.GetPlayerFromIdentifier -> QBCore.Functions.GetPlayerByCitizenId
ESX.GetPlayers -> QBCore.Functions.GetPlayers
ESX.RegisterServerCallback -> QBCore.Functions.CreateCallback
ESX.RegisterUsableItem -> QBCore.Functions.CreateUseableItem
ESX.SavePlayer -> QBCore.Player.Save
ESX.SavePlayers -> None (dont bother)
ESX.Trace -> Use QBCore.Debug but dont bother converting this
ESX.UseItem -> QBCore.Functions.UseItem
XPLAYER: xPlayer.removeWeaponComponent -> xPlayer.Functions.RemoveItem (component name)
xPlayer.setAccountMoney -> xPlayer.Functions.SetMoney (account)
xPlayer.setCoords -> None (used for teleporting)
xPlayer.setInventoryItem -> xPlayer.Functions.AddItem (item name)
xPlayer.setJob -> xPlayer.Functions.SetJob
xPlayer.setMaxWeight -> None (It is set in qb-core config)
xPlayer.setMoney -> xPlayer.Functions.SetMoney
xPlayer.setName -> None (dont bother)
xPlayer.setWeaponTint -> None (qb-weapons does this)
xPlayer.showHelpNotification -> TriggerClientEvent('QBCore:Notify')
xPlayer.showNotification -> TriggerClientEvent('QBCore:Notify')
xPlayer.triggerEvent -> None (dont bother)
xPlayer.updateCoords -> None (dont bother)
---------Events---------
esx:getSharedObject -> QBCore:GetObject
esx:setJob -> QBCore:Client:OnJobUpdate
esx:onPlayerSpawn -> QBCore:Client:OnPlayerLoaded
playerSpawned -> QBCore:Client:OnPlayerLoaded (spawnmanager compatibility)
esx:addInventoryItem -> QBCore:Server:AddItem
esx:removeInventoryItem -> QBCore:Server:RemoveItem
esx:useItem -> QBCore:Server:UseItem