Additional Features
Currency Configuration
Overview
The YSeries phone system allows you to customize currency display and formatting to match your server's economy and regional preferences.
Currency Settings
Configure currency in config/config.misc.lua
:
Config.CurrencyFormat = "{amount}$" -- How currency is displayed
Config.CurrencySymbol = "$" -- Currency symbol
Config.CurrencyLabel = 'usd' -- Currency identifier
Currency Format Examples
Euro
Config.CurrencyFormat = "{amount} €"
Config.CurrencySymbol = "€"
Config.CurrencyLabel = 'eur'
-- Output: 1.250,00 €
Custom Currency
Config.CurrencyFormat = "{amount} Credits"
Config.CurrencySymbol = "CR"
Config.CurrencyLabel = 'credits'
-- Output: 1,250 Credits
Cell Broadcast System
Overview
Cell broadcast technology allows emergency alerts and public messages to be sent to all mobile users on the server, simulating real-world emergency alert systems.
Basic Usage
Via Export
---Sends a cell broadcast message.
---@param to number The recipient of the message. Source id.
---@param title string The title of the message.
---@param content string The content of the message.
---@param iconUrl string The URL of the icon to display with the message.
exports["yseries"]:CellBroadcast(to, title, content, iconUrl)
Via Command (In-Game)
/cellbroadcast <source> <title> <content> <iconUrl(optional)>
Implementation Examples
Emergency Alert
-- Server-side emergency broadcast
RegisterNetEvent('emergency:sendAlert', function(alertType, message)
local players = GetPlayers()
for _, playerId in pairs(players) do
exports["yseries"]:CellBroadcast(
tonumber(playerId),
"🚨 EMERGENCY ALERT",
message,
"https://example.com/emergency-icon.png"
)
end
end)
Custom Sound Configuration
Replacing Default Sound
You can replace the default cell broadcast sound:
Location:
/ui/build/sounds/notifications/apps/cellBroadcast.mp3
Format: MP3 recommended
Duration: Keep under 3 seconds for better user experience
Volume: Ensure it's attention-grabbing but not jarring
Death/Revive Handling
Overview
The phone system can be configured to restrict phone usage when players are dead or unconscious, adding realism to the roleplay experience.
Basic Configuration
Configure death handling in client/custom/functions/death.lua
:
-- Trigger these events based on your framework
function OnDeath()
-- Called when player dies
TriggerEvent('yseries:player:died')
end
function OnRevive()
-- Called when player is revived
TriggerEvent('yseries:player:revived')
end
Last updated