mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-09-04 17:23:31 +00:00
Merge branch 'main' of https://github.com/qbcore-framework/qb-core
This commit is contained in:
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
while true do
|
while true do
|
||||||
Wait(0)
|
Wait(0)
|
||||||
if LocalPlayer.state['isLoggedIn'] then
|
if LocalPlayer.state.isLoggedIn then
|
||||||
Wait((1000 * 60) * QBCore.Config.UpdateInterval)
|
Wait((1000 * 60) * QBCore.Config.UpdateInterval)
|
||||||
TriggerServerEvent('QBCore:UpdatePlayer')
|
TriggerServerEvent('QBCore:UpdatePlayer')
|
||||||
end
|
end
|
||||||
@@ -11,7 +11,7 @@ end)
|
|||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
while true do
|
while true do
|
||||||
Wait(QBCore.Config.StatusInterval)
|
Wait(QBCore.Config.StatusInterval)
|
||||||
if LocalPlayer.state['isLoggedIn'] then
|
if LocalPlayer.state.isLoggedIn then
|
||||||
if QBCore.Functions.GetPlayerData().metadata['hunger'] <= 0 or
|
if QBCore.Functions.GetPlayerData().metadata['hunger'] <= 0 or
|
||||||
QBCore.Functions.GetPlayerData().metadata['thirst'] <= 0 then
|
QBCore.Functions.GetPlayerData().metadata['thirst'] <= 0 then
|
||||||
local ped = PlayerPedId()
|
local ped = PlayerPedId()
|
||||||
@@ -20,4 +20,4 @@ CreateThread(function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
+1
-1
@@ -214,7 +214,7 @@ end, 'user')
|
|||||||
|
|
||||||
-- Me command
|
-- Me command
|
||||||
|
|
||||||
QBCore.Commands.Add('me', 'Show local message', {name = 'message', help = 'Message to respond with'}, false, function(source, args)
|
QBCore.Commands.Add('me', 'Show local message', {{name = 'message', help = 'Message to respond with'}}, false, function(source, args)
|
||||||
local src = source
|
local src = source
|
||||||
local ped = GetPlayerPed(src)
|
local ped = GetPlayerPed(src)
|
||||||
local pCoords = GetEntityCoords(ped)
|
local pCoords = GetEntityCoords(ped)
|
||||||
|
|||||||
+7
-4
@@ -9,9 +9,9 @@ function QBCore.Player.Login(source, citizenid, newData)
|
|||||||
local src = source
|
local src = source
|
||||||
if src then
|
if src then
|
||||||
if citizenid then
|
if citizenid then
|
||||||
local result = exports.oxmysql:executeSync('SELECT * FROM players WHERE citizenid = ?', { citizenid })
|
local license = QBCore.Functions.GetIdentifier(src, 'license')
|
||||||
local PlayerData = result[1]
|
local PlayerData = exports.oxmysql:singleSync('SELECT * FROM players where citizenid = ?', { citizenid })
|
||||||
if PlayerData then
|
if PlayerData and license == PlayerData.license then
|
||||||
PlayerData.money = json.decode(PlayerData.money)
|
PlayerData.money = json.decode(PlayerData.money)
|
||||||
PlayerData.job = json.decode(PlayerData.job)
|
PlayerData.job = json.decode(PlayerData.job)
|
||||||
PlayerData.position = json.decode(PlayerData.position)
|
PlayerData.position = json.decode(PlayerData.position)
|
||||||
@@ -22,8 +22,11 @@ function QBCore.Player.Login(source, citizenid, newData)
|
|||||||
else
|
else
|
||||||
PlayerData.gang = {}
|
PlayerData.gang = {}
|
||||||
end
|
end
|
||||||
|
QBCore.Player.CheckPlayerData(src, PlayerData)
|
||||||
|
else
|
||||||
|
DropPlayer(src, 'You Have Been Kicked For Exploitation')
|
||||||
|
TriggerEvent('qb-log:server:CreateLog', 'anticheat', 'Anti-Cheat', 'white', GetPlayerName(src) .. ' Has Been Dropped For Character Joining Exploit', false)
|
||||||
end
|
end
|
||||||
QBCore.Player.CheckPlayerData(src, PlayerData)
|
|
||||||
else
|
else
|
||||||
QBCore.Player.CheckPlayerData(src, newData)
|
QBCore.Player.CheckPlayerData(src, newData)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user