This documentation covers the Client API (cAPI) functions available in the FRP Framework. The API provides essential functionality for player interactions, world manipulation, UI elements, and game mechanics.
Table of Contents
Character Management
Player Model & Appearance
Animations & Interactions
Health & Stats Management
Player State Management
Wanted System
Sickness System
Character Management
Player Model & Appearance
cAPI.SetPlayerPedModel
Changes the player's ped model with proper loading and cleanup.
Parameters:
model (string): Model name to set
Features:
Validates model before loading
Handles model loading wait
Sets random outfit variation
Fixes stuck ammo clothing pieces
Cleans up model from memory
Example:
cAPI.SetPedScale
Sets the scale of a ped entity.
Parameters:
ped (number): Ped entity handle
num (number): Scale multiplier (default: 1.0)
Example:
cAPI.SetPlayerScale
Sets player scale based on character height from appearance data.
Example:
cAPI.SetPlayerAppearence
Applies the complete character appearance including scale and outfits.
Features:
Applies appearance for MP models
Sets outfit presets for custom models
Updates player scale
Example:
cAPI.SetPlayerDefaultModel
Sets the player model to the stored default model.
Example:
cAPI.ReloadSkin
Reloads the player's skin with timeout protection and health preservation.
Features:
5-second timeout between reloads
Saves and restores health/stamina
Updates appearance and scale
Shows timeout error if called too frequently
Example:
cAPI.SetPlayerWhistle
Configures player whistle characteristics from appearance data.
Example:
cAPI.FixStuckAmmoClothingPiece
Fixes stuck ammunition and pants clothing pieces on MP models.
Example:
cAPI.IsModelMp
Checks if a ped is using a multiplayer model.
Parameters:
ped (number): Ped entity handle
Returns:
boolean: True if using MP model
Example:
Animations & Interactions
cAPI.TaskScriptedAnim
Plays scripted animations with proper setup.
Parameters:
scriptedAnimName (string): Animation name ("eat")
Example:
Health & Stats Management
cAPI.VaryPedHealth
Varies ped health instantly or over time.
Parameters:
ped (number): Ped entity handle
variation (number): Health change amount
variationTime (number, optional): Time in seconds for gradual change
Example:
cAPI.VaryPedStamina
Varies ped stamina instantly or over time.
Parameters:
ped (number): Ped entity handle
variation (number): Stamina change amount (-1000.0 to 1000.0)
variationTime (number, optional): Time in seconds for gradual change
Example:
cAPI.VaryPedCore
Varies ped core values (health/stamina cores) instantly or over time.
Parameters:
ped (number): Ped entity handle
core (number): Core type (0 = health, 1 = stamina)
variation (number): Core change amount
variationTime (number, optional): Time in seconds for gradual change
goldenEffect (boolean, optional): Show golden effect
cAPI.VaryPedCore(PlayerPedId(), 0, 50) -- Heal health core
cAPI.VaryPedCore(PlayerPedId(), 1, -25, 3) -- Drain stamina core over 3 seconds
cAPI.VaryPlayerHealth(100, 5) -- Heal 100 HP over 5 seconds
cAPI.VaryPlayerStamina(50) -- Instant stamina boost
cAPI.VaryPlayerCore(0, 25) -- Heal health core
cAPI.SetHealth(200)
local health = cAPI.GetHealth()
print("Current health:", health)
cAPI.SaveHealth() -- Save current state
-- ... do something that changes health ...
cAPI.ReturnLastStatus() -- Restore saved state
if cAPI.IsPlayerLassoed() then
print("Player is lassoed!")
end
cAPI.TeleportPlayerToWaypoint()
cAPI.AddWantedTime(true, 10) -- Wanted for 10 minutes
cAPI.AddWantedTime(false) -- Clear wanted status
if cAPI.IsWanted() then
print("Player is wanted by law!")
end
-- Health management with restoration
cAPI.SaveHealth()
-- ... perform actions that modify health ...
cAPI.ReturnLastStatus()
-- Safe skin reload with error handling
cAPI.ReloadSkin() -- Handles timeout automatically
-- Wanted system usage
if cAPI.IsWanted() then
cAPI.AddWantedTime(true, 5) -- Add 5 more minutes
else
cAPI.AddWantedTime(true, 10) -- Set 10 minute wanted level
end