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
        • Resource
          • Shared
          • Server
        • SpawnVehicle
          • Shared
        • Streaming
          • Client
        • string
          • Shared
        • table
          • Shared
        • ToVector
          • Shared
        • TrackingEntities
          • Client
            • Functions
            • Events
        • Values
          • Shared
          • Client
        • VehicleProperties
          • Client
          • Server
        • SetDefaultPedVariation
          • Shared
    • 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
  • ClosestPed
  • ClosestVehicle
  • ClosestObject
  • ClosestIPlayer
  1. Resources
  2. HRLib
  3. Modules
  4. Closest

Client

ClosestPed

Function to get the closest ped to the player

function HRLib.ClosestPed(returnClosePeds: boolean?):
{ ped: integer, distance: number }? closestPed,
{ ped: integer, distance: number }[]? closePeds

Parameters description

  • returnClosePeds - sets whether or not return all close peds found

Return description

  • closestPed - the closest ped to the player with its ped Id and distance between the peds

  • closePeds - all close peds found around the player with their ped Ids and distances between them and the player (only available when returnClosePeds is true)

ClosestVehicle

Function to get the closest vehicle to the player

function HRLib.ClosestVehicle(returnCloseVehs: boolean?):
{ vehicle: integer, distance: number }? closestVehicle,
{ vehicle: integer, distance: number }[]? closeVehicles

Parameters description

  • returnCloseVehs - sets whether or not return all close vehicles found

Return description

  • closestVehicle - the closest vehicle to the player with its vehicle Id and distance between the player and vehicle

  • closeVehicles - all close vehicles found around the player with their vehicle Ids and distances between the player and them (only available when returnCloseVehs is true)

ClosestObject

Function to get the closest object to the player

function HRLib.ClosestObject(returnCloseObjects: boolean?):
{ entity: integer, distance: number }? closestObject,
{ entity: integer, distance: number }[]? closeObjects

Parameters description

  • returnCloseObjects - sets whether or not return all close objects found

Return description

  • closestObject - the closest object to the player with its object Id and distance between the player and object

  • closeObjects - all close objects found around the player with their object Ids and distances between the player and them (only available when returnCloseObjects is true)

ClosestIPlayer

Function to get the information of IPlayer for the closest player to the current player

function HRLib.ClosestIPlayer(returnCloseIPlayers: boolean?):
HRLibCloseIPlayer? closestIPlayer,
HRLibCloseIPlayer[]? closeIPlayers

Parameters description

  • returnCloseIPlayers - sets whether or not return all close IPlayers found around the player

Return description

  • closestIPlayer - the closest player's IPlayer information

  • closeIPlayers - all close players' IPlayer information (only available when returnCloseIPlayers is true)

PreviousClosestNextControls Disable

Last updated 1 month ago

📚