WarpPlayerIntoVehicle: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This | This function is used to warp or force a player into a vehicle. There are no animations involved when this happens. | ||
==Syntax== | ==Syntax== | ||
Line 10: | Line 8: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''player:''' The player in which you wish to force inside the vehicle | ||
*'''vehicle:''' The vehicle you wish to force the player inside | |||
===Optional Arguments=== | ===Optional Arguments=== | ||
{{OptionalArg}} | {{OptionalArg}} | ||
*''' | *'''seat:''' An integer representing the seat ID. ''0'' represents the driver, any higher represent passenger seats | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if | Returns ''true'' if the operation is successful, ''false'' otherwise. | ||
==Example== | ==Example== | ||
This example | This example creates a vehicle and warps a player inside immediately | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | addCommandHandler ( startrace, createstartvehicles ) --add a command to start race | ||
function createstartvehicles ( playerSource, commandName, car, x, y, z ) --the function allows specification of your car, and the position | |||
-- | racevehicle = createVehicle ( car, x, y, z ) --create a vehicle at a position specified by the startrace command | ||
warpPlayerintoVehicle ( playerSource, racevehicle ) --warp them straight into the vehicle | |||
end | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{ | {{Vehicle functions}} |
Revision as of 21:39, 13 August 2006
This function is used to warp or force a player into a vehicle. There are no animations involved when this happens.
Syntax
bool warpPlayerintoVehicle ( player player, vehicle vehicle, [ int seat=0 ] )
Required Arguments
- player: The player in which you wish to force inside the vehicle
- vehicle: The vehicle you wish to force the player inside
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- seat: An integer representing the seat ID. 0 represents the driver, any higher represent passenger seats
Returns
Returns true if the operation is successful, false otherwise.
Example
This example creates a vehicle and warps a player inside immediately
addCommandHandler ( startrace, createstartvehicles ) --add a command to start race function createstartvehicles ( playerSource, commandName, car, x, y, z ) --the function allows specification of your car, and the position racevehicle = createVehicle ( car, x, y, z ) --create a vehicle at a position specified by the startrace command warpPlayerintoVehicle ( playerSource, racevehicle ) --warp them straight into the vehicle end
See Also
- addVehicleUpgrade
- attachTrailerToVehicle
- blowVehicle
- createVehicle
- detachTrailerFromVehicle
- fixVehicle
- getOriginalHandling
- getTrainDirection
- getTrainPosition
- getTrainSpeed
- getTrainTrack
- getVehicleColor
- getVehicleCompatibleUpgrades
- getVehicleController
- getVehicleDoorOpenRatio
- getVehicleDoorState
- getVehicleEngineState
- getVehicleHandling
- getVehicleHeadLightColor
- getVehicleLandingGearDown
- getVehicleLightState
- getVehicleMaxPassengers
- getVehicleModelFromName
- getVehicleName
- getVehicleNameFromModel
- getVehicleOccupant
- getVehicleOccupants
- getVehicleOverrideLights
- getVehiclePaintjob
- getVehiclePanelState
- getVehiclePlateText
- getVehicleSirenParams
- getVehicleSirens
- getVehicleSirensOn
- getVehicleTowedByVehicle
- getVehicleTowingVehicle
- getVehicleTurretPosition
- getVehicleType
- getVehicleUpgradeOnSlot
- getVehicleUpgradeSlotName
- getVehicleUpgrades
- getVehicleVariant
- getVehicleWheelStates
- isTrainDerailable
- isTrainDerailed
- isVehicleBlown
- isVehicleDamageProof
- isVehicleFuelTankExplodable
- isVehicleLocked
- isVehicleOnGround
- isVehicleTaxiLightOn
- removeVehicleUpgrade
- setTrainDerailable
- setTrainDerailed
- setTrainDirection
- setTrainPosition
- setTrainSpeed
- setTrainTrack
- setVehicleColor
- setVehicleDamageProof
- setVehicleDoorOpenRatio
- setVehicleDoorState
- setVehicleDoorsUndamageable
- setVehicleEngineState
- setVehicleFuelTankExplodable
- setVehicleHandling
- setVehicleHeadLightColor
- setVehicleLandingGearDown
- setVehicleLightState
- setVehicleLocked
- setVehicleOverrideLights
- setVehiclePaintjob
- setVehiclePanelState
- setVehiclePlateText
- setVehicleSirens
- setVehicleSirensOn
- setVehicleTaxiLightOn
- setVehicleTurretPosition
- setVehicleVariant
- setVehicleWheelStates