RestorePlayerStamina
DocsRestorePlayerStamina(player, percentage)Description
Adds a percentage to a players stamina
Parameters
| Name | Type | Description |
|---|---|---|
player | Player | player to restore the stamina for |
percentage | float | seems to be a percentage that ranges from 0.0 to 1.0 (1.0 being 100%) |
Quick Snippet: Get Playerplayer
playerUse this to get the local player ID or a target player's server ID.
-- Get the local player index (client-side)
local playerId = PlayerId()
-- Get the local player's server ID (for server events)
local serverId = GetPlayerServerId(playerId)
print("Player ID: " .. playerId)
print("Server ID: " .. serverId)
-- Get player ped from a server ID:
-- local targetPed = GetPlayerPed(GetPlayerFromServerId(targetServerId))Returns
voidThis native does not return a value.
Examples
Official
Citizen.CreateThread(function()
while true do
RestorePlayerStamina(PlayerId(), 0.3)
Citizen.Wait(15000) -- 15 seconds
end
end)