FreeScriptsDocsCustomSupport

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
        • 🖼️ Gallery
        • 📱 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

🖼️ Gallery Events

yseries:server:gallery:on-photo-deleted

Triggered on the server when a gallery photo or video row is removed from the phone library.

Use this hook to delete the underlying media file from your upload provider (Fivemanage, Fivemerr, S3, custom storage, etc.) after a player deletes media from the Gallery app.

This event is emitted with TriggerEvent and is not forwarded to clients. Listen with AddEventHandler in a server script in your own resource.

When it fires:

  • A player deletes a photo or video (moved to Recently Deleted / recycle bin)
  • A player deletes an album and chooses to delete the photos inside it
  • The server permanently purges recycle-bin rows older than 30 days

Event Data:

lua
-- data: {
--     id = number,              -- Gallery row ID in `yphone_gallery`
--     phoneImei = string,       -- Phone IMEI that owned the media row
--     image = string,           -- Photo URL, or video file URL (`yphone_gallery.image`)
--     thumbnail = string|nil,   -- Video poster/thumbnail URL; `nil` for photo rows
--     source = string|nil,      -- Gallery source tag (`camera`, `download`, `hidden`, `private`, `other`, etc.)
--     permanent = boolean,      -- `false` = soft delete (recycle bin); `true` = DB row purged
--     playerSource = number|nil   -- Server id of the deleting player; `nil` for automated purge
-- }
-- playerIdentifier: string|nil  -- Framework identifier of the deleting player; `nil` when purged by the server

Usage Example:

lua
AddEventHandler('yseries:server:gallery:on-photo-deleted', function(data, playerIdentifier)
    print('Gallery media removed:', data.id, data.image)

    -- Recommended: only delete remote storage after permanent removal
    if not data.permanent then
        return
    end

    -- Example: delete primary media from your storage provider
    -- deleteRemoteMedia(data.image)

    -- Videos may also have a separate poster/thumbnail URL
    -- if data.thumbnail and data.thumbnail ~= '' then
    --     deleteRemoteMedia(data.thumbnail)
    -- end
end)

Notes:

  • Prefer AddEventHandler over RegisterNetEvent. This event is server-only and should not be triggered from the client.
  • When permanent is false, the row still exists in the database (recycle bin) and can be restored by the player. Deleting remote storage immediately may break restore.
  • When permanent is true, the database row has been permanently removed (recycle-bin purge).
  • For videos, image is the video file URL and thumbnail is the poster frame URL. Delete both if your provider stores them separately.
  • Upload configuration (Fivemanage, Fivemerr, custom API) is documented in Camera / Upload.

On this page

  • yseries:server:gallery:on-photo-deleted

All Rights Reserved

TeamsGG © 2026

Pages

FreeScriptsDocsCustomSupport

Legal

Terms of ServiceRefunds

Tebex

Tebex ImpressumTebex TermsTebex Privacy

Socials

DiscordYouTube