GetIPlayer

Get the fplayer

Parameters description

ParameterTypeDescriptionDefault

playerId

integer

target's player server Id

yes

Return:

  • HRLibServerIPlayer? (server side value)

  • HRLibClientIPlayer? (client side value)

Client content:

NameDescription

source, id, Id, ID, playerId, player, serverId, plId, serverPlId, sPlId

getting your player server Id

invincible_2

getting invincible 2

max.stamina

getting max stamina

max.armour

getting max armour

max.health

getting max health

currStamina

getting current stamina

vehicle

Current vehicle the player is in

veh.dmgModifier

getting vehicle damage modifier

veh.defModifier

getting vehicle defense modifier

weapon.dmgModifier

getting weapon damage modifier

weapon.defModifier

getting weapon defense modifier

weapon.defModifier_2

getting weapon defense modifier 2

weapon.malee.dmgModifier

getting malee weapon damage modifier

weapon.malee.defModifier

getting malee weapon defense modifier

coords

getting your coords ( vector3 )

currStealthNoise

getting the current stealth noise

group

getting your group

index

getting your index

invincible

getting your invincible status

name

getting your name

ped

getting your ped

pedIsFollowing

getting ped is following

rgbColor

getting your rgb color

team

getting your team

underWaterTimeRmng

getting your time remaining under water

entity.entity

getting your entity

entity.health

getting your health

entity.archetypeName

getting your ped model

(Example: a_f_m_beach_01)

entity.attachedTo

getting the attached entity

entity.model

getting your entity model

entity.mapDataOwner

getting your map data owner

entity.alpha

getting your alpha

entity.boneCount

getting your bone count

entity.forward.vector

getting your forward vector

entity.forward.x

getting your forward x

entity.forward.y

getting your forward y

entity.heightAboveGround

getting your height above the ground

entity.lodDist

getting your LOD distance

entity.matrix

getting your forwardVector, rightVector, upVector position

entity.pitch

getting your pitch

entity.populationType

getting your population type

entity.quaternion

getting your quaternion

entity.roll

getting your roll

entity.speed

getting your speed

entity.submergedLvl

getting your submerged level

entity.type

getting your type

entity.uprightValue

getting your upright value

entity.velocity

getting your velocity

entity.lastHitMaterial

getting the last hit material by you

entity.nearestPl

getting the nearest player from you

entity.objectIndex

getting your object index

entity.offsetFromEGivenWorldCoords

getting the offset from E given world coords

entity.offestFromEInWorldCoords

getting the offset from EIn world coords

entity.vehIndex

getting the vehicle index of the veh you're sitting in

entity.hasLoadedCollisionAroundE

getting your has loaded collision around E status

entity.hasBeenDamagedByAnyObject

getting your has been damaged by any object status

entity.hasBeenDamagedByAnyVeh

getting your has been damaged by any veh status

entity.hasCollidedWithAnything

getting your has collided with anything status

entity.isAttached

getting your attach status

entity.isAttachedToAnyObject

getting your attached to any object status

entity.isAttachedToAnyPed

getting your attached to any ped status

entity.isAttachedToAnyVeh

getting your attached to any veh status

entity.isDead

getting your dead status

entity.isInAir

getting your status for are you in the sky/air

entity.isInWater

getting your status for are you in water

entity.isOccluded

getting your occluded status

entity.isOnScreen

getting your on screen status

entity.isStatic

getting your static status

entity.isUpsideDown

getting your upside down status

entity.isVisible

getting your visibility status

entity.isVisibleToScript

getting your visible to script status

entity.isWaitingForWorldCollision

getting your waiting for world collision status

entity.isFreezed

getting your freeze position status (you're freezed or not)

Server content:

NameDescription

source, id, Id, ID, playerId, player, serverId, plId, serverPlId, sPlId

getting Id

name

getting name

identifier.license

getting license identifier

identifier.license2

getting license2 identifier

identifier.steam

getting steamHex identifier

identifier.discord

getting discordId identifier

identifier.xbl

getting xbl identifier

identifier.live

getting live identifier

identifier.ip

getting ip identifier

identifier.fivem

getting fivem identifier

identifiersNum

getting count of all available pl identifier

ping

getting ping

max.health

getting max health

max.armour

getting max armour

ped

getting ped

tokens.t1

getting token ( 0 )

tokens.t2

getting token ( 1 )

tokens.t3

getting token ( 2 )

tokens.t4

getting token ( 3 )

tokens.allString

getting all tokens in string format

tokens.num

getting all available pl tokens count

camRotation

getting camera rotation

endPoint

getting player Endpoint

fakeWantedLvl

getting fake wanted level

guid

getting guid

invincible

getting invincible

lastMsg

getting last message

rountingBucket

getting rounting bucket

team

getting team

wanted.centrePos

getting centre position while wanted

wanted.lvl

getting wanted level

weapon.dmgModifier

getting weapon damage modifier

weapon.defModifier

getting weapon defense modifier

weapon.defModifier_2

getting weapon defense modifier 2

weapon.maleeWeaponDmgModifier

malee weapon damage modifier

coords

current coords ( vector3 format )

heading

current heading

health

current health

entity.attachedTo

the entity, the player's attached to

entity.model

model

entity.populationType

population type

entity.rotation

rotation

entity.rotationVelocity

rotation velocity

entity.rountingBucket

rounting bucket

entity.script

entity script

entity.speed

entity speed

entity.type

entity type

entity.velocity

entity velocity

entity.sourceOfDamage

the entity that hit the player last ( ONLY ONESYNC AVAILABLE )

entity.sourceOfDeath

the entity that killed you ( ONLY ONESYNC AVAILABLE )

entity.isVisible

player/entity visible status

entity.netId

the player/entity's network Id

entity.isFreezed

checks if the player/entity's freezed

  • Example:

HRLib = exports.HRLib:getLibFunctions() -- Getting HRLib client or server functions list

-- In server
HRLib.RegCommand('myInfo', false, true, function(args, rawCommand, IPlayer, FPlayer)
    if args[1] == 'myName' then
        FPlayer.Notify(IPlayer.name, 'info', 2500) -- Printing your name notification message
    elseif args[1] == 'mySteamHex' then
        FPlayer.Notify(IPlayer.identifier.steam 'info', 2500) -- Printing your steamHex notification message
    elseif args[1] == 'myLicense' then
        FPlayer.Notify(IPlayer.identifier.license 'info', 2500) -- Printing your license notification message
    end
end, false)

-- In client
HRLib.RegCommand('myInfo', function(args, rawCommand, IPlayer, FPlayer)
    if args[1] == 'myName' then
        FPlayer.Notify(IPlayer.name, 'info', 2500) -- Printing your name as notification message
    elseif args[1] == 'mySpeed' then
        FPlayer.Notify(IPlayer.speed, 'info', 2500) -- Printing your speed as notification message
    elseif args[1] == 'nearestPlayerToMe' then
        FPlayer.Notify(tostring(IPlayer.nearestPl), 'info', 2500) -- Printing the nearest player to you as notification message
    end
end, false)

Last updated