This documentation is for developers who are making scripts for vorp core framework

Export

GetCore is a shared export that returns the core table containing all the getters and setters for vorp core. some of the getters and setters are client side only and some are server side only.

Shared

Notifications

notifications can also accept -1 as duration to always stay on screen and to clear them you need to use UiFeedClearChannel

Shared

Characters

Get the character data to access getters and setters

Server

Users

Get the user data to access getters and setters

Whitelist

Server

Webhooks

Shared

Instancing

Client

to add a players to different instances use his server id + instance number to add players to same instance use only the instanceNumber

local instanceNumber = 54123 -- any number
VORPcore.instancePlayers(GetPlayerServerId(PlayerId())+ instanceNumber)

remove players from instance

VORPcore.instancePlayers(0)

Player

Available through core export

Server Side
when using these functions you will benefit of the event listeners OnPlayerDeath OnPlayerRevive OnPlayerRespawn

Callbacks

Callbacks are available through core export or single exports

if you need only the call back system

local ServerRPC = exports.vorp_core:ServerRpcCall() --[[@as ServerRPC]] -- for intellisense

Events

Event Listeners to detect changes in the player state

when player job and group changes these events are triggered

Server Side

onGroupChange

AddEventHandler("vorp:playerGroupChange",function(source, newgroup,oldgroup) end)

onJobChange

AddEventHandler("vorp:playerJobChange", function(source, newjob,oldjob) end)

onJobGradeChange

AddEventHandler("vorp:playerJobGradeChange",function(source, newjobgrade,oldjobgrade) end)

onPlayerDeath

when player dies this event is triggered

--CLIENT
AddEventHandler("vorp_core:Client:OnPlayerDeath",function(killerserverid,causeofdeath) end)

--SERVER
RegisterNetEvent("vorp_core:Server:OnPlayerDeath",function(killerserverid,causeofdeath) end)

onPlayerRevive

when player is revived through vorp core export this event will trigger

--SERVER
AddEventHandler("vorp_core:Server:OnPlayerRevive",function(source)end)

--CLIENT
RegisterNetEvent("vorp_core:Client:OnPlayerRevive")

onPlayerRespawn

when player respawns through vorp core export this event will trigger

--SERVER
AddEventHandler("vorp_core:Server:OnPlayerRespawn"function(source)end)

--CLIENT
RegisterNetEvent("vorp_core:Client:OnPlayerRespawn")

onPlayerHeal

when player is healed through vorp core export this event will trigger

--SERVER
AddEventHandler("vorp_core:Server:OnPlayerHeal",function(source) end)
--CLIENT
RegisterNetEvent("vorp_core:Client:OnPlayerHeal")

Dataview

call dataview in your script fxmanifest

 client_scripts {
    '@vorp_core/client/dataview.lua'
 }

GlobalStates

  • easily get players count from client or server
GlobalState.PlayersInSession

Statebags

statebag getters that allow you to get the character data

Shared

Version

Use vorp version check with change logs feature in your scripts

add this in your fxmanifest

-- version must match version.file
version '0.0.1'
vorp_checker 'yes'
-- can use color codes ^1
vorp_name '^5your resource name ^4version Check^3' 
-- path to the github repository, in here it must have a version.file file type where your change logs will be, also must be public repository
vorp_github 'https://github.com/repository/resource_name' 

example of a version.file

<0.0.1> -- version must be the same in fxmanifest
- new version
- added feature
- removed feature
- fixed something