Adding a rumor¶
A registered rumor can be overheard at random near locals:
-- TriggerEvent("tr-rumors:RegisterLocation", name, coords, options)
TriggerEvent("tr-rumors:RegisterLocation", "LegendaryAnimal", coords)
Forcing a rumor on a player¶
A rumor can also be put straight on a player's map. It has to be registered first.
-- exports["tr-rumors"]:ForceRumor(player, name, options)
exports["tr-rumors"]:ForceRumor(data.source, "LegendaryAnimal")
Customising a rumor¶
Both take an optional options table. Anything you set replaces the default from Config.options, and anything you leave out keeps the default:
TriggerEvent("tr-rumors:RegisterLocation", "myRumor", vector3(0, 0, 0), {
radius = 10,
blip = {
label = "Custom Rumor",
},
notification = {
title = "This is a custom rumor. Anything left out uses the default!",
},
})
A forced rumor can look different from the registered one:
TriggerEvent("tr-rumors:RegisterLocation", "LegendaryAnimal", coords)
exports["tr-rumors"]:ForceRumor(data.source, "LegendaryAnimal", {
blip = {
label = "Legendary Animal",
modifiers = {
"BLIP_MODIFIER_MP_COLOR_5",
"BLIP_MODIFIER_FLASH_MEDIUM",
"BLIP_MODIFIER_MP_OVERLAY_ANIMAL",
},
},
notification = {
title = "A legendary animal has been sighted!",
dict = "toasts_mp_generic",
icon = "toast_mp_animal",
},
})
To use the defaults, leave options out or pass an empty table:
TriggerEvent("tr-rumors:RegisterLocation", "myRumor", vector3(0, 0, 0))
exports["tr-rumors"]:ForceRumor(player, "myRumor")