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,
custom = 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,
custom = nil
})jobs:
string[]label:
stringcoords?:
vector3orvector4or{ x: number, y: number, z: number }if nil, will use the player's current positioncode?:
stringAlert code, e.g. "10-29"policeCount?:
stringornumberNumber of police officers responding to the alert, if nil, it will not be displayed (string or number)icon?:
stringDefault: triangle-exclamationFontAwesome icon name, e.g. "car-on"iconColor?:
stringHex color for the icon, e.g. "#FF0000"bgAnimate?:
booleanDefault: falseIf true, the background will animatevehicle?:
{ label?: boolean, plate?: boolean, color?: boolean }Vehicle information (if null all vehicle data will be send)label?:
booleanDefault: trueIf true, the vehicle label will be includedplate?:
booleanDefault: trueIf true, the vehicle plate will be includedcolor?:
booleanDefault: trueIf true, the vehicle color will be included
gender?:
booleanDefault: trueIf true, the player's gender is displayed.sound?:
booleanDefault: trueIf true, the alert will play a soundsoundName?:
stringDefault: "HUD_FRONTEND_DEFAULT_SOUNDSET"Sound name to play, e.g. "HUD_FRONTEND_DEFAULT_SOUNDSET"blip?:
numberBlip ID for the alert on the map, e.g. 280custom?:
{ labelLeft: string, labelRight: string, icon: string }[]Custom information to display in the alert
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",
custom = {
{
labelLeft = "Car Type",
labelRight = "A Plus",
icon = "car"
},
{
labelLeft = "Race Information",
labelRight = "Secret",
icon = "car"
}
}
},
policelist = { "tgiann test" },
bgAnimate = false,
sound = { active = false, name = nil, isCodeSound = false },
blip = nil,
src = nil,
}, { "police", "ambulance", "sheriff" })alertData
coords:
vector3orvector4or{ x: number, y: number, z: number }duration:
numbercode?:
stringicon?:
stringiconColor?:
stringlabel:
stringinformation
time:
datelocation:
{ street: string, avenue: string }street:
stringavenue:
string
vehicle?
{ label: string, plate: string, color: { text: string, hex1: string, hex2: string } }label?:
stringplate?:
stringcolor?:
text?:
stringhex1?:
stringhex2?:
string
gender:
morfcustom:
{ labelLeft: string, labelRight: string, icon: string }[]labelLeft:
stringlabelRight:
stringicon:
string
policelist:
string[]bgAnimate?:
booleansound
active?:
booleanname?:
stringisCodeSound?:
boolean
blip?:
numbersrc?:
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)
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)
number[] The Alert is sent to the sources in the array list. (Cannot be used at the same time as jobs)Last updated