FreeScriptsDocsSupport

Browse

  • Documentation
    • FAQ
  • 📱 Phone
    • 🧠 Installation
    • 🦄 Unique phones
    • 💿 Configure
      • 💄 Additional Features
      • 📸 Camera
      • 📹 Video Calls
      • 🍏 Apps
      • 🪵 Logs
      • 🔋 Battery System
      • 🖼️ Media Customization
      • 🗣️ Multi-Language Support
      • 🗃️ SIM Cards
      • 🚗 Valet System
      • 🖼️ Wallpapers App
      • ⛅ Weather Widget
    • ⏭️ Exports
      • Client side
        • 👁️‍🗨️ General
        • 📞 Calls
        • ☀️ Groups
        • 🏢 Companies
        • 🔧 Misc
        • 🗼 Signal Towers
      • Server side
        • 🆔 Identify Player
        • ☎️ Sim Cards
        • 📞 Calls
        • 💬 Messages
        • ☀️ Groups
        • 🌐 Cell Broadcast
        • 💸 YPay
        • 📧 Mail
        • 📪 Notifications
        • 📵 Screen Damage
        • 🗯️ Dark Chat
        • 🔧 Misc
    • 🪛 Commands
    • 📡 Events
      • Server side
        • 📨 Messages
        • 📱 Social Media
        • ☎️ Calls
    • 🍎 Custom apps
    • 🏦 Banking App
    • 📈 Markets App
    • 👜 State bags
  • ☎️ Boomer Phone
    • 🧠 Installation
    • 🦄 Unique phones
    • ⏯️ Exports
      • Client side
  • 🏠 Properties
    • 🧠 Installation
    • 💿 Configure
    • 🔗 Compatibility
      • Phones
        • YSeries
        • LB Phone
    • 📖 Guides
      • 🛏️ Starter Apartments
      • 🐚 Add More Shells
      • 🔑 Physical Keys
      • 🪑 Furniture As Items
      • 🛠️ Fix Interactable Points
      • 📋 Discord Logs Setup
    • ⏭️ Exports
      • Client side
        • GetCurrentPropertyId
        • GetCurrentProperty
        • IsPointInsideProperty
        • OpenPropertyMenu
        • AddKey
        • RemoveKey
        • SetWaypointToProperty
        • GetAllProperties
        • GetKeyHolders
        • PoliceRaidDoor
        • WrapIntoProperty
        • GetClosestDoor
        • GetEntryCoordinates
        • UseLockpick
        • PoliceRaidDoor
      • Server side
        • GetAllProperties
        • GetPropertyData
        • AddKey
        • RemoveKey
        • ToggleDoorlock
        • GetPlayersInProperty
        • GetKeyHolders
        • DeleteProperty
        • AddStarterApartment
        • SellProperty
        • TransferProperty
    • 🪝 Hooks System
      • buyProperty
      • rentProperty
      • sellProperty
      • deleteProperty
      • createDoor
      • saveSettings
      • setInteractablePoint
      • canEnter
      • canExit
    • 👜 State bags
  • 🏦 Banking
    • 🧠 Installation
    • 🪛 Commands
    • ⏯️ Exports
      • Client side
      • Server side
    • 🪵 Logs
    • 🪝 Hooks
    • 🏦 Banking App
  • 💸 Billing
    • 🧠 Installation
    • ⏭️ Exports
      • Client side
      • Server side
  • 📊 Hud
    • 🧠 Installation
    • ⏭️ Exports
      • Client side
  • 📦 Storage Units
    • 🧠 Installation
  • 🎰 Slots
    • 🧠 Installation
    • 📱 Phone app
  • 🎃 Minigames
    • 🎯 Exports and Usage
    • 🔧 Commands

📨 Messages Events

yseries:server:messages:sent

Triggered when a new message is successfully sent and saved to the database. This event fires after the message has been inserted into the database and notifications have been sent to recipients.

Event Data:

lua
{
    messageId = string,        -- Unique message ID
    channelId = string,        -- Channel/conversation ID
    sender = string,           -- Sender's phone number
    senderImei = string|nil,   -- Sender's phone IMEI (can be nil for non-existent numbers like system messages)
    content = string,          -- Message content
    attachments = string|nil,  -- JSON string of attachments array (can be nil)
    participants = string|table, -- Recipient phone number(s) - can be string or array
    timestamp = string|nil,    -- Message timestamp from database
    targetSource = number|nil  -- Target player source ID if recipient is online (can be nil)
}

Usage Example:

lua
RegisterNetEvent('yseries:server:messages:sent', function(messageData)
    print("New message sent!")
    print("Message ID:", messageData.messageId)
    print("From:", messageData.sender)
    print("To:", json.encode(messageData.participants, { indent = true }))
    print("Content:", messageData.content)
    
    -- Example: Log message to external system
    -- YourLoggingSystem:LogMessage(messageData)
    
    -- Example: Trigger custom logic based on message content
    -- if string.find(messageData.content, "keyword") then
    --     -- Do something
    -- end
end)

Notes:

  • This event fires for all messages, including group messages
  • The senderImei can be nil for messages sent from non-existent phone numbers (e.g. system messages)
  • The attachments field is a JSON string that needs to be decoded if you want to access the attachment data
  • The participants field can be either a string (single recipient) or a table/array (multiple recipients for group messages)
  • The targetSource is only set if at least one recipient is online; otherwise it's nil

On this page

  • yseries:server:messages:sent

All Rights Reserved

TeamsGG © 2026

Pages

FreeScriptsDocsSupport

Legal

Terms of ServiceRefunds

Tebex

Tebex ImpressumTebex TermsTebex Privacy

Socials

DiscordYouTube