For the complete documentation index, see llms.txt. This page is also available as Markdown.

Events

This events can be triggered from your own resource to interact with the Laptop script.

av_laptop:close

This event is client side and works for closing the laptop UI.

-- client side:
TriggerEvent('av_laptop:close')
-- server side:
TriggerClientEvent('av_laptop:close', playerId)

av_laptop:closed

This client event is triggered when laptop is closed, use it in your own scripts as listener:

AddEventHandler('av_laptop:closed', function()
    -- laptop is closed do something
end

Wifi Event

  • The following event gets triggered when the player connects/disconnects from a hotspot, you can use it in your own resource:

RegisterNetEvent('av_laptop:WiFi', function(hotspot)
    print(hotspot)
    -- hotspot: string | null if disconnected
end)

av_laptop:closeApp

  • Close an specific app by sending the app name as argument, this event is client side.

Use this event to trigger a notification to the user, if the user is using the laptop it will use the UI notification component, otherwise it will use the regular ox_lib notification.

params:

  • title:string Notification header

  • message:string The message to display

  • type:string Type can be "error", "success" or "inform"

av_laptop:tablet

Toggle the tablet animation, it doesn't do anything else just an animation.

params:

  • state:boolean Toggle the tablet animation

av_laptop:appClosed

This is an Event Listener, should be added to your own resource and will be triggered every time player closes an App.

Last updated