MaXxaM2611 / mxm_duty

--Readme https://fenixhub.dev/readme_duty.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MxM Duty

Dependencies

  • mysql-async
  • es_extended (Tested on v1 Final)

Noteworthy Features

Duty Sistem

Unlike the classic duty system that sets a new job, this system works with a simple variable that is saved in the database.

Configurable

Very easy to configure, and usable for any job

Optimization

The script has been created in order to create the least amount of lag both client and server side

Example Usage and Config

Config Setting

--config.lua :
Position = {
    { job = "polizia", grademin = 0, x = 441.06674194336, y = -978.576171875, z = 30.689609527588}
}
 --put on job the job that the marker can see, in grademin the minimum grade of the job that the marker can see and in x, y, z, the marker position

Examples of use (Server Side)


-- Request Code if ExampleChekJobInDutyOnline("police") > 1 then --As argument put the job to check --in this case the "ExampleChekJobInDutyOnline" function gives you the number of "police" online and in service, useful for carrying out checks for robberies or for paycheck end


-- Function
ExampleChekJobInDutyOnline = function (job)  
    local count = 0
    for index, player in pairs(GetPlayers()) do
        if tonumber(player) ~= nil then
            local xPlayer = ESX.GetPlayerFromId(tonumber(player))
            local inDuty = exports["mxm_duty"]:getDuty(tonumber(player))
            if xPlayer then
                if xPlayer.job.name == job and inDuty then
                    count = count + 1
                end
            end
        end
    end
    return count
end

Examples of use (Client Side)

local inDuty = exports["mxm_duty"]:getClienDuty()
if  inDuty  then
--print("in Duty")   
else
--print("Off Duty")   
end

Credits

The publication of the script does not authorize its commercialization. if you have any advice or want to propose changes you can contact us via discord


  "Main Developer:"    MaXxaM#0511
  "Powered By"        fenixhub.dev

About

--Readme https://fenixhub.dev/readme_duty.html

License:GNU General Public License v3.0


Languages

Language:Lua 100.0%