frp_core
An experimental framework for RedM. Limited support and breaking changes guaranteed.
This resource is now in a stable (v1.0) release; breaking changes are unlikely. Documentation is kept updated.
Installation
- Download a release or build the source code
git clone https://github.com/faroeste-roleplay/frp_core.git - Install optional dependencies.
These resources aren't required but provide additional functionality.
Tunnel & Proxy System
The API utilizes a modified vRP-style Tunnel and Proxy system for inter-resource communication:
Tunnel: Provides two-way communication between server and clients with async support
Proxy: Enables function calls between different resources on the same side
Basic Usage
To enable the library inside of your resource just add @frp_lib/library/linker.lua as a shared_script in your fxmanifest.lua file.
shared_scripts {
'@frp_lib/library/linker.lua',
}Or if the library is the only shared script you use you can do:
shared_script '@frp_lib/library/linker.lua'server-side
-- Import the API using Proxy
local API = Proxy.getInterface("API")
-- Or using Tunnel for client-server communication
local cAPI = Tunnel.getInterface("API")client-side
-- Import the API using Proxy
local cAPI = Proxy.getInterface("API")
-- Or using Tunnel for server-client communication
local API = Tunnel.getInterface("API")Last updated