Functions
make sure to import the lib in your manifest otherwise none of these functions will work.
local Renewed = exports['Renewed-Lib']:getLib()
getGroups()
Returns a table containing the source's job(s) and/or gang(s)
Renewed.getGroups(src)
- src:
int
Return:
- groups:
table
{
Group = {
['mechanic'] = 4,
['ballas'] = 2
},
job = 'mechanic',
gang = 'ballas',
charId = 'QB245361',
name = 'Test Player'
}
hasGroup()
Checks if a player has a specific group with an optional minimum grade
Renewed.hasGroup(src, group, grade)
- src:
int
- group:
string
- grade?:
int
Return:
boolean
getPlayer()
Retrieves the player object associated with the given source
Renewed.getPlayer(src)
- src:
int
Return:
- player:
table|nil
addStress()
Adds stress to a player
Renewed.addStress(src, value)
- src:
int
- value:
int
Renewed.addStress(-1, 5)
relieveStress()
Relieve stress for a player
Renewed.relieveStress(src, value)
- src:
int
- value:
int
Renewed.relieveStress(-1, 5)
isGroupAuth()
Check if a player has group authorization
Renewed.isGroupAuth(group, grade)
- group:
string
- grade:
int
Return:
- Boolean
getCharId()
Get the character ID of a player
Renewed.getCharId(src)
- src:
int
Return:
- charId:
string
getCharName()
Get the character name of a player
Renewed.getCharName(src)
- src:
int
Return:
- charName:
string
getCharNameById()
Get the character name by citizen id
Renewed.getCharNameById(identifier)
- identifier:
string
orint
Return:
- characterName:
string
getMoney()
Get the player's money
Renewed.getMoney(src, mType)
- src:
int
- mType:
string
Return:
- money:
int
ornil
getOfflineMoney()
Get the money of an offline player
Renewed.getOfflineMoney(id)
Return:
- money:
{bank, cash}
removeMoney()
Remove money from a player
Renewed.removeMoney(src, amount, mType, reason)
- src:
int
- amount:
int
- mType:
string
- reason?:
string
Return:
true
on success
addMoney()
Add money to a player
Renewed.addMoney(src, amount, mType, reason)
- src:
int
- amount:
int
- mType:
string
- reason?:
string
Return:
true
on success
addOfflineMoney()
Add money to an offline player
Renewed.addOfflineMoney(identifier, amount, mType)
- identifier:
string
orint
- amount:
int
- mType:
string
Return:
true
on success
removeOfflineMoney()
Remove money to an offline player
Renewed.removeOfflineMoney(identifier, amount, mType)
- identifier:
string
orint
- amount:
int
- mType:
string
Return:
true
on success
addNeeds()
Add needs (hunger and thirst) to a player
Renewed.addNeeds(src, needs)
- src:
int
- needs:
table
- hunger?:
int
- thirst?:
int
- hunger?:
Return:
true
on success
getSourceByCharId()
Get the player's source ID by character ID
Renewed.getSourceByCharId(charId)
- charId:
string
Return:
- src:
int
ornil