SEM_InteractionMenu icon indicating copy to clipboard operation
SEM_InteractionMenu copied to clipboard

Discord Integration and onduty command with blips

Open Aryaman-Pradhan-0306 opened this issue 4 years ago • 1 comments

Hello , Can I get some help with making this nice script work with Discord perms and at the same time /onduty and they also get a blip when they get onduty ? . its because i don't want people in the server to By-mistaken use the perms while on as civ

Aryaman-Pradhan-0306 avatar Jun 03 '21 13:06 Aryaman-Pradhan-0306

If you make the following changes in the files, players will be required to use the /onduty command and have the correct ACE permissions to be able to go onduty as either Fire or LEO

client.lua Line 625 -> Line 671

RegisterCommand('onduty', function(source, args, rawCommand)
    if Config.LEOAccess == 3 or Config.FireAccess == 3 then
        if Config.OndutyPSWDActive then
            if args[2] == Config.OndutyPSWD then
                local Department = args[1]:lower()
                if Department == 'leo' then
                    if LEOAce then
                        LEOOnduty = not LEOOnduty
                        if LEOOnduty then
                            Notify('~g~You are onduty as an LEO')
                        else
                            Notify('~o~You are no longer onduty as an LEO')
                        end
                    else
                        Notify('~r~Insufficient Permissions')
                    end
                elseif Department == 'fire' then
                    if FireAce then
                        FireOnduty = not FireOnduty
                        if FireOnduty == true then
                            Notify('~g~You are onduty as an Firefighter')
                        else
                            Notify('~o~You are no longer onduty as an Firefighter')
                        end
                    else
                        Notify('~r~Insuffisient Permissions')
                    end
                else
                    Notify('~r~Invalid Department!')
                end
            else
                Notify('~r~Incorrect Password')
            end
        else
            local Department = args[1]:lower()
                if Department == 'leo' then
                    if LEOAce then
                        LEOOnduty = not LEOOnduty
                        if LEOOnduty then
                            Notify('~g~You are onduty as an LEO')
                        else
                            Notify('~o~You are no longer onduty as an LEO')
                        end
                    else
                        Notify('~r~Insufficient Permissions')
                    end
                elseif Department == 'fire' then
                    if FireAce then
                        FireOnduty = not FireOnduty
                        if FireOnduty == true then
                            Notify('~g~You are onduty as an Firefighter')
                        else
                            Notify('~o~You are no longer onduty as an Firefighter')
                        end
                    else
                        Notify('~r~Insuffisient Permissions')
                    end
                else
                    Notify('~r~Invalid Department!')
                end
        end
    end
end)

config.lua Line 151

Config.LEOAccess = 3

Sc0ttM avatar Jun 06 '21 16:06 Sc0ttM