πŸ”‘Configuration

Config = {}


Config.Settings = {
    ["ShowedItems"] = {
        ["Time"] = true,
        ["Job"] = true,
        ["PlayerCount"] = true,
        ["PlayerId"] = true,
        ["ServerName"] = true,
        ["WeaponHud"] = true,
        ["RadioHud"] = true,
        ["VoiceHud"] = true,
        ["Money"] = {
            ["Money"] = true,
            ["Bank"] = true,
            ["Black"] = true
        },
        ["FoodHud"] = true,
        ["Speedo"] = true,
        ["Chat"] = true,
        ["HudSettings"] = true,
        ["Safezones"] = true
    },
    ["TickSpeed"] = {
        ["PlayerData"] = 500,
        ["Speedo"] = 0,
        ["WeaponHud"] = 200
    },
    ["HiddenComponents"] = {
        2, 6, 7, 8, 9, 13, 20, 17, 1, 4, 3
    },
    ["VoiceSystem"] = {
        ["System"] = "pma-voice", -- pma-voice | salty-chat
        ["Range"] = {             -- MAXIMUM: 4 RANGES
            3,
            8,
            15,
            30
        }
    },
    ["UI"] = {
        ["Title"] = "Revolution",
        ["SubTitle"] = "Roleplay"
    }
}

Config.Needs = {
    ["Hunger"] = function(fcb)
        TriggerEvent("esx_status:getStatus", 'hunger', function(status)
            fcb(math.floor((status.val / 1000000 * 100) / 20))
        end)
    end,
    ["Thirst"] = function(fcb)
        TriggerEvent("esx_status:getStatus", 'thirst', function(status)
            fcb(math.floor((status.val / 1000000 * 100) / 20))
        end)
    end,
}

Config.Speedo = {
    ["MaxSpeed"] = 320, -- RECOMMENDED
    ["GetFuel"] = function(vehicle)
        return GetVehicleFuelLevel(vehicle)
    end
}

Config.Notifications = {
    ["Notifications"] = {
        ["PlaySound"] = function()
            PlaySoundFrontend(-1, "ATM_WINDOW", "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
        end
    },
    ["Announcements"] = {
        ["PlaySound"] = function()
            PlaySoundFrontend(-1, "OTHER_TEXT", "HUD_AWARDS", true)
        end
    }
}


Config.KeyMappings = {
    ["Chat"] = {
        ["Command"] = "openchat",
        ["Key"] = "T",
        ["Description"] = "Open Chat"
    }
}


Config.Safezones = {
    ['WΓΌrfelpark'] = {
        coords = vector3(199.4375, -935.2621, 30.6869),
        radius = 100.0
    },
    ['LCN'] = {
        coords = vector3(-1502.0660, 50.7972, 54.7255),
        radius = 100.0
    }
}

Config.SafeZoneEnterFunction = function(playerPed, vehicle)
    isInZone = true
    NetworkSetFriendlyFireOption(false)
    SetVehicleMaxSpeed(vehicle, 50 / 3.6)

    CreateThread(function()
        while isInZone do
            SetCurrentPedWeapon(playerPed, GetHashKey("WEAPON_UNARMED"), true)
            DisablePlayerFiring(playerPed, true)
            SetPlayerCanDoDriveBy(playerPed, false)

            DisableControlAction(2, 37, true)  -- Disable weapon wheel (Tab)
            DisableControlAction(0, 106, true) -- Disable in-vehicle weapon selection
            DisableControlAction(0, 24, true)  -- Disable attack
            DisableControlAction(0, 69, true)  -- Disable in-vehicle attack
            DisableControlAction(0, 70, true)  -- Disable in-vehicle attack
            DisableControlAction(0, 92, true)  -- Disable in-vehicle attack
            DisableControlAction(0, 45, true)  -- Disable reload
            DisableControlAction(0, 80, true)  -- Disable vehicle weapon
            DisableControlAction(0, 140, true) -- Disable melee attack light
            DisableControlAction(0, 250, true) -- Disable melee attack alternate
            DisableControlAction(0, 263, true) -- Disable melee attack heavy
            DisableControlAction(0, 114, true) -- Disable fly attack
            DisableControlAction(0, 257, true) -- Disable attack 2
            DisableControlAction(0, 331, true) -- Disable melee attack 3
            DisableControlAction(0, 68, true)  -- Disable melee attack 4
            DisableControlAction(0, 264, true) -- Disable attack 5

            Wait(0)
        end
    end)
end

-- Sicherstellen, dass REVOLUTION.SafeZoneLeaveFunction korrekt ist
Config.SafeZoneLeaveFunction = function(playerPed, vehicle)
    isInZone = false
    NetworkSetFriendlyFireOption(true)
    SetVehicleMaxSpeed(vehicle, GetVehicleHandlingFloat(vehicle, 'CHandlingData', 'fInitialDriveMaxFlatVel'))
end

Last updated