Notifications
--- Displays a RDO style toast alert on the screen
--- @param title string
--- @param msg string
--- @param textureDict string
--- @param texture string
--- @param duration number
function ToastAlert(title, msg, textureDict, texture, duration)
if not U.LoadTexture(textureDict) then return end
local struct = U.DataView.ArrayBuffer(56)
struct:SetInt32(0, duration or 4000)
local structData = U.DataView.ArrayBuffer(64)
structData:SetInt64(8, U.DataView:BigInt(VarString(10, "LITERAL_STRING", title)))
structData:SetInt64(16, U.DataView:BigInt(VarString(10, "LITERAL_STRING", msg)))
structData:SetInt32(24, 0)
structData:SetInt64(32, U.DataView:BigInt(joaat(textureDict)))
structData:SetInt64(40, U.DataView:BigInt(joaat(texture)))
structData:SetInt64(48, U.DataView:BigInt(joaat("COLOR_WHITE")))
-- _UI_FEED_POST_SAMPLE_TOAST
Citizen.InvokeNative(0x26E87218390E6729, struct:Buffer(), structData:Buffer(), 1, 1)
SetStreamedTextureDictAsNoLongerNeeded(textureDict)
end
--- Display a notification on the screen
--- @param msg string
--- @param mType string
function Notify(msg, mType)
local textureDict = 'BLIPS'
local texture = 'blip_mission_camp'
if not U.LoadTexture(textureDict) then return end
local struct = U.DataView.ArrayBuffer(56)
struct:SetInt32(0, 3000)
struct:SetInt64(8, U.DataView:BigInt(VarString(10, "LITERAL_STRING", "Transaction_Feed_Sounds")))
struct:SetInt64(16, U.DataView:BigInt(VarString(10, "LITERAL_STRING", "Transaction_Positive")))
local structData = U.DataView.ArrayBuffer(80)
structData:SetInt64(8, U.DataView:BigInt(VarString(10, "LITERAL_STRING", msg)))
structData:SetInt64(16, U.DataView:BigInt(VarString(10, "LITERAL_STRING", textureDict)))
structData:SetInt64(24, U.DataView:BigInt(joaat(texture)))
structData:SetInt64(40, U.DataView:BigInt(joaat(mType or "COLOR_WHITE")))
-- _UI_FEED_POST_SAMPLE_TOAST_RIGHT
Citizen.InvokeNative(0xB249EBCB30DD88E0, struct:Buffer(), structData:Buffer(), 1)
SetStreamedTextureDictAsNoLongerNeeded(textureDict)
endSession
Draw Text
War Declared
Peace Declared
Zone Attacked
Allowed
Ped Spawned
Command
Last updated