ID_Card for ESX
Q:
"Hello, I bought the "id_card" script, but when I put it on my server, and I type the command "/createid" in the chat, nothing happens. Could you help me, for information my server is in ESX. Thanks in advance."
A:
**ESX**
config = {
openCommand = "showid",.
creatorCommand = "createid",
giveDistance = 4,
useStandalone = false,
useServerSide = true,
}
local ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
function getIdentity(source)
local xPlayer = ESX.GetPlayerFromId(source)
local identifier = xPlayer.getIdentifier()
local result = MySQL.query.await("SELECT firstname, lastname, dateOfBirth, sex FROM users WHERE identifier = ?", {xPlayer.identifier})
if result then
local firstName = result[1].firstname
local lastName = result[1].lastname
local dob = result[1].dateofbirth
local gender = result[1].sex
return firstName, lastName, dob, gender
end
end
Comments
Post a Comment