GetPlayerVehicle: Difference between revisions
From Onset Developer Wiki
No edit summary |
No edit summary |
||
Line 34: | Line 34: | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{Template:VehicleFunctions}} |
Latest revision as of 09:58, 12 December 2019
Description
Returns the vehicle identifier the player is in.
Syntax
GetPlayerVehicle(player)
Parameters
- player
The player identifier.
Return Value
- Returns the vehicle identifier the player is in. Returns 0 if not in any vehicle.
Example
AddCommand("colorv", function(playerid, red, green, blue)
local vehicleid = GetPlayerVehicle(playerid)
if vehicleid == 0 then
AddPlayerChat(playerid, "You must be in a vehicle...")
return
end
red = tonumber(red)
green = tonumber(green)
blue = tonumber(blue)
if red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255 then
AddPlayerChat(playerid, "Usage: /colorv <red> <green> <blue>")
return
end
SetVehicleColor(vehicleid, RGB(red, green, blue, 255))
end)
See also
- CreateVehicle
- DestroyVehicle
- IsValidVehicle
- GetVehicleCount
- GetAllVehicles
- GetVehicleModel
- GetVehicleModelName
- SetVehicleRespawnParams
- IsVehicleStreamedIn
- GetStreamedVehiclesForPlayer
- GetStreamedVehicles
- SetVehicleLocation
- GetVehicleLocation
- SetVehicleRotation
- GetVehicleRotation
- SetVehicleHeading
- GetVehicleHeading
- SetVehicleHealth
- GetVehicleHealth
- SetVehicleLicensePlate
- GetVehicleVelocity
- GetVehicleDriver
- GetVehiclePassenger
- GetVehicleNumberOfSeats
- SetVehicleColor
- GetVehicleColor
- SetVehicleLinearVelocity
- SetVehicleAngularVelocity
- GetVehicleGear
- SetVehicleHoodRatio
- GetVehicleHoodRatio
- SetVehicleTrunkRatio
- GetVehicleTrunkRatio
- StartVehicleEngine
- StopVehicleEngine
- GetVehicleEngineState
- SetVehicleLightEnabled
- GetVehicleLightState
- SetVehicleDamage
- GetVehicleDamage
- AttachVehicleNitro