HRScripts Documentation
  • HRScripts Documentation
  • Resources
    • 📚HRLib
      • Classes
        • HRLibConfig
        • HRLibClientFPlayer
        • HRLibServerFPlayer
        • HRLibClientIPlayer
        • HRLibServerIPlayer
        • HRLibCloseIPlayer
        • HRLibCloseFPlayer
        • HRLibBlipOptions
        • HRLibBlipForCoordOptions
        • HRLibBlipForEntityOptions
        • HRLibBlipForAreaOptions
        • HRLibBlipForPickupOptions
        • HRLibInputDialogueTextOptions
        • HRLibVehicleProperties
      • Modules
        • Bridge
          • Shared
          • Client
          • Server
        • Callbacks
          • Shared
          • Client
          • Server
        • Closest
          • Client
        • Controls Disable
          • Client
        • CreateBlip
          • Client
        • DiscordMsg
          • Server
        • DoesIdExist
          • Shared
        • FPlayer
          • Shared
          • Client
          • Server
        • GetPedsInVehicle
          • Client
        • GetPedWeapons
          • Client
        • GetPlayers
          • Client
        • GetVehicleDoorStatus
          • Client
        • GetVehicleFromPlate
          • Client
        • Interface
          • Client
          • Server
        • IPlayer
          • Client
          • Server
        • PlayerIdentifiers
          • Server
        • RadomValueWithNoRepetition
          • Shared
        • RegCommand
          • Client
          • Server
        • Resources
          • Shared
          • Server
        • SpawnVehicle
          • Shared
        • Streaming
          • Client
        • string
          • Shared
        • table
          • Shared
        • ToVector
          • Shared
        • TrackingEntities
          • Client
            • Functions
            • Events
        • Values
          • Shared
          • Client
        • VehicleProperties
          • Client
          • Server
        • SetDefaultPedVariation
          • Shared
        • GetServerInfo
          • Server
    • HRGarages
      • Classes
        • HRGaragesConfig
        • HRGaragesVehicleInfo
        • HRGaragesClientFunctions
      • Exports
        • Server
    • 📦HRStorages
      • Exports
        • Client
        • Server
      • Callbacks
      • Commands
    • 🧹HRComserv
    • 🥷HRHostage
    • HRAdminMenu
      • Events
      • Exports
        • Client
        • Server
      • State Bags
    • ☑️HRWhitelist
    • HRExtraCommands
    • 🚦HRRealisticTraffic
    • 🗣️HRNPCDialogue
      • Classes
Powered by GitBook
On this page
  • Player State Bags
  • isStaff
  • isAllowed
  • group
  1. Resources
  2. HRAdminMenu

State Bags

Player State Bags

isStaff

A state bag attached to each player set to true if the player is staff and to false if it isn't

local isPlayerStaff = LocalPlayer.state.isStaff -- client side
local isPlayerStaff = Player(source).state.isStaff -- server side

print(isPlayerStaff) -- true/false

isAllowed

A state bag attached only to the staff members in the server, set with a table that contains status of all staff commands and if the player can use them or not

local allowedCommands = LocalPlayer.state.isAllowed -- client side
local allowedCommands = Player(source).state.isAllowed -- server side

print(json.encode(allowedCommands, { indent = true }))
--[[ Return format
    {
        removeStaff = true/false,
        setStaff = true/false,
        adminmenu = true/false,
        ['goto'] = true/false,
        bring = true/false,
        ban = true/false,
        unban = true/false,
        tpm = true/false,
        emergency = true/false,
        setJob = true/false,
        setMoney = true/false,
        spawnVeh = true/false,
        warn = true/false,
        freeze = true/false,
        kick = true/false,
        delAll = true/false
    }
]]

group

A state bag attached only to the staff members in the server, set with the current player's group

local playerGroup = LocalPlayer.state.group
local playerGroup = Player(source).state.group

print(playerGroup) -- string
PreviousServerNextHRWhitelist

Last updated 5 months ago