API Reference
Complete reference for the Perc Tarkov scripting API.
Global Functions
| Function | Signature | Description |
|---|---|---|
| Log | void Log(string msg) | Prints a message to the console |
| GetLocalPlayer | Player@ GetLocalPlayer() | Returns the local player object |
| GetPlayers | array<Player@> GetPlayers() | Returns all players in the raid |
| GetLootItems | array<LootItem@> GetLootItems() | Returns all loot items in the raid |
| GetDeltaTime | float GetDeltaTime() | Returns time since last frame in seconds |
| IsKeyDown | bool IsKeyDown(int keyCode) | Returns true if the specified key is currently held |
| IsKeyPressed | bool IsKeyPressed(int keyCode) | Returns true if the key was just pressed this frame |
| DrawLine | void DrawLine(Vector2 a, Vector2 b, Color col, float thickness) | Draws a line on screen |
| DrawText | void DrawText(Vector2 pos, string text, Color col, float size) | Draws text on screen |
| DrawRect | void DrawRect(Vector2 pos, Vector2 size, Color col, float rounding) | Draws a filled rectangle on screen |
| WorldToScreen | bool WorldToScreen(Vector3 world, Vector2& out screen) | Converts a 3D world position to 2D screen coordinates |
Player Object
| Function | Signature | Description |
|---|---|---|
| GetPosition | Vector3 GetPosition() | Returns the player's world position |
| GetHealth | float GetHealth() | Returns current health (0-100) |
| GetName | string GetName() | Returns the player's name |
| IsAlive | bool IsAlive() | Returns true if the player is alive |
| IsVisible | bool IsVisible() | Returns true if the player is visible to you |
| GetBonePosition | Vector3 GetBonePosition(int boneId) | Returns the world position of a specific bone |
| GetDistance | float GetDistance() | Returns distance to local player in meters |
| IsScav | bool IsScav() | Returns true if the player is a Scav |
| IsPMC | bool IsPMC() | Returns true if the player is a PMC |
LootItem Object
| Function | Signature | Description |
|---|---|---|
| GetPosition | Vector3 GetPosition() | Returns the item's world position |
| GetName | string GetName() | Returns the item name |
| GetValue | int GetValue() | Returns the item's ruble value |
| GetDistance | float GetDistance() | Returns distance to local player |
| IsRare | bool IsRare() | Returns true if the item is rare |
Types
Vector3
float x, y, zVector2
float x, yColor
Color(float r, float g, float b, float a)
Color(int hex)Bone IDs
| ID | Bone |
|---|---|
| 0 | Head |
| 1 | Neck |
| 2 | Chest |
| 3 | Pelvis |
| 4 | Left Hand |
| 5 | Right Hand |
| 6 | Left Foot |
| 7 | Right Foot |
Last updated on