GetIsPlayerDrivingOnHighway
Docslocal retval = GetIsPlayerDrivingOnHighway(playerId)Parameters
| Name | Type | Description |
|---|---|---|
playerId | Player | The local index of the player to check (see [PLAYER_ID](#\_0x4F8644AF03D0E0D6)) |
Quick Snippet: Get PlayerplayerId
playerIdUse 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
BOOLReturns TRUE (1) or FALSE (0).
Examples
Official
-- Get and store the local player index
local playerId = PlayerId()
if GetIsPlayerDrivingOnHighway(playerId) then
print("Player is driving on a highway!")
else
print("Player is not driving on a highway.")
end