How to Import
Both Client and Server APIs are exported under the same name. Simply import them in your scripts using:Client API
Diseases Management
Interact with diseases locally.-
API.Diseases.Get(diseaseId)Retrieves a specific disease instance.- Parameters:
diseaseId(string) - Returns:
Diseaseobject ornil
- Parameters:
-
API.Diseases.GetAll()Retrieves all diseases currently tracked for the local player.- Returns:
tableof all diseases
- Returns:
-
API.Diseases.Give(diseaseId)Activates a specific disease on the local player.- Parameters:
diseaseId(string)
- Parameters:
-
API.Diseases.Heal(diseaseId, completeHeal)Heals a specific disease (optionally fully curing it).- Parameters:
diseaseId(string)completeHeal(boolean | nil) - Iftrue, completely cures the disease immediately.
- Parameters:
Patient Management
API.Patient.Get()Returns the active patient object for the local player.- Returns:
Patientobject
- Returns:
Utility Functions
API.Utils.GetBodyPerceivedTemperature(ped, localTemperature)Calculates the perceived temperature of a ped based on the environment and their clothing.- Parameters:
ped(number) - The entity ID of the ped.localTemperature(number) - The ambient temperature.
- Returns:
number
- Parameters:
Server API
The unified Server API provides a single entry point for all script functionality related to server-side logic and sync.Diseases Management
-
API.Diseases.Give(playerId, diseaseId)Gives a specific disease to a player, respecting any immunities they might have.- Parameters:
playerId(number) - The server ID of the player.diseaseId(string)
- Returns:
boolean(trueif successful,falseif player not found or immune).
- Parameters:
-
API.Diseases.Heal(playerId, diseaseId, completeHeal)Heals a disease for a specific player.- Parameters:
playerId(number) - The server ID of the player.diseaseId(string)completeHeal(boolean | nil) - Whether to completely heal it.
- Returns:
boolean(trueif successful,falseotherwise).
- Parameters:
Patient Management
API.Patient.Get(playerId)Retrieves the patient data for a specific player.- Parameters:
playerId(number) - Returns:
Patientobject ornil
- Parameters:
Immunity Management
-
API.Immunity.Give(playerId, diseaseId, duration)Grants a player immunity to a specific disease for a set duration.- Parameters:
playerId(number)diseaseId(string)duration(number) - Duration of the immunity (pass-1or omit for permanent).
- Returns:
boolean
- Parameters:
-
API.Immunity.Remove(playerId, diseaseId)Strips the immunity for a specific disease from a player.- Parameters:
playerId(number)diseaseId(string)
- Returns:
boolean
- Parameters:
Bones Management
-
API.Bones.Set(playerId, boneId, damage, damageType)Sets the damage value for a specific bone for a player in the script’s logic. Note: This will not apply actual health damage to the player’s ped. You must apply the health damage yourself using natives.- Parameters:
playerId(number)boneId(number) - The ID of the bone.damage(number) - The amount of damage.damageType(string | nil) - Type of damage applied.
- Example:
- Parameters:
-
API.Bones.Clear(playerId, boneId)Clears any damage taken on a specific bone.- Parameters:
playerId(number)boneId(number)
- Parameters:
-
API.Bones.Get(playerId, boneId)Retrieves the damage data for a specific bone.- Parameters:
playerId(number)boneId(number)
- Returns:
BoneDamageobject ornil
- Parameters:
Classes
BoneDamage
Properties:damageType(string) - The categorical type of damage applied to the bone (e.g., ‘bruise’, ‘cut’, ‘projectile’).damage(number) - The severity/amount of damage the bone has received.
