Exports

Alert

-- client
exports["tgiann-policealert"]:Alert({
    jobs = { "police" },
    label = "Alert Test",
    coords = nil,
    code = nil,
    policeCount = nil,
    icon = nil,
    iconColor = nil,
    bgAnimate = false,
    vehicle = {
        label = true,
        plate = true,
        color = true
    },
    gender = true,
    sound = true,
    soundName = nil,
    blip = nil,
})

-- server
exports["tgiann-policealert"]:Alert(src, {
    jobs = { "police" },
    label = "Alert Test",
    coords = nil,
    code = nil,
    policeCount = nil,
    icon = nil,
    iconColor = nil,
    bgAnimate = false,
    vehicle = {
        label = true,
        plate = true,
        color = true
    },
    gender = true,
    sound = true,
    soundName = nil,
    blip = nil,
})
  • jobs: string[]

  • label: string

  • coords?: vector3 or vector4 or { x: number, y: number, z: number } if nil, will use the player's current position

  • code?: string Alert code, e.g. "10-29"

  • policeCount?: string or number Number of police officers responding to the alert, if nil, it will not be displayed (string or number)

  • icon?: string Default: triangle-exclamation FontAwesome icon name, e.g. "car-on"

  • iconColor?: string Hex color for the icon, e.g. "#FF0000"

  • bgAnimate?: boolean Default: falseIf true, the background will animate

  • vehicle?: { label?: boolean, plate?: boolean, color?: boolean } Vehicle information (if null all vehicle data will be send)

    • label?: boolean Default: true If true, the vehicle label will be included

    • plate?: boolean Default: true If true, the vehicle plate will be included

    • color?: boolean Default: true If true, the vehicle color will be included

  • gender?: boolean Default: true If true, the player's gender is displayed.

  • sound?: boolean Default: true If true, the alert will play a sound

  • soundName?: string Default: "HUD_FRONTEND_DEFAULT_SOUNDSET" Sound name to play, e.g. "HUD_FRONTEND_DEFAULT_SOUNDSET"

  • blip?: number Blip ID for the alert on the map, e.g. 280

SendCustomAlert

Only works on server

exports["tgiann-policealert"]:SendCustomAlert(alertData, jobs, srcList)

exports["tgiann-policealert"]:SendCustomAlert({
    coords = { x = 1000.0, y = 250.5, z = 300.5 },
    duration = 5,
    code = nil,
    icon = nil,
    iconColor = nil,
    label = "My Custom Alert",
    information = {
        time = os.time(),
        location = { street = "Street Name", avenue = "Avenue Name" },
        vehicle = { label = "Sultan Rs", plate = "ABC123", color = { text = "Green and black", hex1 = "green", hex2 = "black" } },
        gender = "m"
    },
    policelist = { "tgiann test" },
    bgAnimate = false,
    sound = { active = false, name = nil, isCodeSound = false },
    blip = nil,
    src = nil,
}, { "police", "ambulance", "sheriff" })

alertData

  • coords: vector3 or vector4 or { x: number, y: number, z: number }

  • duration: number

  • code?: string

  • icon?: string

  • iconColor?: string

  • label: string

  • information

    • time: date

    • location: { street: string, avenue: string }

      • street: string

      • avenue: string

    • vehicle? { label: string, plate: string, color: { text: string, hex1: string, hex2: string } }

      • label?: string

      • plate?: string

      • color?:

        • text?: string

        • hex1?: string

        • hex2?: string

    • gender: m or f

  • policelist: string[]

  • bgAnimate?: boolean

  • sound

    • active?: boolean

    • name?: string

    • isCodeSound?: boolean

  • blip?: number

  • src?: number

jobs?: string[] The alert is sent to all players belonging to the jobs in the array list. (Cannot be used at the same time as srcList)

srcList?: number[] The Alert is sent to the sources in the array list. (Cannot be used at the same time as jobs)

Last updated