Skip to main content
This documentation is for developers who are making scripts for VORP Core Framework

Exports


These exports are client side only!

Getters

get all user inventory items
return
table
returns a table containing all the items in the inventory
get user inventory item
string
name
the item name
return
table
returns a table containing the item name,label,weight,desc metadata, percentage
datae
string|table
the item name to get or an table of items to get in one single call, returns the data from items database like label,weight,desc,metadata etc
These exports are server side only!

Getters

get all user ammo
source
int
required
The player id
callback
function
callback function syncronous or asyncronous
return
table
returns a table containing all the ammo
check if player can carry weapons
source
int
required
The player id
amount
int
required
amount of weapons
callback
function
callback function syncronous or asyncronous
weaponName
string | number
weapon name or hash its needed to check weight since 3.6
return
boolean
returns true if the player can carry the weapons
get user inventory weapon
source
int
required
The player id
callback
function
callback function syncronous or asyncronous
weaponId
number
weapon id
return
table
{id:number,name:string,propietary:string,used:boolean,desc:string,group:number,source:number,label:string,serial_number:string,custom_label:string,custom_desc:string}
get user inventory weapons
source
int
required
The player id
callback
function
callback function syncronous or asyncronous
return
table
{id:number,name:string,propietary:string,used:boolean,desc:string,group:number,source:number,label:string,serial_number:string,custom_label:string,custom_desc:string}
get weapon bullets
source
int
required
The player id
weaponID
number
required
weapon id
callback
function
callback function syncronous or asyncronous
return
number
weapon ammo
get weapon components
source
int
required
The player id
weaponId
number
required
weapon id
callback
function
callback function syncronous or asyncronous
return
table
returns a table containing the weapon components

Setters

set weapon custom description
source
int
required
The player id
weaponId
number
required
weapon id
desc
string
required
weapon description
cb
function
callback function syncronous or asyncronous
return
boolean
returns true if the description was successfully set
set weapon custom label
source
int
required
The player id
weaponId
number
required
weapon id
label
string
required
weapon label
cb
function
callback function syncronous or asyncronous
return
boolean
returnstrue if the label was successfully set
set weapon serial number
source
int
required
The player id
weaponId
number
required
weapon id
serial
string
required
weapon serial number
cb
function
callback function syncronous or asyncronous
return
boolean
returns true if the serial number was successfully set
remove weapon from user inventory
source
int
required
The player id
weaponId
number
required
weapon id
callback
function
callback function syncronous or asyncronous
return
boolean
returns true if the weapon was successfully removed
give weapon to user
source
int
required
The player id
weaponId
number
required
weapon id
target
int
required
target id
callback
function
callback function syncronous or asyncronous
return
boolean
returns true if the weapon was successfully given
create weapon
source
int
required
The player id
weaponName
string
required
weapon name
ammo
string
required
amount of ammo
components
table
required
weapon components
comps
table
required
weapon components
callback
function
callback function syncronous or asyncronous
wepid
int
leave this as nil, this is used internally only
serial
string
custom serial number for weapon
label
string
custom label for weapon
desc
string
custom desc for weapons
return
boolean
if async
delete weapon
source
int
required
The player id
weaponId
number
required
weapon id
callback
function
callback function syncronous or asyncronous
return
boolean
if async
add bullets
source
int
required
The player id
bulletType
string
required
bullet type
amount
number
required
amount of bullets
callback
function
callback function syncronous or asyncronous
return
boolean
returns true if the bullets were successfully added
remove bullets from weapon
weaponId
number
required
weapon id
bulletType
string
required
bullet type
amount
number
required
amount of bullets
callback
function
callback function syncronous or asyncronous
return
boolean
returns true if the bullets were successfully removed
remove all user ammo
source
int
required
The player id
add a component to a weapon
source
int
required
The player id
weaponId
number
required
weapon id
component
string | number
required
component name or hash
category
string | number
required
slot category
callback
function
callback function syncronous or asyncronous
return
boolean
returns true if the component was successfully added
add multiple components to a weapon
source
int
required
The player id
weaponId
number
required
weapon id
components
table
required
a table where the key is the component name or hash and the value is the slot category { [component] = category }
callback
function
callback function syncronous or asyncronous
return
boolean
returns true if the components were successfully added
remove a component from a weapon
source
int
required
The player id
weaponId
number
required
weapon id
component
string | number
required
component name or hash
category
string | number
required
slot category
callback
function
callback function syncronous or asyncronous
return
boolean
returns true if the component was successfully removed
remove multiple components from a weapon
source
int
required
The player id
weaponId
number
required
weapon id
components
table
required
a table where the key is the component name or hash and the value is the slot category { [component] = category }
callback
function
callback function syncronous or asyncronous
return
boolean
returns true if the components were successfully removed

Events

Server Side only
Listen to when an item is used
Listen to when an item is created in player inventory
OnItemCreated
Listen to when an item is removed from player inventory
OnItemRemoved
Listen to when an item is taken from custom inventory
OnItemTakenFromCustomInventory
Listen to when an item is moved to custom inventory
OnItemMovedToCustomInventory
Listen for inventory state change (opens or closes) including custom inventories
OnInvStateChange
Block player inventory from server or client side
OnInvBlock server
OnInvBlock client
Client Side only
Listen to when a weapon is equipped
onWeaponEquipped
Listen to when a component is added to a weapon
componentAdded
Listen to when a component is removed from a weapon
componentRemoved

Statebags

contains data from the current weapon used in the inventory or last weapon used.
client side
GetEquippedWeaponData
server side
GetEquippedWeaponData
check if inventory is active (open or closed) including custom inventories
client side
IsInvActive
server side
IsInvActive

Global Statebags

returns timestamp from server to be used in client