Framework

Add your framework export to the top of this file.

This resource is already configured for VORP, it can be modified to whatever framework you use.

local Core = exports.vorp_core:GetCore()

Notifications

Notification that appears on the right-middle of the screen in vorp framework.

--- Alert (right middle)
--- @param message string
--- @param mType string
function Notify(message, mType)
    Core.NotifyAvanced(message, 'BLIPS', 'blip_proc_bank', (mType == 'error' and 'COLOR_RED' or 'COLOR_GREEN'), 1500)
end

Notification that appears on the top middle of the screen in vorp framework.

--- Notify (top middle)
--- @param title string
--- @param subtitle string
function NotifyTop(title, subtitle)
    Core.NotifySimpleTop(title, subtitle, 4000)
end

Session

This returns whether or not the player is logged into the framework. Can just return true if this doesn't apply to your framework.

--- Checks if a player is logged in
--- @return boolean
function IsLoggedIn()
    return LocalPlayer.state.IsInSession
end

Bandana

This function checks to see if a player is wearing a bandanna. Vorp using a localplayer state. You can modify to your servers needs. Always returns true if the requirement is set to false.

--- Checks if a player has a bandana on (if required)
--- @return boolean
function IsBandanaOn()
    if not Config.RequireBandana then return true end
    return LocalPlayer.state.IsBandanaOn
end

Bank Hours

This function checks if a bank is open or not based on the settings in the config.lua

--- Checks if the bannk is open (if required)
--- @param BankName string
--- @return boolean
function IsBankOpen(BankName)
    if not Config.Banks[BankName] then return false end
    if not Config.Banks[BankName].hours then return true end


    local hour = GetClockHours()

    if hour >= Config.Banks[BankName].hours.open and hour < Config.Banks[BankName].hours.close then
        return true
    end

    return false
end

Skill Checks

Various skill checks used within this resource. One triggered when planting the explosive device and the other used when cracking open a vault inside of the main vault.

Explosive device skill check. (Triggers instant explosion upon failure)

--- Minigame that is triggered when a player plants the explosive
--- @return boolean
function ExplosiveMiniGame()
    -- https://github.com/Legends-Rising/legends-keypress
    return exports['legends-keypress']:startkp(math.random(15, 20), math.random(12, 16))
end

Safe crack skill check.

--- Minigame that is triggered when a player cracks the vault
--- @return boolean
function VaultCrackMiniGame()
    -- https://github.com/GlitchOo/qadr-safe
    return exports['qadr-safe']:createSafe({math.random(1, 40), math.random(20, 60), math.random(10, 99)})
end

Robbery Started

This function is triggered when a robbery is started. You can use this to trigger a police notification with whatever resource you use on your server.

--- Function triggered when a bank robbery is started
--- @param ServerId number -- The server ID of the player
--- @param BankName string -- The name of the bank
function BankRobberyStarted(ServerId, BankName)

end

Vault Explosion

This function is triggered when the main vault door has been opened. You can use this to trigger a police notification with whatever resource you use on your server.

--- Function triggered when a bank vault explodes
--- @param ServerId number -- The server ID of the player
--- @param BankName string -- The name of the bank
function BankVaultExplosion(ServerId, BankName)

end

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.

--- Function triggered when a law man is spawned (attacker)
--- @param entity number
function AttackerPedSpawned(entity)
    SetPedAccuracy(entity, math.random(80, 98)) -- SetPedAccuracy
    SetEntityHealth(entity, math.random(200, 300)) -- SetEntityHealth
    Citizen.InvokeNative(0x4E3A0CC4, entity, math.random(100, 200)) -- SetPedArmour
end

Last updated