Skip to main content

Server Events

All of the server side events can be found below. And is already registered in the file omik_emstablet/events.lua.

omik_emstablet:server:newJournalEvent

This event is triggered when a new journal has been created.

It comes with a lot of information about the citizen and treatment, and can be used to integrate with other resources.

Data Schema

The following data is what is sent with the event and stored in the property data

{
framework: "qbcore" | "esx" | "vrp",
data: {
doctor_id: number,
user: {
identifier: string
avatar: string
name: string
DOB: number
gender: string
phone: string
job: string
address: string
note: string
},
selectedDoctors: string[],
selectedMedicine: {
id: number
amount: number
medicine: IMedicine
}[],
selectedTreatments: string[],
description: string
}
}

omik_emstablet:openTablet

This event opens the tablet for the player.

It has to be triggered from the client side. It is dependent on a source to be able to check the players ranks and permissions.

A better way to open the tablet is to use the Native ExecuteCommand(<command>) and then trigger the command from cfg.openCMD (default: emstablet)

Examples

Open the tablet for the player with a keypress

RegisterKeyMapping('+openemstablet', ' omik_emstablet', 'keyboard', cfg.hotkey or "F5")
RegisterCommand('+openemstablet', function()
TriggerServerEvent("omik_emstablet:openTablet")
end)

Open the tablet with a command

RegisterCommand("emstablet", function()
TriggerServerEvent("omik_emstablet:openTablet")
end)