Wanted UI
Sending wanted notifications. Only works 1.54 or newer.
Last updated
Sending wanted notifications. Only works 1.54 or newer.
Last updated
THEFT : Theft
MURDER : Murder
BOUNTY : BOUNTY
MALE_WANTED : WANTED
ASSAULT : Assault
ROBBERY : Robbery
LOOTING : Looting
WITNESS : WITNESS
CHEATING : Cheating
THEFT_LIVESTOCK : Rustling
VANDALISM : Vandalism
NO_BOUNTY : No Bounty
KIDNAPPING : Kidnapping
ACCOMPLICE : Accomplice
Key : Text - Use key for data
KIDNAPPING : Kidnapping
INTIMIDATION : Intimidation
ASSAULT_HORSE : Animal Cruelty
JACK_VEHICLE : Vehicle Theft
TRAIN_ROBBERY : Train Robbery
LASSO_ASSAULT : Assault
THEFT_HORSE : Horse Theft
STOLEN_GOODS : Theft
ACCOMPLICE : Accomplice
TRAMPLE_LAW : Murder
BANK_ROBBERY : Bank Robbery
STAGECOACH_ROBBERY : Robbery
LAW_IS_THREATENED : Disturbing the Peace
ROBBERY : Robbery
ASSAULT : Assault
KIDNAPPING_LAW : Kidnapping
ASSAULT_CORPSE : Disturbing the Peace
VEHICLE_DESTRUCTION : Vandalism
FEMALE_WANTED : WANTED
CHEATING : Cheating
DISTURBANCE : Disturbing the Peace
VANDALISM_VEHICLE : Vandalism
MURDER_LIVESTOCK : Animal Cruelty
ASSAULT_LIVESTOCK : Animal Cruelty
JACK_HORSE : Horse Theft
MURDER_HORSE : Animal Cruelty
VANDALISM : Vandalism
TRAMPLE : Murder
THREATEN_LAW : Disturbing the Peace
UNARMED_ASSAULT : Unarmed Assault
ASSAULT_ANIMAL : Animal Cruelty
BURGLARY : Trespassing
THREATEN : Disturbing the Peace
TRESPASSING : Trespassing
THEFT_LIVESTOCK : Rustling
RESIST_ARREST : Disturbing the Peace
THEFT : Theft
MURDER : Murder
PROPERTY_DESTRUCTION : Vandalism
ASSAULT_LAW : Assault
LOOTING : Looting
HIT_AND_RUN_LAW : Unarmed Assault
THEFT_VEHICLE : Vehicle Theft
MURDER_LAW : Murder
JAIL_BREAK : Jail Break
LOITERING : Disturbing the Peace
MURDER_ANIMAL : Animal Cruelty
HIT_AND_RUN : Unarmed Assault
EXPLOSION : Disturbing the Peace
MALE_WANTED : WANTED
GRAVE_ROBBERY : Grave Robbery
HASSLE : Disturbing the Peace
WITNESS : WITNESS
Description: In the new system, you can now trigger 3 different interfaces at once and then switch between the interfaces you want. Each interface can display 4 lowertexts.
-- Shows the wanted UI using the qadr_ui resource.
-- @param data The data to be displayed in the wanted UI.
-- @return The wanted UI.
local wantedUI = exports["qadr_ui"]:showWanted(data)
-- Updates the first message of the 'wantedUI' object with the provided data.
-- @param data The new message to be displayed.
wantedUI.firstMessage:update(data.firstMessage)
-- Sets the lower text of the "firstMessage" switch in the UI to the second index.
wantedUI.firstMessage:setSwitchLowerTextToIndex(2)
-- Updates the wanted UI with the given data.
-- @param data The data to update the UI with.
wantedUI:update(data)
-- Hides/show the first message in the wanted UI.
wantedUI.firstMessage:setShowMessage(false)
-- Sets the upper localized text of the "CRIME_ACCOMPLICE" message in the "firstMessage" element of the "wantedUI" object.
-- Check "Useable upperLocText" for more text
wantedUI.firstMessage:setUpperLocText("CRIME_ACCOMPLICE")
-- Sets the show warning animation flag to true for the second message in the wantedUI table.
-- @param wantedUI The table containing the notification data.
wantedUI.firstMessage:setShowWarningAnimation(true)
-- Sets the texts for the first message in the wanted UI.
-- @param texts A table containing the texts to be set for each line of the message.
-- Each line is represented by a key-value pair, where the key is a number indicating the line number,
-- and the value is a table containing two fields:
-- - textfromrdr: A boolean indicating whether the text should be translated from RDR's localization system.
-- - text: The actual text to be displayed.
wantedUI.firstMessage:setTexts({
["1"] = {
textfromrdr = true,
text = "CRIME_ACCOMPLICE",
},
["2"] = {
textfromrdr = false,
text = "firstMessage 2",
},
["3"] = {
textfromrdr = false,
text = "firstMessage 3",
},
["4"] = {
textfromrdr = false,
text = "firstMessage 4",
}
})
-- Sets the showKnownPulse value for the specified data.
-- @param show A boolean value indicating whether to show the known pulse or not.
-- @return None.
wantedUI.firstMessage:setShowKnownPulse(true)
-- Sets whether or not to show the unknown pulse for the given data.
-- @param show Whether or not to show the unknown pulse.
wantedUI.firstMessage:setShowUnknownPulse(true)
-- Sets the show status of the short wanted cooldown and waits for 10 seconds before executing the callback function (if provided).
-- @param show A boolean value indicating whether to show the short wanted cooldown.
-- @param cb (Optional) The callback function to execute after the 10-second wait.
-- @return None.
wantedUI.firstMessage:setShowShortWantedCooldown(true,function()
print("short cooldown finished")
end)
-- Sets whether to show the long wanted cooldown and waits for 40 seconds before executing the callback function (if provided).
-- @param show A boolean indicating whether to show the long wanted cooldown.
-- @param cb (Optional) The callback function to execute after the 40 second wait.
-- @return None.
wantedUI.firstMessage:setShowLongWantedCooldown(true,function()
print("long cooldown finished")
end)
-- Sets the lower text of the first message in the wanted UI to the localized string with the key "HIT_AND_RUN_LAW". Check usable texts
wantedUI.firstMessage:setLowerTextfromIndex(1,"HIT_AND_RUN_LAW")
-- Sets the lower raw text of the first message in the wanted UI to "Test Raw Text" or you can use usable text.
-- @param wantedUI The UI element to modify.
wantedUI.firstMessage:setLowerRawTextToIndex(1,"Test Raw Text")
-- Clears the wanted UI.
wantedUI:clear()
RegisterCommand("wantedUI",function(src,args,raw)
local data = {
showBountyHunterMessage = true, -- show bounty hunter message http://prntscr.com/gDsOV-qLN_4W
firstMessage = {
showMessage = false
},
secondMessage = {
showMessage = false,
},
thirdMessage = {
showMessage = false,
}
}
local wantedUI = exports["qadr_ui"]:showWanted(data)
print("wanted ui created")
Wait(2000)
data.firstMessage.upperLocText = "CRIME_ACCOMPLICE"
data.firstMessage.upperTextStyle = 0
data.firstMessage.showWarningAnimation = true
data.firstMessage.showMessage = true
data.firstMessage.texts = {
["1"] = {
textfromrdr = true,
text = "CRIME_ACCOMPLICE",
},
["2"] = {
textfromrdr = false,
text = "Text 2 u",
},
["3"] = {
textfromrdr = false,
text = "Text 3 u",
},
["4"] = {
textfromrdr = false,
text = "Text 4 u",
}
}
data.firstMessage.switchLowerTextToIndex = 1
print("wanted ui data updated")
wantedUI.firstMessage:update(data.firstMessage)
print("updated data sent to native ui")
Wait(2000)
wantedUI.firstMessage:setSwitchLowerTextToIndex(2)
print("switched lower text to index 2")
Wait(2000)
data.firstMessage.texts["2"].text = "New Text 2"
data.firstMessage.showMessage = true
data.firstMessage.showWarningAnimation = true
data.firstMessage.upperLocText = "INVESTIGATING"
print("wanted ui data updated")
wantedUI:update(data)
print("updated data sent to native ui")
Wait(3000)
wantedUI.firstMessage:setShowMessage(false)
print("first message set hide")
wantedUI.firstMessage:setShowMessage(true)
print("second message set show")
wantedUI.firstMessage:setUpperLocText("CRIME_ACCOMPLICE")
print("second message set upper text to CRIME_ACCOMPLICE")
wantedUI.firstMessage:setUpperTextStyle(0)
print("second message set upper text style to 0")
wantedUI.firstMessage:setShowWarningAnimation(true)
print("second message set show warning animation to true")
wantedUI.firstMessage:setSwitchLowerTextToIndex(1)
print("second message set switch lower text to index 1")
wantedUI.firstMessage:setTexts({
["1"] = {
textfromrdr = true,
text = "CRIME_ACCOMPLICE",
},
["2"] = {
textfromrdr = false,
text = "firstMessage 2",
},
["3"] = {
textfromrdr = false,
text = "firstMessage 3",
},
["4"] = {
textfromrdr = false,
text = "firstMessage 4",
}
})
print("second message set texts")
Wait(5000)
wantedUI.firstMessage:setShowKnownPulse(true)
print("second message set show known pulse to true")
print("short cooldown started")
wantedUI.firstMessage:setShowShortWantedCooldown(true,function()
print("short cooldown finished")
end)
print("long cooldown started")
wantedUI.firstMessage:setShowLongWantedCooldown(true,function()
print("long cooldown finished")
end)
wantedUI.firstMessage:setLowerTextfromIndex(1,"HIT_AND_RUN_LAW")
wantedUI.firstMessage:setLowerRawTextToIndex(1,"Test Raw Text")
Wait(2000)
print("wanted ui cleared")
wantedUI:clear()
end)