mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-28 23:01:29 +00:00
@@ -152,7 +152,7 @@ QBCore.Functions.AddPermission = function(source, permission)
|
|||||||
}
|
}
|
||||||
exports.oxmysql:execute('DELETE FROM permissions WHERE license = ?', { QBCore.Functions.GetIdentifier(source, 'license') })
|
exports.oxmysql:execute('DELETE FROM permissions WHERE license = ?', { QBCore.Functions.GetIdentifier(source, 'license') })
|
||||||
|
|
||||||
exports.oxmysql:insert('INSERT INTO permissions (name, license, permission) VALUES (?)', {
|
exports.oxmysql:insert('INSERT INTO permissions (name, license, permission) VALUES (?, ?, ?)', {
|
||||||
GetPlayerName(source),
|
GetPlayerName(source),
|
||||||
QBCore.Functions.GetIdentifier(source, 'license'),
|
QBCore.Functions.GetIdentifier(source, 'license'),
|
||||||
permission:lower()
|
permission:lower()
|
||||||
|
|||||||
+1
-1
@@ -442,7 +442,7 @@ QBCore.Player.Save = function(source)
|
|||||||
-- TODO: Merge these 3 queries into 1 with an on duplicate (citizenid isn't primary so https://stackoverflow.com/a/33495408/3200040 might need to be used)
|
-- TODO: Merge these 3 queries into 1 with an on duplicate (citizenid isn't primary so https://stackoverflow.com/a/33495408/3200040 might need to be used)
|
||||||
local result = exports.oxmysql:fetchSync('SELECT * FROM players WHERE citizenid = ?', { PlayerData.citizenid })
|
local result = exports.oxmysql:fetchSync('SELECT * FROM players WHERE citizenid = ?', { PlayerData.citizenid })
|
||||||
if result[1] == nil then
|
if result[1] == nil then
|
||||||
exports.oxmysql:insert('INSERT INTO players (citizenid, cid, license, name, money, charinfo, job, gang, position, metadata) VALUES (?)', {
|
exports.oxmysql:insert('INSERT INTO players (citizenid, cid, license, name, money, charinfo, job, gang, position, metadata) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', {
|
||||||
PlayerData.citizenid,
|
PlayerData.citizenid,
|
||||||
tonumber(PlayerData.cid),
|
tonumber(PlayerData.cid),
|
||||||
PlayerData.license,
|
PlayerData.license,
|
||||||
|
|||||||
Reference in New Issue
Block a user