_IS_PLAYER_DRIVING_DANGEROUSLY
Docslocal retval = IsPlayerDrivingDangerously(player, type)Description
enum eViolationType {
// Checks if the player is driving on pedestrians walk ways
VT_PAVED_PEDESTRIAN_AREAS = 0,
// Checks if the player is running through red lights
// This takes some time to return true.
VT_RUNNING_REDS = 1,
// checks if the player is driving on the wrong side of the road
VT_AGAINST_TRAFFIC = 2
};Used solely in "Al Di Napoli" with type 2 for a voiceline.
Parameters
| Name | Type | Description |
|---|---|---|
player | Player | Player ID |
type | int | Refer to `eViolationType`. |
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
BOOLReturns TRUE (1) or FALSE (0).