Functions
client/custom/functions/alerts.lua
---Sends an alert to the police (usually used for dispatches)
---@param coords vector3|vector4
---@param data table
function SendAlertToPolice(coords, data)
end
client/custom/functions/open.lua
function CanOpenMenu()
local ped = PlayerPedId()
-- your custom functions to open menu (coma status/handcuff/is in any vehicle etc)
if IsPedInAnyVehicle(ped, true) then
return false
end
return true
end
server/custom/functions/open.lua
---Is the player allowed to open the menu?
---@param identifier string|number
---@return boolean allowed
function canOpenMenu(identifier)
if identifier then
-- you can implement your custom code here (such as coma status, handcuffs, etc.)
return true
end
return false
end
server/custom/functions/rewards.lua
---Gives the rewards to a player after succeeding a mission
---@param identifier string|number
---@param money number
function GiveMissionRewards(identifier, money)
local source = Framework.GetSourceFromIdentifier(identifier)
Framework.AddMoney(identifier, money, 'Mission-Reward')
Notify(
source,
Lang.notify['receive_money_from_mission'].message:format(money),
Lang.notify['receive_money_from_mission'].type
)
end
Last updated
Was this helpful?