--- Function to emit a notification on the player's screen (Client-side). --- @param title string The Title / Header of the notification. --- @param description string The Body / Message of the notification. --- @param notifyType string|nil The type of notification ('success', 'error', 'info', 'warning'). Default: 'info'. function ClientNotify(title, description, notifyType) lib.notify({ title = title, description = description, type = notifyType or 'info', }) end --- Called every time the player opens the Pause Menu (e.g. presses ESC or custom keybind). --- Useful if you want to disable or hide other UI/HUD elements while the Pause Menu is active. function OnPauseMenuOpened() end --- Called every time the player closes the Pause Menu. --- Useful to re-enable or show previously hidden UI/HUD elements. function OnPauseMenuClosed() end --- Called when a new report/ticket has been submitted by a player. --- Displays a notification to the player receiving it (usually an Admin). --- @param summary table Contains report data (e.g. summary.ownerName, summary.subject). function OnNewReportReceived(summary) ClientNotify(locale('notifications.new_report'), locale('notifications.new_report_desc'):format(summary.ownerName or 'Unknown', summary.subject or ''), 'warning') end --- Called when a player's report has been claimed/taken by an Admin. --- This notification will appear on the report creator's screen. --- @param reportId number/string The ID of the report being handled. --- @param adminName string The name of the Admin who claimed the report. function OnReportClaimed(reportId, adminName) ClientNotify(locale('notifications.report_claimed'), locale('notifications.report_claimed_desc'):format(adminName or 'Unknown'), 'success') end --- Called when a player's report has been closed/resolved by an Admin. --- This notification will appear on the report creator's screen indicating it's done. --- @param reportId number/string The ID of the closed report. function OnReportClosed(reportId) ClientNotify(locale('notifications.report_closed'), locale('notifications.report_closed_desc'), 'info') end -- Event: Player Killed. -- Triggered when a player is killed by someone else. Used to track deaths in the database stats. -- Note: You can replace 'baseevents:onPlayerKilled' with your framework's native death event if you use a custom death system. AddEventHandler('baseevents:onPlayerKilled', function(killerId, data) TriggerServerEvent('prism_pausemenu:server:onDeath') end) -- Event: Player Died (e.g. Suicide / Fall damage / Environmental). -- Triggered when a player dies without being directly killed by another player. -- Note: You can replace 'baseevents:onPlayerDied' with your framework's native death event. AddEventHandler('baseevents:onPlayerDied', function(data) TriggerServerEvent('prism_pausemenu:server:onDeath') end) -- Event: Kill Tracker (Game engine damage event). -- Triggered when the LocalPlayer successfully kills another ped. -- We check if the victim is a real player, and if so, trigger the server event to add a 'Kill' to the stats. AddEventHandler('gameEventTriggered', function(name, args) if name == 'CEventNetworkEntityDamage' then local victim = args[1] local attacker = args[2] local isFatal = args[6] -- 1 if dead, 0 if not dead local myPed = PlayerPedId() -- If someone died (isFatal == 1), the attacker is me, the victim is not me, the victim is a Ped, and the victim is a real player. if isFatal == 1 and attacker == myPed and victim ~= myPed and IsEntityAPed(victim) and IsPedAPlayer(victim) then TriggerServerEvent('prism_pausemenu:server:onKill') end end end) -- ═══════════════════════════════════════════════════════════════ -- EXPORTS -- ═══════════════════════════════════════════════════════════════ -- Allows other resources to use these functions using: -- exports['prism_pausemenuv2']:getMyStats() exports('getMyStats', function() return lib.callback.await('prism_pausemenu:server:getStats', false) end)