_SET_PLAYER_UNDERWATER_TIME_REMAINING
Docslocal retval = SetPlayerUnderwaterTimeRemaining(player, percentage)Description
Seems to lock the underwater timer of the specified player. Set percentage to 50.0 will reduce the value of GET_PLAYER_UNDERWATER_TIME_REMAINING to 5.0.
If you want to increase the underwater time for ped, use SET_PED_MAX_TIME_UNDERWATER instead.
Using this native after SET_PED_MAX_TIME_UNDERWATER WILL NOT get what you want. For example, if you set the max time underwater to 100.0 seconds using SET_PED_MAX_TIME_UNDERWATER and then call this native and set the percentage to 50.0, you will not get 50.0, instead 2.0.
Parameters
| Name | Type | Description |
|---|---|---|
player | Player | Player id. |
percentage | float | Maximum is `100.0`. Any value above `100.0` and less than `0.0` will have no effect on [GET_PLAYER_UNDERWATER_TIME_REMAINING](#\_0xA1FCF8E6AF40B731). |
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
AnyReturn type varies depending on context.