This contains important exports to intergrate our job into your system if needed. By default all should work without.
Exports
Server Exports
Get the amout of weapons available at the LSPD:
-- 'weapon' is a String and uppercase
-- 'amount' is an Interger
local amount = exports['mfp_policejob']:getWeaponStock(weapon)
Get the mileage:
-- 'plate' is a String
-- 'amount' is an Interger
local amount = exports['mfp_policejob']:GetCarMileage(plate)
Handcuff a player / uncuff a player:
-- 'canmove' true to make moveable, false to freeze
-- 'target' is the target
exports['mfp_policejob']:Handcuff(target, canmove)
Get Vehicleinformation
-- 'plate' is a String
-- vehinfo.registered (bool): true/false
-- vehinfo.first_registration (String): date as a string
-- vehinfo.owner (String): First & Lastname
local vehinfo = exports['mfp_policejob']:getVehicleInfos(plate)
Get Playerdata with licences, weapons, inventory, money
-- data.firstname: Firstname (String)
-- data.name: Lastname (String)
-- data.job: Job Label (String)
-- data.grade: JobGrade Label (String)
-- data.inventory: Invetory (Array)
-- data.accounts: MoneyAccount (Array)
-- data.weapons: Weapons (Array)
-- data.dob: Date (String)
-- data.height: Heigth (String)
-- data.sex: 'm' or 'f'
-- data.licenses: Licenses (Array)
-- 'target' is the target-id
local data = exports['mfp_policejob']:getVehicleInfos(target)
Client Exports
Open the F6 Interaction menu
exports['mfp_policejob']:openInteractionMenu()
Open the Police Wardrope
exports['mfp_policejob']:openWardrobeMenu()
Set the uniform of an officer
-- 'playerPed' is the playerpedid
-- 'grade' is the grade of the preset of clothings (Int)
-- 'hasvest' is the clothing containing a bulletproofvest (bool)
exports['mfp_policejob']:SetUniform(grade, playerPed, hasvest)
Trigger the activation of ur own panicbutton
exports['mfp_policejob']:triggerPanicButton()
Customize Weapons at Armory
add the following lines at client/client.lua:383
-- replace MY WEAPONNAME with the label of your weapon
-- replace WEAPON_MYWEAPON with your weaponspawnname
local customitem = NativeUI.CreateItem("MY WEAPONNAME",'')
mainMenu:AddItem(customitem )
ESX.TriggerServerCallback('mfp_policejob_waffenkammer:getStock', function(stock)
customitem:RightLabel('~p~'..stock)
end, 'WEAPON_MYWEAPON')
customitem.Activated = function(sender, index)
TriggerServerEvent('mfp_policejob_waffenkammer:reinraus', 'WEAPON_MYWEAPON', "MY WEAPONNAME")
_menuPool:CloseAllMenus()
end
import the following sql-statement:
INSERT INTO mfp_stocks (typ, amount) VALUES ('WEAPON_MYWEAPON', 4);