Server
Helpful functions for the player data structure and functions
lib.player.get
Get the player's information
local player = lib.player.get(source)
src
Source of the target
lib.player.identifier
Returns the identifier (CitizenID) of the player
local citizenid = lib.player.identifier(src)
src
Source of the target
lib.player.name
Returns the name of the character
local firstName, lastName = lib.player.name(src)
src
Source of the target
lib.player.phone_number
Return the phone number of the character
local phoneNumber = lib.player.phone_number(src)
src
Source of the target
lib.player.gender
Return the gender of the character
local gender = lib.player.gender(src)
src
Source of the target
lib.player.checkOnline
Check if a player is online by their CitizenID
local isOnline = lib.player.checkOnline(identifier)
identifier
Identifier to be checked for
lib.player.jail
Send a player to jail
lib.player.jail(trg, data)
trg
Source to be targeted
data
Data to be used, for example time
lib.player.addMoney
Add money to a player
lib.player.addMoney(src, acc, amount, reason)
src
Source to be targeted
acc
Account to be deposited in
amount
Amount to be moved
reason
Transaction reason
lib.player.removeMoney
Remove money to a player
lib.player.removeMoney(src, acc, amount, reason)
src
Source to be targeted
acc
Account to be removed
amount
Amount to be moved
reason
Transaction reason
lib.player.addItem
Add item to a player
lib.player.addItem(src, item, amount, md, slot)
src
Source to be targeted
item
Item spawncode
amount
Quantity
md
Metadata for the item
slot
Slot to be placed in, default is next available
lib.player.removeItem
Remove an item for a player
lib.player.removeItem(src, item, amount, md, slot)
src
Source to be targeted
item
Item spawncode
amount
Quantity
md
Metadata for the item
slot
Slot to be placed in, default is next available
lib.player.editItem
Edit the metadata of an item
lib.player.editItem(src, slot, new_data)
src
Source to be targeted
slot
Item slot to be targeted
new_data
Data to be set
lib.player.getInventory
Returns the inventory of the player
local inventory = lib.player.getInventory(src)
Example Return:
{
{
name = "example",
label = "Example Item",
count = 10,
info = {
metadata = true,
},
slot = 1
}
}
src
Source to be targeted
Last updated