Notifications
Two different style notifications. One is displayer on the middle right side and the other is a "toast" style notification displayed on the left side.
--- 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
This returns whether or not the player is logged into the framework. Can just return true if this doesn't apply to your framework.
Draw Text
Two different draw text functions. "DrawText3D" is only used when UIPrompts are disabled.
War Declared
This function is triggered when a gang declares war on another gang. (Executes on all clients)
Peace Declared
Similar to "War Declared" this is triggered when peace has been declared. (Executes on all clients)
Zone Attacked
Triggered when a zone is being attacked. (Only executes on players who are in the gang of the zone being attacked)
Allowed
This checks to see if a player can interact with a zone. You can add additional logic here if you would like to restrict a players ability to interact
Ped Spawned
This function is triggered when each ped is pawned (if enabled) during the robbery. You can use this to set the health, armor and accuracy.
Command
This command can be used to tell a player if they're at war and who they're at war with.
Last updated