DirkScripts Logo

Login With FiveM

Login

Server

lib.player.get

Get the player's information

lua
local player = lib.player.get(source)
Parameter TypeRequiredDescription
srcNumbertrueSource of the target

lib.player.identifier

Returns the identifier (CitizenID) of the player

lua
local citizenid = lib.player.identifier(src)
Parameter TypeRequiredDescription
srcNumbertrueSource of the target

lib.player.name

Returns the name of the character

lua
local firstName, lastName = lib.player.name(src)
Parameter TypeRequiredDescription
srcNumbertrueSource of the target

lib.player.phone_number

Return the phone number of the character

lua
local phoneNumber = lib.player.phone_number(src)
Parameter TypeRequiredDescription
srcNumbertrueSource of the target

lib.player.gender

Return the gender of the character

lua
local gender = lib.player.gender(src)
Parameter TypeRequiredDescription
srcNumbertrueSource of the target

lib.player.checkOnline

Check if a player is online by their CitizenID

lua
local isOnline = lib.player.checkOnline(identifier)
Parameter TypeRequiredDescription
identifierStringtrueIdentifier to be checked for

lib.player.jail

Send a player to jail

lua
lib.player.jail(trg, data)
Parameter TypeRequiredDescription
trgNumbertrueSource to be targeted
dataObjecttrueData to be used, for example time

lib.player.addMoney

Add money to a player

lua
lib.player.addMoney(src, acc, amount, reason)
Parameter TypeRequiredDescription
srcNumbertrueSource to be targeted
accStringtrueAccount to be deposited in
amountNumbertrueAmount to be moved
reasonStringtrueTransaction reason

lib.player.removeMoney

Remove money to a player

lua
lib.player.removeMoney(src, acc, amount, reason)
Parameter TypeRequiredDescription
srcNumbertrueSource to be targeted
accStringtrueAccount to be removed
amountNumbertrueAmount to be moved
reasonStringtrueTransaction reason

lib.player.addItem

Add item to a player

lua
lib.player.addItem(src, item, amount, md, slot)
Parameter TypeRequiredDescription
srcNumbertrueSource to be targeted
itemStringtrueItem spawncode
amountNumbertrueQuantity
mdObjectfalseMetadata for the item
slotNumberfalseSlot to be placed in, default is next available

lib.player.removeItem

Remove an item for a player

lua
lib.player.removeItem(src, item, amount, md, slot)
Parameter TypeRequiredDescription
srcNumbertrueSource to be targeted
itemStringtrueItem spawncode
amountNumbertrueQuantity
mdObjectfalseMetadata for the item
slotNumberfalseSlot to be placed in, default is next available

lib.player.editItem

Edit the metadata of an item

lua
lib.player.editItem(src, slot, new_data)
Parameter TypeRequiredDescription
srcNumbertrueSource to be targeted
slotNumbertrueItem slot to be targeted
new_dataObjecttrueData to be set

lib.player.getInventory

Returns the inventory of the player

lua
local inventory = lib.player.getInventory(src)

Example Return:

lua
{
    {
        name = "example",
        label = "Example Item",
        count = 10,
        info = {
            metadata = true,
        },
        slot = 1
    }
}
Parameter TypeRequiredDescription
srcNumbertrueSource to be targeted

Additional Functions

lib.player.deleteCharacter

Delete a character

lua
lib.player.deleteCharacter(src, citizenId)
ParameterTypeRequiredDescription
srcnumberyesPlayer source
citizenIdstringyesCharacter identifier to delete

lib.player.loginCharacter

Log into a character

lua
lib.player.loginCharacter(src, citizenId, newData)
ParameterTypeRequiredDescription
srcnumberyesPlayer source
citizenIdstringyesCharacter identifier
newDatatablenoAdditional data for login

lib.player.logoutCharacter

Log out of the current character

lua
lib.player.logoutCharacter(src, citizenId)

lib.player.createCharacter

Create a new character

lua
lib.player.createCharacter(src, data)
ParameterTypeRequiredDescription
srcnumberyesPlayer source
datatableyesCharacter creation data

lib.player.getCharacters

Get all characters for a player

lua
local characters = lib.player.getCharacters(src)

lib.player.getSkin

Get a player's skin/appearance data

lua
local skin = lib.player.getSkin(src)

lib.player.setJob

Set a player's job

lua
lib.player.setJob(src, job, rank)
ParameterTypeRequiredDescription
srcnumberyesPlayer source
jobstringyesJob name
ranknumberyesJob grade/rank

lib.player.getJob

Get a player's job data

lua
local job = lib.player.getJob(src)

lib.player.getGang

Get a player's gang data

lua
local gang = lib.player.getGang(src)

lib.player.setDuty

Set a player's duty status

lua
lib.player.setDuty(src, onDuty)

lib.player.setMoney

Set a player's account balance directly

lua
lib.player.setMoney(src, account, amount)

lib.player.getMoney

Get a player's balance for a specific account

lua
local amount = lib.player.getMoney(src, account)

lib.player.setPlayerData

Set arbitrary player data

lua
lib.player.setPlayerData(src, key, data)

lib.player.getPlayerData

Get player data, or a specific key

lua
local data = lib.player.getPlayerData(src, key)

lib.player.setMetadata

Set player metadata

lua
lib.player.setMetadata(src, key, data)

lib.player.getMetadata

Get player metadata

lua
local meta = lib.player.getMetadata(src, key)

lib.player.hasLicense

Check if a player has a license

lua
local has = lib.player.hasLicense(src, license)

lib.player.getLicenses

Get all player licenses

lua
local licenses = lib.player.getLicenses(src)

lib.player.hasGroup

Check if a player belongs to a group

lua
local has = lib.player.hasGroup(src, group)

lib.player.getIdentifierType

Get a specific identifier type for a player

lua
local id = lib.player.getIdentifierType(src, type)
ParameterTypeRequiredDescription
srcnumberyesPlayer source
typestringyesIdentifier type (e.g. "license", "discord", "steam")

Copyright © 2026 DirkScripts.

Not affiliated with or endorsed by Rockstar North, Take-Two Interactive, or any other rights holders. FiveM is a copyright and registered trademark of Take-Two Interactive Software, Inc.
Our checkout system is provided by Tebex Limited, who manage payment processing, product delivery, and billing support. Prices shown in currencies other than GBP are approximate conversions updated daily. All purchases are processed in GBP, so the final amount charged may vary depending on your bank or payment provider’s exchange rate.