Client_Override
These all function you can override according to your need if you want
Copy Any of this code into fs_bridge/unlocked/client.lua
Boss Menu:
To Override Boss Menu system Please copy this below code in fs_bridge/unlocked/client.lua
--@argument job:string
Override.OpenBossMenu = function(job)
-- esx/qb already configured but if u want to use any custom please write down
-- exmaple code
exports['Ricky-BossMenu']:OpenBossMenu(job)
end
Open Stash:
To Override Stash system Please copy this below code in fs_bridge/unlocked/client.lua
--@argument name:string
--@argument label:string
--@argument slots:number
--@argument weight:number
Override.OpenStash = function(argument)
local name = argument.name
local label = argument.label
local slots = argument.slots
local weight = argument.weight
-- write down your code
-- exmaple code
exports['qs-inventory']:RegisterStash(name, slots , weight)
end
Notification:
To Override Notification system Please copy this below code in fs_bridge/unlocked/client.lua
--@argument title:string
--@argument description:string
--@argument time:miliseconds
--@argument type:string: 'inform'/'error'/'success'
--@argument icon:string: 'fontawesome' free icon
Override.Notification = function(argument)
local title = argument.title
local description = argument.description
local duration = argument.duration
local type = argument.type
local icon = argument.icon
-- we already configured ox lib as default notification system
-- bottom is example code
if type == 'inform' then type = 'info end
exports['okokNotify']:Alert(title, description, duration, type, true)
end
Add Hunger:
To Override AddHunger system Please copy this below code in fs_bridge/unlocked/client.lua
--@argument value:number range = 1 to 100
-- value here is a kind of percetange from 1 to 100 any vlaue
Override.AddHunger = function(value)
-- example code
TriggerEvent("esx_status:add", "hunger", value * 10000)
end
Remove Hunger:
To Override Remove Hunger Please copy this below code in fs_bridge/unlocked/client.lua
--@argument value:number range = 1 to 100
-- value here is a kind of percetange from 1 to 100 any vlaue
Override.RemoveHunger = function(value)
-- example code
TriggerEvent("esx_status:remove", "hunger", value * 10000)
end
Add Thirst:
To Override AddThirst system Please copy this below code in fs_bridge/unlocked/client.lua
--@argument value:number range = 1 to 100
-- value here is a kind of percetange from 1 to 100 any vlaue
Override.AddThirst = function(value)
-- example code
TriggerEvent("esx_status:add", "thirst", value * 10000)
end
Remove Thirst:
To Override Remove Thirst Please copy this below code in fs_bridge/unlocked/client.lua
--@argument value:number range = 1 to 100
-- value here is a kind of percetange from 1 to 100 any vlaue
Override.RemoveThirst = function(value)
-- example code
TriggerEvent("esx_status:add", "thirst", value * 10000)
end
Add Stress:
To Override AddStress system Please copy this below code in fs_bridge/unlocked/client.lua
--@argument value:number range = 1 to 100
-- value here is a kind of percetange from 1 to 100 any vlaue
Override.AddStress = function(value)
-- example code
TriggerEvent("esx_status:add", "stress", value * 10000)
end
Remove Stress:
To Override RemoveStress Please copy this below code in fs_bridge/unlocked/client.lua
--@argument value:number range = 1 to 100
-- value here is a kind of percetange from 1 to 100 any vlaue
Override.RemoveStress = function(value)
-- example code
TriggerEvent("esx_status:remove", "stress", value * 10000)
end
Add Armour:
To Override AddArmour system Please copy this below code in fs_bridge/unlocked/client.lua
--@argument value:number range = 1 to 100
-- value here is a kind of percetange from 1 to 100 any vlaue
Override.AddArmour = function(value)
-- example code
if not value then value = 40 end
SetPedArmor(PlayerPedId(), value)
end
Remove Armour:
To Override RemoveArmour Please copy this below code in fs_bridge/unlocked/client.lua
--@argument value:number range = 1 to 100
-- value here is a kind of percetange from 1 to 100 any vlaue
Override.RemoveArmour = function(value)
-- example code
if not value then value = 40 end
SetPedArmour(PlayerPedId(), value)
end
Show Textui:
To Override ShowTextUi system Please copy this below code in fs_bridge/unlocked/client.lua
--@argument text:string
--@argument options:table
--@options position:'right-center'/'left-center'/'top-center'/'bottom-center'
--@options icon: string
--@options can have all ox lib textui options
Override.ShowTextUi = function(text, options)
-- example code
exports['okokTextUI']:Open(text, 'lightblue', 'right', true)
end
Hide Textui:
To Override HideTextUi system Please copy this below code in fs_bridge/unlocked/client.lua
Override.HideTextUi = function()
-- example code
exports['okokTextUI']:Close()
end
Give Car Keys Player:
To Override GiveCarKeyPlayer Please copy this below code in fs_bridge/unlocked/client.lua
--@argument vehicle:number:vehicle handle
Override.GiveCarKeyPlayer = function(vehicle)
--example code
local plate = GetVehicleNumberPlateText(vehicle)
exports.wasabi_carlock:GiveKey(plate)
end
Remove Car Keys Player:
To Override RemoveCarKey Please copy this below code in fs_bridge/unlocked/client.lua
--@argument vehicle:number:vehicle handle
Override.RemoveCarKeyPlayer = function(vehicle)
--example code
local plate = GetVehicleNumberPlateText(vehicle)
exports.wasabi_carlock:RemoveKey(plate)
end
Give Car Keys Job:
To Override GiveCarKeysJob Please copy this below code in fs_bridge/unlocked/client.lua
Override.GiveCarKeyJob = function(vehicle, jobs)
-- write your keys code here don't worry if your vehicle keys don't support it
-- then script will trigger GiveCarKeysPlayer automatically
end
Remove Car Keys Job:
To Override RemoveCarKeysJob Please copy this below code in fs_bridge/unlocked/client.lua
Override.RemoveCarKeyJob = function(vehicle, jobs)
-- write your keys code here don't worry if your vehicle keys don't support it
-- then script will trigger RemoveCarKeyPlayer automatically
end
Set Vehicle Fuel:
To Override SetFuel system Please copy this below code in fs_bridge/unlocked/client.lua
Override.SetFuel = function(vehicle, value)
-- example code
exports.LegacyFuel:SetFuel(vehicle, value)
end
Get Vehicle Fuel:
To Override GetFuel system Please copy this below code in fs_bridge/unlocked/client.lua
Override.GetFuel = function(vehicle)
--example code
return exports.LegacyFuel:GetFuel(vehicle)
end
Reset Skin {Clothing Scripts}:
To Override Reset Skin Please copy this below code in fs_bridge/unlocked/client.lua
function Override.ResetPedCurrentScriptSkin()
-- this just example otherwise rcore clothing already configured automatically
TriggerServerEvent('rcore_clothing:reloadSkin')
end
Save PlayerSkin {Clothing Scripts}:
To Override Save PlayerSkin Please copy this below code in fs_bridge/unlocked/client.lua
-- this is just an example
local numtostring = { -- just to use it according to your script need
component = {
[1] = 'mask_1',
[11] = 'torso_1',
[4] = 'pants_1',
[5] = 'bags_1',
[6] = 'shoes_1',
[8] = 'tshirt_1',
[9] = 'bproof_1',
[10] = 'decals_1',
[7] = 'chain_1',
[3] = 'arms',
},
props = {
[0] = 'helmet_1',
[1] = 'glasses_1',
[2] = 'ears_1',
[6] = 'watches_1',
[7] = 'bracelets_1',
}
}
-- this is just example of fivem-apperance system and no need to do for fivem-apperance
-- cause that already configured
function Override.SavePedCurrentScriptSkin()
local clothes = FWB.GetPedCurrentNativeSkin()
-- now clothes will have that whole table of changed clothes which u need to save
local Appearance = exports['fivem-appearance']:getPedAppearance(Cache.Ped)
if not Appearance then return end
for randomkey, data in pairs((Appearance.components)) do
if clothes[numtostring.component[data.component_id]] then
Appearance.components[randomkey].drawable = clothes[numtostring.component[data.component_id]].drawable
Appearance.components[randomkey].texture = clothes[numtostring.component[data.component_id]].texture
end
end
for randomkey, data in pairs((Appearance.props)) do
if clothes[numtostring.props[data.prop_id]] then
Appearance.props[randomkey].drawable = clothes[numtostring.props[data.prop_id]].drawable
Appearance.props[randomkey].texture = clothes[numtostring.props[data.prop_id]].texture
end
end
clothing_export:setPedComponents(Cache.Ped, Appearance.components)
clothing_export:setPedProps(Cache.Ped, Appearance.props)
TriggerEvent('fivem-appearance:setOutfit', Appearance)
TriggerServerEvent('fivem-appearance:save', Appearance)
Wait(1000)
FWB.ResetPedCurrentScriptSkin()
end
Last updated