Disable Player Components [client]

This can be used to determine if a player has a certain job role or not.

local GtaHud = {
    [1] = false, --WANTED_STARS
    [2] = true, --WEAPON_ICON
    [3] = false, --CASH
    [4] = false, --MP_CASH
    [5] = true, --MP_MESSAGE
    [6] = false, --VEHICLE_NAME
    [7] = false, --AREA_NAME
    [8] = false, --VEHICLE_CLASS
    [9] = false, --STREET_NAME
    [10] = true, --HELP_TEXT
    [11] = true, --FLOATING_HELP_TEXT_1
    [12] = true, --FLOATING_HELP_TEXT_2
    [13] = false, --CASH_CHANGE
    [14] = true, --RETICLE
    [15] = true, --SUBTITLE_TEXT
    [16] = true, --RADIO_STATIONS
    [17] = true, --SAVING_GAME
    [18] = true, --GAME_STREAM
    [19] = true, --WEAPON_WHEEL
    [20] = true, --WEAPON_WHEEL_STATS
    [21] = true, --HUD_COMPONENTS
    [22] = true, --HUD_WEAPONS
}

Citizen.CreateThread(function()
    for k,v in pairs(GtaHud) do
        if not v then
            SetHudComponentPosition(k,999999.0,999999.0)
        else
            ResetHudComponentValues(k)
        end
    end
end)

Last updated