Documentation

Want to improve the docs? Take a look at scripting-api-data!
Found a bug? jc3mp/bugs is a good place to let us know.

LocalPlayer

Constructible This class can not be instantiated from your script. Do not try to use the `new` keyword on this class. Auto Destroy Instances of this class will be deleted automatically. Custom Properties You cannot add your own properties to instances of this class. They will not be saved and can cause undefined behavior.

Properties

Name Type Description
position Vector3f the LocalPlayer's position in the game world
rotation Vector3f the LocalPlayer's rotation in the game world
lookAt Vector3f read only
camera Camera read only the players camera object
frozen boolean Whether the players character is frozen or not
controlsEnabled boolean Whether the player can control his character or not
baseState number
networkId number read only the network id of this entity. It is not unique across different entities and will be re-assigned once this entity was destroyed
dimension number read only world dimension of the LocalPlayer.
playerStateBits1 number read only
playerStateBits2 number read only
wingsuit Wingsuit read only
healthEffects HealthEffect read only

Functions

LocalPlayer.SetAbilityEnabled(number ability, boolean enabled)

Enable the local player to use certain ingame abilities

Available abilities

Name Value
GRAPPLING_HOOK 0xCB836D80
PARACHUTE 0xCEEFA27A
WINGSUIT 0xE060F641

returns: void

Parameter

Name Type Description
ability number the designated ability ID (see above)
enabled boolean set to true to enable the ability, false to disable it

Example

function disableAllAbilities(){
  jcmp.localPlayer.SetAbilityEnabled(0xCB836D80, false); //Disable grappling
  jcmp.localPlayer.SetAbilityEnabled(0xCEEFA27A, false); //Disable parachute
  jcmp.localPlayer.SetAbilityEnabled(0xE060F641, false); //Disable wingsuit
}
disableAllAbilities();           

LocalPlayer.IsAbilityEnabled(number ability)

Check if a certain ingame ability has been enabled for the local player or not

returns: boolean

Parameter

Name Type Description
ability number

Example

function isWingsuitEnabled(){
  if(jcmp.localPlayer.IsAbilityEnabled(0xE060F641) == true){
    //The Wingsuit is enabled, execute code here
  }
}
isWingsuitEnabled();          

LocalPlayer.GetRenderPosition(number dtf)

returns the render position

returns: Vector3f

Parameter

Name Type Description
dtf number delta timing

LocalPlayer.GetRenderTransform(number dtf)

returns the render transform matrix

returns: Matrix

Parameter

Name Type Description
dtf number delta timing

LocalPlayer.GetBoneTransform(number boneid, number dtf)

returns the bone transform matrix

Available bones

Name Value
REFERENCE 0x8EB2FD7C
OFFSET 0x4AAA87DB
HIPS 0x68C6A89F
SPINE 0xE28C84B
SPINE_2 0xE4DBE36F
SPINE_3 0x6FE84908
STERNUM 0x9DCAB8BF
NECK 0xA1C96158
HEAD 0xA877D9CC
JAW 0x92F8D847
MID_LOWER_LIP 0xEA3E047C
LEFT_MOUTH_CORNER 0xE9F7F4C9
RIGHT_MOUTH_CORNER 0xF8C71902
NOSE 0x4495EABA
MID_UPPER_LIP 0x87AE44CB
UPPER_LIDS 0xC851BC59
LOWER_LIDS 0x9ED86F9E
LEFT_EYEBROW_MID 0xD3FBF46E
RIGHT_EYEBROW_MID 0xE75361A8
LEFT_EYE 0x96A32E27
RIGHT_EYE 0x24FA932B
LEFT_SHOULDER 0x8735207D
LEFT_ARM 0x4DF0A2B1
LEFT_FORE_ARM 0xDEB7751B
LEFT_HAND 0x57C83F95
LEFT_HAND_ATTACH 0x4190BFF7
LEFT_HAND_THUMB 0x3C7AC14F
LEFT_HAND_THUMB_2 0xEF65A0C0
LEFT_HAND_THUMB_3 0x2EF7C25D
LEFT_HAND_INDEX 0xFC8B8AE8
LEFT_HAND_INDEX_2 0xB275E0DC
LEFT_HAND_INDEX_3 0xA02A2C09
LEFT_HAND_MIDDLE 0x9B641407
LEFT_HAND_MIDDLE_2 0xBB9B9265
LEFT_HAND_MIDDLE_3 0x40553E55
LEFT_IN_HAND_RING 0xF64929C5
LEFT_HAND_RING 0xDF6E85D2
LEFT_HAND_RING_2 0xADD7F8D8
LEFT_HAND_RING_3 0x37EDFBE6
LEFT_IN_HAND_PINKY 0x142B3DFF
LEFT_HAND_PINKY 0xC104DEE3
LEFT_HAND_PINKY_2 0x869AB17
LEFT_HAND_PINKY_3 0xE3BBD91D
LEFT_HAND_ATTACH_2 0x7DC90FBE
LEFT_FORE_ARM_ROLL 0x9C12B794
RIGHT_SHOULDER 0x302EEE80
RIGHT_ARM 0x19D4B6CF
RIGHT_FORE_ARM 0xBD2F01EA
RIGHT_HAND 0x69E77FA6
RIGHT_HAND_ATTACH 0x65C5D2EB
RIGHT_HAND_THUMB 0x8F745C4E
RIGHT_HAND_THUMB_2 0xFADC7D09
RIGHT_HAND_THUMB_3 0xACA0D4E6
RIGHT_HAND_INDEX 0xB26EE68B
RIGHT_HAND_INDEX_2 0xE64CD51C
RIGHT_HAND_INDEX_3 0x3D143817
RIGHT_HAND_MIDDLE 0x3EF00B1A
RIGHT_HAND_MIDDLE_2 0x4DD19349
RIGHT_HAND_MIDDLE_3 0x92662F93
RIGHT_IN_HAND_RING 0x422FF300
RIGHT_HAND_RING 0xC4351CB
RIGHT_HAND_RING_2 0x7165D1D3
RIGHT_HAND_RING_3 0x2EE173DF
RIGHT_IN_HAND_PINKY 0x153AD952
RIGHT_HAND_PINKY 0x477CE2E
RIGHT_HAND_PINKY_2 0x197F6405
RIGHT_HAND_PINKY_3 0x7A36193E
RIGHT_HAND_ATTACH_2 0x8A9856CD
RIGHT_FORE_ARM_ROLL 0xC9FC0323
BACK_ATTACH 0x204A8793
BACK_ATTACH_2 0xB7D0AD64
LEFT_UP_LEG 0x26392BC2
LEFT_LEG 0x782BF8F9
LEFT_FOOT 0x661134AC
LEFT_TOE_BASE 0xB31EE9AA
LEFT_LEG_ROLL 0x84D5F65C
LEFT_HOLSTER_ATTACH 0x63ABE53F
LEFT_UP_LEG_ROLL 0x7CA59BC0
RIGHT_UP_LEG 0x8F232B15
RIGHT_LEG 0xA89A815D
RIGHT_FOOT 0xFF3E004B
RIGHT_TOE_BASE 0xDD2D6F75
RIGHT_LEG_ROLL 0xCFA333AA
RIGHT_HOLSTER_ATTACH 0x7BD7F313
RIGHT_UP_LEG_ROLL 0x272175A5
LEFT_HAND_IK_TARGET 0xA73E08C1
RIGHT_HAND_IK_TARGET 0xF7EEABA9

returns: Matrix

Parameter

Name Type Description
boneid number a bone id from the list above
dtf number delta timing

Stay informed

By becoming the newest member of our growing forums, we and hundreds of other players will always keep you up to date on everything JC3:MP related.