RP Starter
The RP Starter is GAMPEON’s own roleplay base. It gives a server characters, money, jobs, an inventory, a HUD and admin commands. Two bridges let resources written for ESX or QBCore run on it without changes, as long as they do not use GTA natives.
It is part of the GAMPEON SDK under starter/rp and licensed under MIT, so you can change it and ship it with your server. Ask the GAMPEON team for access while the SDK is not public yet. The design is in ADR 0028.
What it has
Section titled “What it has”- Characters: up to 4 per player account, chosen or created in a web page when the player joins, saved with their position.
- Money: the accounts
cash,bankandblack_money. ESX calls cashmoney; the bridges translate. - Jobs with grades, salary and a boss flag. Each grade pays its salary to
bankevery 10 minutes. - Inventory by weight (30 kg by default) with usable items.
- Callbacks from client to server, notifications and a HUD with cash, bank and job.
- Admin commands
setjob,givemoney,giveitemandcharinfoforgroup.admin. Everyone has/use <item>,/logoutand/inventory. - Saving with
MySQL.*, to SQLite or MariaDB: when a player leaves, every 60 seconds after changes and when the resource stops.
Jobs, items, start money and limits are Lua files in gampeon_rp/shared/. The server decides everything: clients get a copy of their character, and no client event can change money, jobs or items.
Start it
Section titled “Start it”gampeon-server --data starter/rpThe included server.cfg uses SQLite in data/rp.db and starts the core with both bridges:
set mysql_connection_string "sqlite:data/rp.db"add_ace group.admin command allowensure chatensure gampeon_rpensure es_extendedensure qb-coreStart only the bridges your resources need. On a game server, copy the [rp] folder into your resources folder.
ESX resources
Section titled “ESX resources”The es_extended bridge keeps the usual entry points:
shared_script '@es_extended/imports.lua'ESX.RegisterUsableItem('water', function(source) local xPlayer = ESX.GetPlayerFromId(source) if xPlayer.removeInventoryItem('water', 1) then xPlayer.showNotification('You drank some water.', 'success') endend)
ESX.RegisterServerCallback('myshop:wallet', function(source, cb) local xPlayer = ESX.GetPlayerFromId(source) cb(xPlayer.getMoney(), xPlayer.getAccount('bank').money)end)Covered: getSharedObject and esx:getSharedObject, @es_extended/imports.lua (keeps ESX.PlayerData current, calls OnPlayerData), @es_extended/locale.lua, GetPlayerFromId, GetPlayerFromIdentifier, GetExtendedPlayers, RegisterServerCallback, TriggerServerCallback, RegisterUsableItem, RegisterCommand with typed arguments, GetJobs, ShowNotification, and xPlayer with money, accounts, inventory, weight, job, metadata, set/get and coordinates. Events: esx:playerLoaded, esx:playerDropped, esx:setJob, esx:onAddInventoryItem, esx:onRemoveInventoryItem, and on the client esx:setAccountMoney, esx:addInventoryItem, esx:removeInventoryItem, esx:setPlayerData, esx:onPlayerLogout.
The identifier of an xPlayer is the character’s citizen ID.
QBCore resources
Section titled “QBCore resources”local QBCore = exports['qb-core']:GetCoreObject()
QBCore.Functions.CreateUseableItem('bread', function(source, item) local Player = QBCore.Functions.GetPlayer(source) if Player.Functions.RemoveItem(item.name, 1) then Player.Functions.SetMetaData('hunger', Player.PlayerData.metadata.hunger + 25) endend)Covered: GetCoreObject, QBCore.Functions (GetPlayer, GetPlayerByCitizenId, GetPlayers, GetQBPlayers, CreateCallback, TriggerCallback, CreateUseableItem, HasItem, Notify, HasPermission, GetPlayersOnDuty and more), Player.Functions for money, items, job, duty and metadata, PlayerData with charinfo, money, job, gang, metadata and items, QBCore.Commands.Add, QBCore.Shared.Items and Jobs, @qb-core/shared/locale.lua with Lang:t. Events: QBCore:Server:PlayerLoaded, QBCore:Server:OnPlayerUnload, QBCore:Server:OnJobUpdate, QBCore:Server:OnMoneyChange, and on the client QBCore:Client:OnPlayerLoaded, QBCore:Client:OnPlayerUnload, QBCore:Player:SetPlayerData, QBCore:Client:OnJobUpdate, QBCore:Client:SetDuty, QBCore:Notify.
From clients, the bridge accepts only using items, toggling duty, saving and setting hunger or thirst between 0 and 100.
Its own API
Section titled “Its own API”New resources can use the core directly, without a bridge:
local RP = exports.gampeon_rp:GetCoreObject()
RP.RegisterCallback('garage:fee', function(source, respond) return RP.RemoveMoney(source, 'bank', 50, 'garage')end)
AddEventHandler('gampeon_rp:playerLoaded', function(source, player, isNew) print(player.name, player.job.label, player.getMoney('cash'))end)The full list of functions and events is in the README of starter/rp.
Not yet
Section titled “Not yet”Gangs, weapons and loadouts, vehicles, slot inventories (QBCore items get slots in list order), ESX.UI menus, ESX.Game, Qbox exports (qbx_core), ox_lib and ox_inventory. The porting check lists every ESX and QBCore call in your resources that the bridges do not cover yet.