Skip to Content

API Reference

Complete reference for the Perc Tarkov scripting API.

Global Functions

FunctionSignatureDescription
Logvoid Log(string msg)Prints a message to the console
GetLocalPlayerPlayer@ GetLocalPlayer()Returns the local player object
GetPlayersarray<Player@> GetPlayers()Returns all players in the raid
GetLootItemsarray<LootItem@> GetLootItems()Returns all loot items in the raid
GetDeltaTimefloat GetDeltaTime()Returns time since last frame in seconds
IsKeyDownbool IsKeyDown(int keyCode)Returns true if the specified key is currently held
IsKeyPressedbool IsKeyPressed(int keyCode)Returns true if the key was just pressed this frame
DrawLinevoid DrawLine(Vector2 a, Vector2 b, Color col, float thickness)Draws a line on screen
DrawTextvoid DrawText(Vector2 pos, string text, Color col, float size)Draws text on screen
DrawRectvoid DrawRect(Vector2 pos, Vector2 size, Color col, float rounding)Draws a filled rectangle on screen
WorldToScreenbool WorldToScreen(Vector3 world, Vector2& out screen)Converts a 3D world position to 2D screen coordinates

Player Object

FunctionSignatureDescription
GetPositionVector3 GetPosition()Returns the player's world position
GetHealthfloat GetHealth()Returns current health (0-100)
GetNamestring GetName()Returns the player's name
IsAlivebool IsAlive()Returns true if the player is alive
IsVisiblebool IsVisible()Returns true if the player is visible to you
GetBonePositionVector3 GetBonePosition(int boneId)Returns the world position of a specific bone
GetDistancefloat GetDistance()Returns distance to local player in meters
IsScavbool IsScav()Returns true if the player is a Scav
IsPMCbool IsPMC()Returns true if the player is a PMC

LootItem Object

FunctionSignatureDescription
GetPositionVector3 GetPosition()Returns the item's world position
GetNamestring GetName()Returns the item name
GetValueint GetValue()Returns the item's ruble value
GetDistancefloat GetDistance()Returns distance to local player
IsRarebool IsRare()Returns true if the item is rare

Types

Vector3

float x, y, z

Vector2

float x, y

Color

Color(float r, float g, float b, float a) Color(int hex)

Bone IDs

IDBone
0Head
1Neck
2Chest
3Pelvis
4Left Hand
5Right Hand
6Left Foot
7Right Foot
Last updated on