Retro Graffiti
This section contains core flows and integration entry points.
General Usage
Section titled โGeneral UsageโSession pattern:
- Start spray session.
- Place panel.
- Focus in editor.
- Send layer updates.
- Finalize or discard.
Server Owner Integration
Section titled โServer Owner IntegrationโThis section is for server-side integration only (framework/inventory/gang permissions).
Bridge Files You Can Edit
Section titled โBridge Files You Can EditโIf your server uses a different framework, inventory, progress bar, or notify system, edit these first:
bridge/server.lua
- Framework identity/admin checks
- Inventory add/remove/has item
- Usable item registrations
- Gang integration hooks:
Bridge.GetGangInfo(src),Bridge.IsGangLeader(src, gangInfo)
bridge/client.lua
- Progressbar adapter
- Notification adapter
Keep core gameplay files unchanged where possible and override behavior through bridge adapters.
Gang Logic In Bridge (Recommended)
Section titled โGang Logic In Bridge (Recommended)โPrimary extension point is bridge/server.lua.
Edit these functions for your server:
Bridge.GetGangInfo(src)
- Return
nilif no gang - Return
{ name, label?, isboss?, grade = { level = number }? }when in gang
Bridge.IsGangLeader(src, gangInfo)
- Return
true/falsefor leader status used by gang preset permissions
Server Exports (Gang Integration)
Section titled โServer Exports (Gang Integration)โUse these exports to hook rs_graff into an existing gang framework without editing core files.
Export: ConfigureGangProvider
Section titled โExport: ConfigureGangProviderโRegisters an external provider resource that resolves player gang + leader status.
exports['rs_graff']:ConfigureGangProvider('my_gangs', 'GetPlayerGang', 'IsGangLeader')Expected provider exports:
GetPlayerGang(src)->table|string|nilIsGangLeader(src, gangName)->boolean(optional, fallback uses grade/boss flags)
Supported gang object fields:
name(required)label(optional)isboss/isBoss/leader(optional bool)grade.levelorgradeLevel/rank(optional number)
Disable external provider and fall back to built-in QB gang lookup:
exports['rs_graff']:ConfigureGangProvider('')Export: GetGangProvider
Section titled โExport: GetGangProviderโReturns current provider config:
local provider = exports['rs_graff']:GetGangProvider()-- { resource = 'my_gangs', getGangExport = 'GetPlayerGang', isLeaderExport = 'IsGangLeader' }Export: GetPlayerGang
Section titled โExport: GetPlayerGangโReturns normalized gang info for a player:
local gang = exports['rs_graff']:GetPlayerGang(source)-- gang = { name = 'ballas', label = 'Ballas', isboss = false, grade = { level = 2 } }Export: IsGangLeader
Section titled โExport: IsGangLeaderโChecks gang leadership for preset management:
local isLeader = exports['rs_graff']:IsGangLeader(source)local isSpecificGangLeader = exports['rs_graff']:IsGangLeader(source, 'ballas')Export: GetGangPresetContext
Section titled โExport: GetGangPresetContextโConvenience context for menu/permission gating:
local ctx = exports['rs_graff']:GetGangPresetContext(source)-- { hasGang = true, gangName = 'ballas', isLeader = true }Example: Existing Gang Resource Integration
Section titled โExample: Existing Gang Resource Integrationโ-- server.lua in your gang resourceAddEventHandler('onResourceStart', function(res) if res ~= GetCurrentResourceName() then return end if GetResourceState('rs_graff') ~= 'started' then return end exports['rs_graff']:ConfigureGangProvider(GetCurrentResourceName(), 'GetPlayerGang', 'IsGangLeader')end)
exports('GetPlayerGang', function(src) local data = GetGangDataFromYourSystem(src) if not data or not data.name then return nil end return { name = data.name, label = data.label, isBoss = data.isBoss, gradeLevel = data.rank }end)
exports('IsGangLeader', function(src, gangName) return IsLeaderInYourSystem(src, gangName) == trueend)Events & Integration Points (Template)
Section titled โEvents & Integration Points (Template)โReplace these names with your final public API if you choose to expose them later. These are template examples only and are not implemented by default.
Suggested Exports (Template)
Section titled โSuggested Exports (Template)โ-- Place a graffiti panel (if you expose it)exports['rs_graff']:PlacePanel()
-- Enter focus/editor mode for a specific tag or panelexports['rs_graff']:FocusPanel(panelId)
-- Admin removeexports['rs_graff']:RemoveTag(tagId)Suggested Events (Template)
Section titled โSuggested Events (Template)โ-- Fired when a tag is finalizedAddEventHandler('rs_graff:tagFinalized', function(tagId, data) end)
-- Fired when a tag is removedAddEventHandler('rs_graff:tagRemoved', function(tagId) end)