fuck
This commit is contained in:
1 parent
1d0255185d
commit
99f82095d7
7 files changed
+109
-143
No files matched your search
@@ -11,13 +11,15 @@ Framework.GetFrameworkName = function()
|
||||
end
|
||||
|
||||
Framework.GetPlayerDob = function(src)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
local dob = xPlayer.get("dateofbirth")
|
||||
return dob
|
||||
end
|
||||
|
||||
--- This will return a table of the players data
|
||||
---
|
||||
--- This table is in the framework format and not converted to any standard.
|
||||
---@param src any
|
||||
---@return table | nil
|
||||
Framework.GetPlayer = function(src)
|
||||
@@ -29,7 +31,7 @@ end
|
||||
-- Framework.GetPlayerIdentifier(src)
|
||||
-- Returns the citizen ID of the player.
|
||||
Framework.GetPlayerIdentifier = function(src)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
return xPlayer.getIdentifier()
|
||||
end
|
||||
@@ -41,7 +43,7 @@ end
|
||||
-- Framework.GetPlayerName(src)
|
||||
-- Returns the first and last name of the player.
|
||||
Framework.GetPlayerName = function(src)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
return xPlayer.variables.firstName, xPlayer.variables.lastName
|
||||
end
|
||||
@@ -61,7 +63,7 @@ end
|
||||
-- Returns a table of items matching the specified name and if passed metadata from the player's inventory.
|
||||
-- returns {name = v.name, count = v.amount, metadata = v.info, slot = v.slot}
|
||||
Framework.GetItem = function(src, item, _)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
local playerItems = xPlayer.getInventory()
|
||||
local repackedTable = {}
|
||||
@@ -81,7 +83,7 @@ end
|
||||
-- Framework.GetItemCount(src, item, _)
|
||||
-- Returns the count of items matching the specified name and if passed metadata from the player's inventory.
|
||||
Framework.GetItemCount = function(src, item, _)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
return xPlayer.getInventoryItem(item).count
|
||||
end
|
||||
@@ -99,7 +101,7 @@ end
|
||||
-- Returns the entire inventory of the player as a table.
|
||||
-- returns {name = v.name, count = v.amount, _, _}
|
||||
Framework.GetPlayerInventory = function(src)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
local playerItems = xPlayer.getInventory()
|
||||
local repackedTable = {}
|
||||
@@ -119,7 +121,7 @@ end
|
||||
-- Framework.SetMetadata(src, metadata, value)
|
||||
-- Adds the specified metadata key and number value to the player's data.
|
||||
Framework.SetPlayerMetadata = function(src, metadata, value)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
xPlayer.setMeta(metadata, value, nil)
|
||||
return true
|
||||
@@ -128,7 +130,7 @@ end
|
||||
-- Framework.GetMetadata(src, metadata)
|
||||
-- Gets the specified metadata key and value to the player's data.
|
||||
Framework.GetPlayerMetadata = function(src, metadata)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
return xPlayer.getMeta(metadata) or false
|
||||
end
|
||||
@@ -139,13 +141,13 @@ end
|
||||
-- skin, status, is_dead, id, disabled, last_property, created_at, last_seen,
|
||||
-- phone_number, pincode
|
||||
Framework.GetStatus = function(src, column)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
return xPlayer.get(column) or nil
|
||||
end
|
||||
|
||||
Framework.GetIsPlayerDead = function(src)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
return xPlayer.get("is_dead") or false
|
||||
end
|
||||
@@ -190,7 +192,7 @@ end
|
||||
-- Framework.GetPlayerPhone(src)
|
||||
-- Returns the phone number of the player.
|
||||
Framework.GetPlayerPhone = function(src)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
return xPlayer.get("phone_number")
|
||||
end
|
||||
@@ -203,7 +205,7 @@ end
|
||||
---@return string | nil
|
||||
---@return string | nil
|
||||
Framework.GetPlayerJob = function(src)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
local job = xPlayer.getJob()
|
||||
return job.name, job.label, job.grade_label, job.grade
|
||||
@@ -213,7 +215,7 @@ end
|
||||
---@param src number
|
||||
---@return boolean
|
||||
Framework.GetPlayerDuty = function(src)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return false end
|
||||
local job = xPlayer.getJob()
|
||||
if not job.onDuty then return false end
|
||||
@@ -225,7 +227,7 @@ end
|
||||
---@param dutystatus boolean
|
||||
---@return boolean
|
||||
Framework.SetPlayerDuty = function(src, dutystatus)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return false end
|
||||
local job = xPlayer.getJob()
|
||||
if not job.onDuty then return false end
|
||||
@@ -238,7 +240,7 @@ Framework.GetPlayersByJob = function(job)
|
||||
local players = GetPlayers()
|
||||
local playerList = {}
|
||||
for _, src in pairs(players) do
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if xPlayer.getJob().name == job then
|
||||
table.insert(playerList, src)
|
||||
end
|
||||
@@ -249,7 +251,7 @@ end
|
||||
-- Framework.SetPlayerJob(src, name, grade)
|
||||
-- Sets the player's job to the specified name and grade.
|
||||
Framework.SetPlayerJob = function(src, name, grade)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
if not ESX.DoesJobExist(name, grade) then
|
||||
Prints.Error("Job Does Not Exsist In Framework :NAME " .. name .. " Grade:" .. grade)
|
||||
@@ -261,7 +263,7 @@ end
|
||||
-- Framework.AddAccountBalance(src, _type, amount)
|
||||
-- Adds the specified amount to the player's account balance of the specified type.
|
||||
Framework.AddAccountBalance = function(src, _type, amount)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
if _type == 'cash' then _type = 'money' end
|
||||
return xPlayer.addAccountMoney(_type, amount)
|
||||
@@ -270,7 +272,7 @@ end
|
||||
-- Framework.RemoveAccountBalance(src, _type, amount)
|
||||
-- Removes the specified amount from the player's account balance of the specified type.
|
||||
Framework.RemoveAccountBalance = function(src, _type, amount)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
if _type == 'cash' then _type = 'money' end
|
||||
xPlayer.removeAccountMoney(_type, amount)
|
||||
@@ -280,7 +282,7 @@ end
|
||||
-- Framework.GetAccountBalance(src, _type)
|
||||
-- Returns the player's account balance of the specified type.
|
||||
Framework.GetAccountBalance = function(src, _type)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
if _type == 'cash' then _type = 'money' end
|
||||
return xPlayer.getAccount(_type).money
|
||||
@@ -289,7 +291,7 @@ end
|
||||
-- Framework.AddItem(src, item, amount, _, _)
|
||||
-- Adds the specified item to the player's inventory.
|
||||
Framework.AddItem = function(src, item, amount, slot, metadata)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
return xPlayer.addInventoryItem(item, amount)
|
||||
end
|
||||
@@ -297,7 +299,7 @@ end
|
||||
-- Framework.RemoveItem(src, item, amount, _, _)
|
||||
-- Removes the specified item from the player's inventory.
|
||||
Framework.RemoveItem = function(src, item, amount, slot, metadata)
|
||||
local xPlayer = ESX.GetPlayerFromId(src)
|
||||
local xPlayer = Framework.GetPlayer(src)
|
||||
if not xPlayer then return end
|
||||
return xPlayer.removeInventoryItem(item, amount)
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user